From 87c8f5a47e3abb7ff887aab45b6389cf9b8d8008 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 29 Jun 2012 09:33:09 +0100 Subject: [PATCH] sna: Make the post-flip delay explictit As the kernel is inconsistent in enforcing this across generations, handle the synchronisation of the pageflip explicity. Ultimately this should be replaced with a tripple buffer mechanism. Signed-off-by: Chris Wilson --- src/sna/sna_display.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 565e98c5..f1e0bedc 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -2825,11 +2825,14 @@ disable: /* 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)); + kgem_submit(&sna->kgem); sna_pixmap(sna->front)->gpu_bo = old; sna->mode.shadow = new;