xf86-video-intel: uxa/uxa-glyphs.c uxa/uxa-priv.h

Chris Wilson ickle at kemper.freedesktop.org
Mon Jan 24 12:30:21 PST 2011


 uxa/uxa-glyphs.c |   20 +++++++++-----------
 uxa/uxa-priv.h   |    1 +
 2 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit c6dc27562abbc8ca9e873ad502ca49ae010461d2
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jan 24 20:25:27 2011 +0000

    uxa: Only recreate the glyph cache on *generational* updates
    
    The screen resources are recreated when the screen is rotated as well,
    without being finalized. In this case, we do not need to reconstuct the
    cache (or if we did, we would need to tear it down first).
    
    Reported-by: Till Matthiesen <entropy at everymail.net>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33412
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c
index 420e891..0f5ddda 100644
--- a/uxa/uxa-glyphs.c
+++ b/uxa/uxa-glyphs.c
@@ -111,6 +111,9 @@ static void uxa_unrealize_glyph_caches(ScreenPtr pScreen)
 	uxa_screen_t *uxa_screen = uxa_get_screen(pScreen);
 	int i;
 
+	if (!uxa_screen->glyph_cache_initialized)
+		return;
+
 	for (i = 0; i < UXA_NUM_GLYPH_CACHE_FORMATS; i++) {
 		uxa_glyph_cache_t *cache = &uxa_screen->glyphCaches[i];
 
@@ -120,6 +123,7 @@ static void uxa_unrealize_glyph_caches(ScreenPtr pScreen)
 		if (cache->glyphs)
 			free(cache->glyphs);
 	}
+	uxa_screen->glyph_cache_initialized = FALSE;
 }
 
 void uxa_glyphs_fini(ScreenPtr pScreen)
@@ -145,6 +149,10 @@ static Bool uxa_realize_glyph_caches(ScreenPtr pScreen)
 	};
 	int i;
 
+	if (uxa_screen->glyph_cache_initialized)
+		return TRUE;
+
+	uxa_screen->glyph_cache_initialized = TRUE;
 	memset(uxa_screen->glyphCaches, 0, sizeof(uxa_screen->glyphCaches));
 
 	for (i = 0; i < sizeof(formats)/sizeof(formats[0]); i++) {
@@ -214,17 +222,7 @@ Bool uxa_glyphs_init(ScreenPtr pScreen)
 	if (uxa_get_screen(pScreen)->force_fallback)
 		return TRUE;
 
-	/* We are trying to initialise per screen resources prior to the
-	 * complete initialisation of the screen. So ensure the components
-	 * that we depend upon are initialsed prior to our use.
-	 */
-	if (!CreateScratchPixmapsForScreen(pScreen->myNum))
-		return FALSE;
-
-	if (!uxa_realize_glyph_caches(pScreen))
-		return FALSE;
-
-	return TRUE;
+	return uxa_realize_glyph_caches(pScreen);
 }
 
 /* The most efficient thing to way to upload the glyph to the screen
diff --git a/uxa/uxa-priv.h b/uxa/uxa-priv.h
index 92536cc..ac206af 100644
--- a/uxa/uxa-priv.h
+++ b/uxa/uxa-priv.h
@@ -139,6 +139,7 @@ typedef struct {
 	unsigned offScreenCounter;
 
 	uxa_glyph_cache_t glyphCaches[UXA_NUM_GLYPH_CACHE_FORMATS];
+	Bool glyph_cache_initialized;
 
 	PicturePtr solid_clear, solid_black, solid_white;
 	uxa_solid_cache_t solid_cache[UXA_NUM_SOLID_CACHE];


More information about the xorg-commit mailing list