From 8901a99afb7be4f6f377a8e84e62e5d768c8443d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 9 Jun 2014 14:56:02 +0100 Subject: [PATCH] sna/dri2: Avoid trying to flip between bo with different pitches It could happen that we create front/back buffers with different pitches. The kernel refuses to flip between such buffers, and so we will hit some fallback paths that try to fix up the failed flips. Circumvent such by avoiding the flip. Signed-off-by: Chris Wilson --- src/sna/sna_dri2.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c index 5e1e7eaa..1baaf2bc 100644 --- a/src/sna/sna_dri2.c +++ b/src/sna/sna_dri2.c @@ -1459,6 +1459,14 @@ can_flip(struct sna * sna, return false; } + if (get_private(front)->bo->pitch != get_private(back)->bo->pitch) { + DBG(("%s -- no, pitch mismatch: front %d, back=%d\n", + __FUNCTION__, + get_private(front)->bo->pitch, + get_private(back)->bo->pitch)); + return false; + } + if (sna_pixmap(pixmap)->pinned & ~(PIN_DRI2 | PIN_SCANOUT)) { DBG(("%s -- no, pinned: front %x\n", __FUNCTION__, sna_pixmap(pixmap)->pinned));