diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-03-16 13:49:24 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-03-16 14:18:56 +0000 |
commit | ed83d92b50fcd33a46b20f6a2431206db15d9530 (patch) | |
tree | cd218c0dabcf98dfb6a7314ffb0716463d01d80f /src/sna | |
parent | cd864c005568c68610abb85e4a9453377a460aae (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.c | 11 |
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; } |