diff options
author | Keith Packard <keithp@keithp.com> | 2014-07-19 19:59:43 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-09-12 13:50:37 -0700 |
commit | ff67a8d885d12d52693c33c52f3c551f69a8acf7 (patch) | |
tree | 658b4cb28e98f083b3c3ae427f422ff19bbd52d4 | |
parent | 61305740ef3dcd4ee10b335574d659d7c886d29a (diff) |
Do more checks for proposed flip pixmaps
Make sure the pitch matches the current framebuffer.
Make sure there's a BO we can get at.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
-rw-r--r-- | src/uxa/intel_present.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/uxa/intel_present.c b/src/uxa/intel_present.c index 5f98da8f..d5a8e5e0 100644 --- a/src/uxa/intel_present.c +++ b/src/uxa/intel_present.c @@ -246,6 +246,7 @@ intel_present_check_flip(RRCrtcPtr crtc, ScreenPtr screen = window->drawable.pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); intel_screen_private *intel = intel_get_screen_private(scrn); + dri_bo *bo; if (!scrn->vtSema) return FALSE; @@ -259,6 +260,15 @@ intel_present_check_flip(RRCrtcPtr crtc, if (crtc && !intel_crtc_on(crtc->devPrivate)) return FALSE; + /* Check stride, can't change that on flip */ + if (pixmap->devKind != intel->front_pitch) + return FALSE; + + /* Make sure there's a bo we can get to */ + bo = intel_get_pixmap_bo(pixmap); + if (!bo) + return FALSE; + return TRUE; } |