xf86-video-intel: 4 commits - src/sna/sna_driver.c src/sna/sna_glyphs.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Jul 12 11:51:31 PDT 2012


 src/sna/sna_driver.c |    3 ++-
 src/sna/sna_glyphs.c |   47 ++++++++++++++++++++++++-----------------------
 2 files changed, 26 insertions(+), 24 deletions(-)

New commits:
commit 22be9988b933f33fc5247a9abc3b00a7f2e4a202
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jul 12 19:49:34 2012 +0100

    sna: Check for failure to initialize the sprite pointers
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 0bb5c40..eee9527 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -891,7 +891,8 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL)
 	miInitializeBackingStore(screen);
 	xf86SetBackingStore(screen);
 	xf86SetSilkenMouse(screen);
-	miDCInitialize(screen, xf86GetPointerScreenFuncs());
+	if (!miDCInitialize(screen, xf86GetPointerScreenFuncs()))
+		return FALSE;
 
 	xf86DrvMsg(scrn->scrnIndex, X_INFO, "Initializing HW Cursor\n");
 	if (!xf86_cursors_init(screen, SNA_CURSOR_X, SNA_CURSOR_Y,
commit 32e7f4ee64867779b2def6fcd882708d7b0e2cf5
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jul 12 19:39:10 2012 +0100

    sna/glyphs: Fix array allocation for list_extents
    
    Originally I intended to skip assigning the box on the last list.
    However, loop simplicity failed and now we run the risk of writing
    beyond the end of stack_extents, and overwriting the list_extents
    pointer.
    
    Reported-by: Jiri Slaby <jirislaby at gmail.com>
    References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index cd29b07..f8959e1 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -1049,8 +1049,8 @@ glyphs_format(int nlist, GlyphListPtr list, GlyphPtr * glyphs)
 	BoxRec stack_extents[64], *list_extents = stack_extents;
 	int i, j;
 
-	if (nlist > ARRAY_SIZE(stack_extents) + 1) {
-		list_extents = malloc(sizeof(BoxRec) * (nlist-1));
+	if (nlist > ARRAY_SIZE(stack_extents)) {
+		list_extents = malloc(sizeof(BoxRec) * nlist);
 		if (list_extents == NULL)
 			return NULL;
 	}
commit 0477b5fb6f040f3bad86bb314a24df1bcd660aed
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jul 12 19:37:02 2012 +0100

    sna/glyphs: Apply mask reduction along fallback paths as well
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index aba5fef..cd29b07 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -108,6 +108,19 @@ static inline struct sna_glyph *sna_glyph(GlyphPtr glyph)
 
 #define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0)
 
+static bool op_is_bounded(uint8_t op)
+{
+	switch (op) {
+	case PictOpOver:
+	case PictOpOutReverse:
+	case PictOpAdd:
+	case PictOpXor:
+		return true;
+	default:
+		return false;
+	}
+}
+
 void sna_glyphs_close(struct sna *sna)
 {
 	struct sna_render *render = &sna->render;
@@ -1208,6 +1221,11 @@ glyphs_fallback(CARD8 op,
 	src_x += dx - list->xOff;
 	src_y += dy - list->yOff;
 
+	if (mask_format &&
+	    (op_is_bounded(op) || (nlist == 1 && list->len == 1)) &&
+	    mask_format == glyphs_format(nlist, list, glyphs))
+		mask_format = NULL;
+
 	if (mask_format) {
 		DBG(("%s: create mask (%d, %d)x(%d,%d) + (%d,%d) + (%d,%d), depth=%d, format=%lx [%lx], ca? %d\n",
 		     __FUNCTION__,
@@ -1258,8 +1276,7 @@ glyphs_fallback(CARD8 op,
 				if (picture == NULL)
 					goto next_glyph;
 
-				glyph_image = image_from_pict(picture,
-							      FALSE,
+				glyph_image = image_from_pict(picture, FALSE,
 							      &gx, &gy);
 				if (!glyph_image)
 					goto next_glyph;
@@ -1360,19 +1377,6 @@ cleanup_region:
 	RegionUninit(&region);
 }
 
-static bool op_is_bounded(uint8_t op)
-{
-	switch (op) {
-	case PictOpOver:
-	case PictOpOutReverse:
-	case PictOpAdd:
-	case PictOpXor:
-		return true;
-	default:
-		return false;
-	}
-}
-
 void
 sna_glyphs(CARD8 op,
 	   PicturePtr src,
commit 16aaa51b5d326f44974489f5b29716c7ff5ab48e
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jul 12 15:26:54 2012 +0100

    sna: Rearrange the tests for dropping the glyph mask
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 88e1c9e..aba5fef 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -1417,9 +1417,7 @@ sna_glyphs(CARD8 op,
 		goto fallback;
 	}
 
-	if (!mask ||
-	    (((nlist == 1 && list->len == 1) || op == PictOpAdd) &&
-	     dst->format == (mask->depth << 24 | mask->format))) {
+	if (mask == NULL) {
 		if (glyphs_to_dst(sna, op,
 				  src, dst,
 				  src_x, src_y,
@@ -1428,9 +1426,8 @@ sna_glyphs(CARD8 op,
 	}
 
 	/* Try to discard the mask for non-overlapping glyphs */
-	if (mask &&
-	    op_is_bounded(op) &&
-	    dst->pCompositeClip->data == NULL &&
+	if (mask && dst->pCompositeClip->data == NULL &&
+	    (op_is_bounded(op) || (nlist == 1 && list->len == 1)) &&
 	    mask == glyphs_format(nlist, list, glyphs)) {
 		if (glyphs_to_dst(sna, op,
 				  src, dst,


More information about the xorg-commit mailing list