diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-08-15 20:10:52 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-08-15 20:10:52 +0100 |
commit | 615739556dd1cc4565eb1c47f93fe8abd697802f (patch) | |
tree | 18975a06f53a8580083c011e7b9709fe966888e7 /src/sna/sna_display.c | |
parent | 2554d0d76e0fcae6e324938c28bb50deeb8814dc (diff) |
sna: Only continue to update the shadow buffer if the flips succeeded
If the flip fail, we disable the crtc and may end up disabling the
output, removing the shadow (and old scanout bo) in the process.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_display.c')
-rw-r--r-- | src/sna/sna_display.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 7754efa1..841d8417 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -2977,23 +2977,25 @@ disable: sna->mode.shadow_flip++; } - /* XXX only works if the kernel stalls fwrites to the current - * scanout whilst the flip is pending - */ - while (sna->mode.shadow_flip) - sna_mode_wakeup(sna); - (void)sna->render.copy_boxes(sna, GXcopy, - sna->front, new, 0, 0, - sna->front, old, 0, 0, - REGION_RECTS(region), - REGION_NUM_RECTS(region), - COPY_LAST); - kgem_submit(&sna->kgem); - - sna_pixmap(sna->front)->gpu_bo = old; - sna->mode.shadow = new; - - new->flush = old->flush; + if (sna->mode.shadow) { + /* XXX only works if the kernel stalls fwrites to the current + * scanout whilst the flip is pending + */ + while (sna->mode.shadow_flip) + sna_mode_wakeup(sna); + (void)sna->render.copy_boxes(sna, GXcopy, + sna->front, new, 0, 0, + sna->front, old, 0, 0, + REGION_RECTS(region), + REGION_NUM_RECTS(region), + COPY_LAST); + kgem_submit(&sna->kgem); + + sna_pixmap(sna->front)->gpu_bo = old; + sna->mode.shadow = new; + + new->flush = old->flush; + } RegionEmpty(region); } |