From bef73cd9279be3438e467981db39c67bc13104f5 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 26 Jul 2012 21:54:33 +0100 Subject: [PATCH] sna/dri: Select the engine before emitting the wait So that if we have a flexible WAIT_FOR_EVENT that can go on either pipeline, we can choose our preferred pipeline for DRI. Signed-off-by: Chris Wilson --- src/sna/sna_dri.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c index 1daf1c47..8d6c305a 100644 --- a/src/sna/sna_dri.c +++ b/src/sna/sna_dri.c @@ -546,6 +546,14 @@ sna_dri_copy_to_front(struct sna *sna, DrawablePtr draw, RegionPtr region, } } + if (!wedged(sna)) { + if (sync) + sync = sna_pixmap_is_scanout(sna, pixmap); + + sna_dri_select_mode(sna, src_bo, sync); + } else + sync = false; + dx = dy = 0; if (draw->type != DRAWABLE_PIXMAP) { WindowPtr win = (WindowPtr)draw; @@ -569,7 +577,7 @@ sna_dri_copy_to_front(struct sna *sna, DrawablePtr draw, RegionPtr region, region = &clip; } - if (sync && sna_pixmap_is_scanout(sna, pixmap)) { + if (sync) { crtc = sna_covering_crtc(sna->scrn, &clip.extents, NULL); if (crtc) flush = sna_wait_for_scanline(sna, pixmap, crtc, @@ -595,8 +603,6 @@ sna_dri_copy_to_front(struct sna *sna, DrawablePtr draw, RegionPtr region, dst_bo, dx, dy, boxes, n); } else { - sna_dri_select_mode(sna, src_bo, flush); - sna->render.copy_boxes(sna, GXcopy, (PixmapPtr)draw, src_bo, -draw->x, -draw->y, pixmap, dst_bo, dx, dy,