summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-09 14:56:02 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-09 14:57:58 +0100
commit8901a99afb7be4f6f377a8e84e62e5d768c8443d (patch)
treeff6a6f49fcb92f8c6aaebd13464259bfbe97f30b
parent16574754a99c4472c1c90c426d9c1665a898f1d6 (diff)
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 <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_dri2.c8
1 files changed, 8 insertions, 0 deletions
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));