xf86-video-intel: src/sna/sna_trapezoids.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Dec 12 01:42:06 PST 2014


 src/sna/sna_trapezoids.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 343299c78bfc1044da0b965e99de9ad312b05cca
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Dec 12 09:40:51 2014 +0000

    sna/trapezoids: Check the pixmap is wrapped before deferencing it
    
    When we AddTraps to a low resolution bitmap, we need to fallback as we
    don't wrap it with a GPU pixmap.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index 8131cb2..711446c 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -821,14 +821,13 @@ trap_upload(PicturePtr picture,
 void
 sna_add_traps(PicturePtr picture, INT16 x, INT16 y, int n, xTrap *t)
 {
-	struct sna *sna;
-	PixmapPtr pixmap;
+	PixmapPtr pixmap = get_drawable_pixmap(picture->pDrawable);
+	struct sna *sna = to_sna_from_pixmap(pixmap);
+	struct sna_pixmap *priv = sna_pixmap(pixmap);
 
 	DBG(("%s (%d, %d) x %d\n", __FUNCTION__, x, y, n));
 
-	pixmap = get_drawable_pixmap(picture->pDrawable);
-	sna = to_sna_from_pixmap(pixmap);
-	if (is_gpu_dst(sna_pixmap(pixmap))) {
+	if (priv && is_gpu_dst(priv)) {
 		if (trap_span_converter(sna, picture, x, y, n, t))
 			return;
 	}


More information about the xorg-commit mailing list