[PATCH 08/18] Do more checks for proposed flip pixmaps

Keith Packard keithp at keithp.com
Sat Aug 16 23:13:11 PDT 2014


Make sure the pitch matches the current framebuffer.
Make sure there's a BO we can get at.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 src/uxa/intel_present.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/uxa/intel_present.c b/src/uxa/intel_present.c
index 5f98da8..d5a8e5e 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;
 }
 
-- 
2.0.1



More information about the xorg-devel mailing list