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

Chris Wilson ickle at kemper.freedesktop.org
Mon Nov 7 03:41:38 PST 2011


 src/sna/sna_glyphs.c |   24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

New commits:
commit d4edbd480445bc6aadd2c9f17262bd4b3eefbca6
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Nov 7 11:16:06 2011 +0000

    sna/glyph: Fallback if we fail to clear the scratch pixmap for the glyph mask
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42663
    Reported-by: Clemens Eisserer <linuxhippy at gmail.com>
    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 aaa4cd2..a9dbed7 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -649,16 +649,16 @@ next_glyph:
 	return TRUE;
 }
 
-static void
+static bool
 clear_pixmap(struct sna *sna, PixmapPtr pixmap)
 {
 	struct sna_pixmap *priv = sna_pixmap(pixmap);
 	assert(priv->gpu_only);
-	sna->render.fill_one(sna, pixmap, priv->gpu_bo, 0,
-			     0, 0,
-			     pixmap->drawable.width,
-			     pixmap->drawable.height,
-			     GXclear);
+	return sna->render.fill_one(sna, pixmap, priv->gpu_bo, 0,
+				    0, 0,
+				    pixmap->drawable.width,
+				    pixmap->drawable.height,
+				    GXclear);
 }
 
 static Bool
@@ -725,11 +725,12 @@ glyphs_via_mask(struct sna *sna,
 	component_alpha = NeedsComponent(format->format);
 	if (width * height * format->depth < 8 * 256) {
 		pixman_image_t *mask_image;
-		int s = dst->pDrawable->pScreen->myNum;
+		int s;
 
 		DBG(("%s: smal mask, rendering glyphs to upload buffer\n",
 		     __FUNCTION__));
 
+upload:
 		pixmap = sna_pixmap_create_upload(screen,
 						  width, height,
 						  format->depth);
@@ -747,6 +748,7 @@ glyphs_via_mask(struct sna *sna,
 		}
 
 		memset(pixmap->devPrivate.ptr, 0, pixmap->devKind*height);
+		s = dst->pDrawable->pScreen->myNum;
 		do {
 			int n = list->len;
 			x += list->xOff;
@@ -793,8 +795,7 @@ glyphs_via_mask(struct sna *sna,
 						       mask_image,
 						       dx, dy,
 						       0, 0,
-						       xi,
-						       yi,
+						       xi, yi,
 						       g->info.width,
 						       g->info.height);
 				free_pixman_pict(picture, glyph_image);
@@ -830,7 +831,10 @@ next_image:
 			return FALSE;
 
 		ValidatePicture(mask);
-		clear_pixmap(sna, pixmap);
+		if (!clear_pixmap(sna, pixmap)) {
+			FreePicture(mask, 0);
+			goto upload;
+		}
 
 		memset(&tmp, 0, sizeof(tmp));
 		glyph_atlas = NULL;


More information about the xorg-commit mailing list