xf86-video-intel: src/i830_driver.c uxa/uxa-glyphs.c

Chris Wilson ickle at kemper.freedesktop.org
Sun Jun 6 16:18:13 PDT 2010


 src/i830_driver.c |   11 +++++------
 uxa/uxa-glyphs.c  |   28 ++++++++++++++++++++++++----
 2 files changed, 29 insertions(+), 10 deletions(-)

New commits:
commit 8700673157fdd3a87ad5150f2f30823261fec519
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 7 00:16:18 2010 +0100

    Adapt glyphs for changes in devPrivates API
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 89a4525..39585d3 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1221,6 +1221,11 @@ I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
 
 	xf86SetBlackWhitePixels(screen);
 
+	miInitializeBackingStore(screen);
+	xf86SetBackingStore(screen);
+	xf86SetSilkenMouse(screen);
+	miDCInitialize(screen, xf86GetPointerScreenFuncs());
+
 	if (!I830AccelInit(screen)) {
 		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
 			   "Hardware acceleration initialization failed\n");
@@ -1235,13 +1240,7 @@ I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
 	} else
 		intel->batch_flush_notify = i830_batch_flush_notify;
 
-	miInitializeBackingStore(screen);
-	xf86SetBackingStore(screen);
-	xf86SetSilkenMouse(screen);
-	miDCInitialize(screen, xf86GetPointerScreenFuncs());
-
 	xf86DrvMsg(scrn->scrnIndex, X_INFO, "Initializing HW Cursor\n");
-
 	if (!xf86_cursors_init(screen, I810_CURSOR_X, I810_CURSOR_Y,
 			       (HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
 				HARDWARE_CURSOR_BIT_ORDER_MSBFIRST |
diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c
index fde4028..e679b4e 100644
--- a/uxa/uxa-glyphs.c
+++ b/uxa/uxa-glyphs.c
@@ -84,16 +84,24 @@ struct uxa_glyph {
 	uint16_t size, pos;
 };
 
-static int uxa_glyph_index;
+#if HAS_DEVPRIVATEKEYREC
+static DevPrivateKeyRec uxa_glyph_key;
+#else
+static int uxa_glyph_key;
+#endif
 
 static inline struct uxa_glyph *uxa_glyph_get_private(GlyphPtr glyph)
 {
-	return dixLookupPrivate(&glyph->devPrivates, &uxa_glyph_index);
+#if HAS_DEVPRIVATEKEYREC
+	return dixGetPrivate(&glyph->devPrivates, &uxa_glyph_key);
+#else
+	return dixLookupPrivate(&glyph->devPrivates, &uxa_glyph_key);
+#endif
 }
 
 static inline void uxa_glyph_set_private(GlyphPtr glyph, struct uxa_glyph *priv)
 {
-	dixSetPrivate(&glyph->devPrivates, &uxa_glyph_index, priv);
+	dixSetPrivate(&glyph->devPrivates, &uxa_glyph_key, priv);
 }
 
 #define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0)
@@ -189,8 +197,20 @@ bail:
 
 Bool uxa_glyphs_init(ScreenPtr pScreen)
 {
-	if (!dixRequestPrivate(&uxa_glyph_index, 0))
+	/* 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 HAS_DIXREGISTERPRIVATEKEY
+	if (!dixRegisterPrivateKey(&uxa_glyph_key, PRIVATE_GLYPH, 0))
+		return FALSE;
+#else
+	if (!dixRequestPrivate(&uxa_glyph_key, 0))
 		return FALSE;
+#endif
 
 	if (!uxa_realize_glyph_caches(pScreen))
 		return FALSE;


More information about the xorg-commit mailing list