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 <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-07-26 21:54:33 +01:00
parent 1ced4f1ddc
commit bef73cd927
1 changed files with 9 additions and 3 deletions

View File

@ -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,