summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-03-16 13:49:24 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-03-16 14:18:56 +0000
commited83d92b50fcd33a46b20f6a2431206db15d9530 (patch)
treecd218c0dabcf98dfb6a7314ffb0716463d01d80f /src/sna
parentcd864c005568c68610abb85e4a9453377a460aae (diff)
sna/present: Check incoming pitch before flipping
Framebuffers are restricted to pitches with a multiple of 64. Check before we flip. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/sna_present.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/sna/sna_present.c b/src/sna/sna_present.c
index f95a12c9..7a7650e0 100644
--- a/src/sna/sna_present.c
+++ b/src/sna/sna_present.c
@@ -494,6 +494,12 @@ sna_present_check_flip(RRCrtcPtr crtc,
return FALSE;
}
}
+
+ if (flip->gpu_bo->pitch & 63) {
+ DBG(("%s: pined bo, bad pitch=%d\n",
+ __FUNCTION__, flip->gpu_bo->pitch));
+ return FALSE;
+ }
}
return TRUE;
@@ -663,6 +669,11 @@ get_flip_bo(PixmapPtr pixmap)
return NULL;
}
+ if (priv->gpu_bo->pitch & 63) {
+ DBG(("%s: invalid pitch, no conversion\n", __FUNCTION__));
+ return NULL;
+ }
+
return priv->gpu_bo;
}