[Glamor] [PATCH] init for glx modification

junyan.he at linux.intel.com junyan.he at linux.intel.com
Thu Jan 31 17:29:41 PST 2013


From: Junyan He <junyan.he at linux.intel.com>

---
 src/intel_dri.c    |    5 +-
 src/intel_driver.c |    3 +-
 src/intel_glamor.c |  367 ++++++++++++++++++++++++++++++++++------------------
 src/intel_glamor.h |    4 +-
 src/intel_uxa.c    |    3 +-
 uxa/uxa-accel.c    |   28 ++--
 uxa/uxa-glyphs.c   |    8 +-
 uxa/uxa-render.c   |    8 +-
 uxa/uxa.c          |    2 +-
 uxa/uxa.h          |    4 +-
 10 files changed, 277 insertions(+), 155 deletions(-)
 mode change 100644 => 100755 src/intel_glamor.c

diff --git a/src/intel_dri.c b/src/intel_dri.c
index 8cab73f..74c9e18 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -305,7 +305,6 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment,
 	pixmap = NULL;
 	if (attachment == DRI2BufferFrontLeft) {
 		pixmap = get_front_buffer(drawable);
-
 		if (pixmap == NULL) {
 			drawable = &(get_drawable_pixmap(drawable)->drawable);
 			is_glamor_pixmap = TRUE;
@@ -867,7 +866,7 @@ I830DRI2ScheduleFlip(struct intel_screen_private *intel,
 		drm_intel_bo_disable_reuse(new_back);
 		dri_bo_flink(new_back, &intel->back_name);
 
-		if ((intel->uxa_flags & UXA_USE_GLAMOR)) {
+		if ((intel->uxa_flags & UXA_GLAMOR_GL_INITIALIZED)) {
 			screen = draw->pScreen;
 			priv = info->front->driverPrivate;
 			front_pixmap = priv->pixmap;
@@ -900,7 +899,7 @@ I830DRI2ScheduleFlip(struct intel_screen_private *intel,
 
 	intel->back_buffer = intel->front_buffer;
 	drm_intel_bo_reference(intel->back_buffer);
-	if (!(intel->uxa_flags & UXA_USE_GLAMOR)) {
+	if (!(intel->uxa_flags & UXA_GLAMOR_GL_INITIALIZED)) {
 		intel_set_pixmap_bo(priv->pixmap, new_back);
 		drm_intel_bo_unreference(new_back);
 	}
diff --git a/src/intel_driver.c b/src/intel_driver.c
index ec887aa..1a0b458 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -50,6 +50,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "xf86cmap.h"
 #include "xf86drm.h"
 #include "compiler.h"
+#include "mibstore.h"
 #include "mipointer.h"
 #include "micmap.h"
 #include "shadowfb.h"
@@ -996,7 +997,7 @@ I830ScreenInit(SCREEN_INIT_ARGS_DECL)
 	intel->CreateScreenResources = screen->CreateScreenResources;
 	screen->CreateScreenResources = i830CreateScreenResources;
 
-	intel_glamor_init(screen);
+	intel_glamor_screen_init(screen);
 	if (!xf86CrtcScreenInit(screen))
 		return FALSE;
 
diff --git a/src/intel_glamor.c b/src/intel_glamor.c
old mode 100644
new mode 100755
index 55eb2de..0232f73
--- a/src/intel_glamor.c
+++ b/src/intel_glamor.c
@@ -41,66 +41,251 @@
 #include "uxa.h"
 #include "intel_options.h"
 
+static void
+intel_glamor_need_flush(DrawablePtr pDrawable)
+{
+	ScrnInfoPtr scrn = xf86ScreenToScrn(pDrawable->pScreen);
+	intel_screen_private * intel;
+
+	intel = intel_get_screen_private(scrn);
+	intel->needs_flush = TRUE;
+}
+
 void
-intel_glamor_exchange_buffers(struct intel_screen_private *intel,
-			      PixmapPtr src,
-			      PixmapPtr dst)
+intel_glamor_flush(intel_screen_private * intel)
 {
-	if (!(intel->uxa_flags & UXA_USE_GLAMOR))
+	ScreenPtr screen;
+
+	screen = xf86ScrnToScreen(intel->scrn);
+	if (intel->uxa_flags & UXA_GLAMOR_GL_INITIALIZED)
+		glamor_block_handler(screen);
+}
+
+static void
+intel_glamor_finish_access(PixmapPtr pixmap, uxa_access_t access)
+{
+	switch(access) {
+	case UXA_ACCESS_RO:
+	case UXA_ACCESS_RW:
+	case UXA_GLAMOR_ACCESS_RO:
+		break;
+	case UXA_GLAMOR_ACCESS_RW:
+		intel_glamor_need_flush(&pixmap->drawable);
+		break;
+	default:
+		ErrorF("Invalid access mode %d\n", access);
+	}
+
+	return;
+}
+
+static Bool
+intel_glamor_enabled(intel_screen_private *intel)
+{
+	const char *s;
+
+	s = xf86GetOptValString(intel->Options, OPTION_ACCEL_METHOD);
+	if (s == NULL)
+		return FALSE;
+
+	return strcasecmp(s, "glamor") == 0;
+}
+
+
+static void
+intel_glamor_client_callback(CallbackListPtr *list, pointer closure, pointer data)
+{
+	NewClientInfoRec *clientinfo = (NewClientInfoRec *) data;
+	ClientPtr pClient = clientinfo->client;
+	ScreenPtr screen = (ScreenPtr)closure;
+	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+	intel_screen_private *intel = intel_get_screen_private(scrn);
+
+	if (intel->uxa_driver->flags & UXA_GLAMOR_GL_INITIALIZED)
 		return;
-	glamor_egl_exchange_buffers(src, dst);
+
+	switch (pClient->clientState) {
+		case ClientStateRunning:
+			if(pClient->index && glamor_client_callback(screen)) {
+				intel->uxa_driver->flags |= UXA_GLAMOR_GL_INITIALIZED;
+				intel->uxa_flags |= intel->uxa_driver->flags;
+				intel->uxa_driver->finish_access = intel_glamor_finish_access;
+			} else {
+				ErrorF("Call glamor_client_glx_callback failed, all fallback\n");
+				intel->uxa_flags &= ~(UXA_USE_GLAMOR|UXA_GLAMOR_GL_INITIALIZED);
+			}
+			break;
+
+		default:
+			break;
+	}
+
+
 }
 
+
+/* The glamor init logic depend on the GLX extension, so we need to load
+   the module after all the extensions have been inited.
+   We seperate the init logic to several stages.
+   1. Pre init:  Just print the Glamor log.
+   2. Screen init: The extensions are not inited, so can not determine egl
+      or glx, so just register the screen and pixmap resource.
+   3. Create screen source: Now we know whether the glx extersnon is enabled.
+      We init the egl or glx depending on it.
+      If use egl, works done.
+      If use glx, because glx module's API are not available, we can just call
+      them by call __glx_dispatch indirectly. This will need make a fake client.
+      because the all clients is not inited now, we must post the work to first
+      client connecting to server.
+*/
+
 Bool
-intel_glamor_create_screen_resources(ScreenPtr screen)
+intel_glamor_pre_init(ScrnInfoPtr scrn)
+{
+	xf86DrvMsg(scrn->scrnIndex, X_INFO,
+	           "Preinitialize glamor. Glamor is compiled in\n");
+
+	return TRUE;
+}
+
+
+Bool
+intel_glamor_screen_init(ScreenPtr screen)
 {
 	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
 	intel_screen_private *intel = intel_get_screen_private(scrn);
 
-	if (!(intel->uxa_flags & UXA_USE_GLAMOR))
-		return TRUE;
+	if (!intel_glamor_enabled(intel))
+		goto fail;
 
-	if (!glamor_glyphs_init(screen))
-		return FALSE;
+	intel->uxa_flags |= UXA_USE_GLAMOR;
 
-	if (!glamor_egl_create_textured_screen_ext(screen,
-						   intel->front_buffer->handle,
-						   intel->front_pitch,
-						   &intel->back_pixmap))
-		return FALSE;
+	if (!glamor_screen_init(screen, GLAMOR_INVERTED_Y_AXIS | GLAMOR_USE_GL_SCREEN)) {
+		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+			   "Failed to initialize glamor screen.\n");
+		goto fail;
+	}
 
+	xf86DrvMsg(scrn->scrnIndex, X_INFO,
+		   "Use GLAMOR acceleration.\n");
 	return TRUE;
+
+fail:
+	xf86DrvMsg(scrn->scrnIndex, X_INFO,
+		   "Use standard UXA acceleration.\n");
+	return FALSE;
 }
 
+
 Bool
-intel_glamor_pre_init(ScrnInfoPtr scrn)
+intel_glamor_create_screen_resources(ScreenPtr screen)
 {
+	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
 	intel_screen_private *intel = intel_get_screen_private(scrn);
-	pointer glamor_module;
-	CARD32 version;
 
-	/* Load glamor module */
-	if ((glamor_module = xf86LoadSubModule(scrn, GLAMOR_EGL_MODULE_NAME))) {
+	if (!(intel->uxa_flags & UXA_USE_GLAMOR))
+		return TRUE;
+
+        if(!glamor_screen_use_glx(screen)) { /* EGL */
+		CARD32 version;
+		int gl_version;
+		void * dispatch;
+		pointer glamor_module = xf86LoadSubModule(scrn, GLAMOR_EGL_MODULE_NAME);
 		version = xf86GetModuleVersion(glamor_module);
 		if (version < MODULE_VERSION_NUMERIC(0,3,1)) {
 			xf86DrvMsg(scrn->scrnIndex, X_ERROR,
 			"Incompatible glamor version, required >= 0.3.0.\n");
+			goto FAILED;
 		} else {
+			/* Load the EGL module. */
 			if (glamor_egl_init(scrn, intel->drmSubFD)) {
 				xf86DrvMsg(scrn->scrnIndex, X_INFO,
-					   "glamor detected, initialising egl layer.\n");
-				intel->uxa_flags = UXA_GLAMOR_EGL_INITIALIZED;
-			} else
+					   "glamor detected, initializing egl layer.\n");
+			} else {
 				xf86DrvMsg(scrn->scrnIndex, X_WARNING,
 					   "glamor detected, failed to initialize egl.\n");
+				goto FAILED;
+			}
+
+			if (!glamor_egl_init_textured_pixmap(screen)) {
+				xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+					"Failed to initialize textured pixmap of screen for glamor.\n");
+				goto FAILED;
+			}
+
+
+			if (glamor_check_gl_version(screen)) {
+				xf86DrvMsg(scrn->scrnIndex, X_INFO, "GL version passed.\n");
+			} else {
+				xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+					   "GL version is not compatible.\n");
+				goto FAILED;
+			}
+
+			if(!glamor_gl_dispatch_init(screen)) {
+				xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+					"Init the EGL dispatch have some error\n");
+				goto FAILED;
+			}
+
+			if (!glamor_init_gl(screen)) {
+				xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+					"Init the GL have some error\n");
+				goto FAILED;
+			}
+
+			glamor_egl_screen_init(screen);
+
+			if (!glamor_post_init(screen,
+			            0 /*GLAMOR_USE_SCREEN|GLAMOR_USE_PICTURE_SCREEN*/)) {
+				xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+					"Init the post init have some error\n");
+				goto FAILED;
+			}
+
+			if (!glamor_glyphs_init(screen)) {
+				xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+					"Egl Create glyphs have some error\n");
+				goto FAILED;
+			}
+
+			if (!glamor_egl_create_textured_screen_ext(screen,
+				    intel->front_buffer->handle,
+				    intel->front_pitch,
+				    &intel->back_pixmap)) {
+				xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+					"Egl Create texture screen have some error\n");
+				goto FAILED;
+			}
+
+			intel->uxa_driver->flags |= UXA_GLAMOR_GL_INITIALIZED;
+			intel->uxa_flags |= intel->uxa_driver->flags;
+			intel->uxa_driver->finish_access = intel_glamor_finish_access;
 		}
-	} else
-		xf86DrvMsg(scrn->scrnIndex, X_WARNING,
-			   "glamor not available\n");
+        } else { /* GLX */
+		if (!glamor_glx_init(scrn, intel->drmSubFD)) {
+			xf86DrvMsg(scrn->scrnIndex, X_INFO, "Glamor GLX init failed!\n");
+			goto FAILED;
+		}
+
+		if (!AddCallback(&ClientStateCallback,
+			    intel_glamor_client_callback, screen)) {
+			DeleteCallback(&ClientStateCallback,
+				intel_glamor_client_callback, screen);
+			goto FAILED;
+		}
+
+	}
 
 	return TRUE;
+
+FAILED:
+	ErrorF("Init Glamor has some error, fallback to UXA\n");
+	intel->uxa_flags &= ~(UXA_USE_GLAMOR|UXA_GLAMOR_GL_INITIALIZED);
+	return FALSE;
 }
 
+
 PixmapPtr
 intel_glamor_create_pixmap(ScreenPtr screen, int w, int h,
 			   int depth, unsigned int usage)
@@ -108,31 +293,12 @@ intel_glamor_create_pixmap(ScreenPtr screen, int w, int h,
 	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
 	intel_screen_private *intel = intel_get_screen_private(scrn);
 
-	if (intel->uxa_flags & UXA_USE_GLAMOR)
+	if (intel->uxa_flags & UXA_GLAMOR_GL_INITIALIZED)
 		return glamor_create_pixmap(screen, w, h, depth, usage);
 	else
 		return NULL;
 }
 
-Bool
-intel_glamor_create_textured_pixmap(PixmapPtr pixmap)
-{
-	ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
-	intel_screen_private *intel = intel_get_screen_private(scrn);
-	struct intel_pixmap *priv;
-
-	if ((intel->uxa_flags & UXA_USE_GLAMOR) == 0)
-		return TRUE;
-
-	priv = intel_get_pixmap_private(pixmap);
-	if (glamor_egl_create_textured_pixmap(pixmap, priv->bo->handle,
-					      priv->stride)) {
-		drm_intel_bo_disable_reuse(priv->bo);
-		priv->pinned |= PIN_GLAMOR;
-		return TRUE;
-	} else
-		return FALSE;
-}
 
 void
 intel_glamor_destroy_pixmap(PixmapPtr pixmap)
@@ -141,98 +307,53 @@ intel_glamor_destroy_pixmap(PixmapPtr pixmap)
 	intel_screen_private * intel;
 
 	intel = intel_get_screen_private(scrn);
-	if (intel->uxa_flags & UXA_USE_GLAMOR)
-		glamor_egl_destroy_textured_pixmap(pixmap);
+	if (intel->uxa_flags & UXA_GLAMOR_GL_INITIALIZED)
+		glamor_destroy_pixmap(pixmap);
 }
 
-static void
-intel_glamor_need_flush(DrawablePtr pDrawable)
-{
-	ScrnInfoPtr scrn = xf86ScreenToScrn(pDrawable->pScreen);
-	intel_screen_private * intel;
 
-	intel = intel_get_screen_private(scrn);
-	intel->needs_flush = TRUE;
-}
 
-static void
-intel_glamor_finish_access(PixmapPtr pixmap, uxa_access_t access)
-{
-	switch(access) {
-	case UXA_ACCESS_RO:
-	case UXA_ACCESS_RW:
-	case UXA_GLAMOR_ACCESS_RO:
-		break;
-	case UXA_GLAMOR_ACCESS_RW:
-		intel_glamor_need_flush(&pixmap->drawable);
-		break;
-	default:
-		ErrorF("Invalid access mode %d\n", access);
-	}
 
-	return;
-}
 
-static Bool
-intel_glamor_enabled(intel_screen_private *intel)
-{
-	const char *s;
 
-	s = xf86GetOptValString(intel->Options, OPTION_ACCEL_METHOD);
-	if (s == NULL)
-		return FALSE;
-
-	return strcasecmp(s, "glamor") == 0;
+void
+intel_glamor_exchange_buffers(struct intel_screen_private *intel,
+			      PixmapPtr src,
+			      PixmapPtr dst)
+{
+	if (!(intel->uxa_flags & UXA_GLAMOR_GL_INITIALIZED))
+		return;
+	glamor_egl_exchange_buffers(src, dst);
 }
 
+
 Bool
-intel_glamor_init(ScreenPtr screen)
+intel_glamor_create_textured_pixmap(PixmapPtr pixmap)
 {
-	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+	ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
 	intel_screen_private *intel = intel_get_screen_private(scrn);
+	struct intel_pixmap *priv;
 
-	if ((intel->uxa_flags & UXA_GLAMOR_EGL_INITIALIZED) == 0)
-		goto fail;
-
-	if (!intel_glamor_enabled(intel))
-		goto fail;
-
-	if (!glamor_init(screen, GLAMOR_INVERTED_Y_AXIS | GLAMOR_USE_EGL_SCREEN)) {
-		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
-			   "Failed to initialize glamor.\n");
-		goto fail;
-	}
+	if ((intel->uxa_flags & UXA_GLAMOR_GL_INITIALIZED) == 0)
+		return TRUE;
 
-	if (!glamor_egl_init_textured_pixmap(screen)) {
-		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
-			   "Failed to initialize textured pixmap of screen for glamor.\n");
-		goto fail;
+	priv = intel_get_pixmap_private(pixmap);
+	if (!glamor_screen_use_glx(pixmap->drawable.pScreen) &&
+	    glamor_egl_create_textured_pixmap(pixmap, priv->bo->handle,
+					      priv->stride)) {
+		drm_intel_bo_disable_reuse(priv->bo);
+		priv->pinned |= PIN_GLAMOR;
+		return TRUE;
+	} else if (glamor_screen_use_glx(pixmap->drawable.pScreen) &&
+	           priv->bo && glamor_glx_fixup_tex(pixmap)) {
+		drm_intel_bo_disable_reuse(priv->bo);
+		priv->pinned |= PIN_GLAMOR;
+		return TRUE;
+	} else {
+		return FALSE;
 	}
-
-	intel->uxa_driver->flags |= UXA_USE_GLAMOR;
-	intel->uxa_flags |= intel->uxa_driver->flags;
-
-	intel->uxa_driver->finish_access = intel_glamor_finish_access;
-
-	xf86DrvMsg(scrn->scrnIndex, X_INFO,
-		   "Use GLAMOR acceleration.\n");
-	return TRUE;
-
-  fail:
-	xf86DrvMsg(scrn->scrnIndex, X_INFO,
-		   "Use standard UXA acceleration.\n");
-	return FALSE;
 }
 
-void
-intel_glamor_flush(intel_screen_private * intel)
-{
-	ScreenPtr screen;
-
-	screen = xf86ScrnToScreen(intel->scrn);
-	if (intel->uxa_flags & UXA_USE_GLAMOR)
-		glamor_block_handler(screen);
-}
 
 Bool
 intel_glamor_close_screen(ScreenPtr screen)
@@ -240,8 +361,8 @@ intel_glamor_close_screen(ScreenPtr screen)
 	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
 	intel_screen_private *intel = intel_get_screen_private(scrn);
 
-	if (intel->uxa_flags & UXA_USE_GLAMOR)
-		intel->uxa_flags &= ~UXA_USE_GLAMOR;
+	if (intel->uxa_flags & UXA_GLAMOR_GL_INITIALIZED)
+		intel->uxa_flags &= ~(UXA_USE_GLAMOR|UXA_GLAMOR_GL_INITIALIZED);
 
 	return TRUE;
 }
diff --git a/src/intel_glamor.h b/src/intel_glamor.h
index 46692bc..43d91d3 100644
--- a/src/intel_glamor.h
+++ b/src/intel_glamor.h
@@ -33,7 +33,7 @@
 #ifdef USE_GLAMOR
 
 Bool intel_glamor_pre_init(ScrnInfoPtr scrn);
-Bool intel_glamor_init(ScreenPtr screen);
+Bool intel_glamor_screen_init(ScreenPtr screen);
 Bool intel_glamor_create_screen_resources(ScreenPtr screen);
 Bool intel_glamor_close_screen(ScreenPtr screen);
 void intel_glamor_free_screen(int scrnIndex, int flags);
@@ -48,7 +48,7 @@ void intel_glamor_exchange_buffers(struct intel_screen_private *intel, PixmapPtr
 #else
 
 static inline Bool intel_glamor_pre_init(ScrnInfoPtr scrn) { return TRUE; }
-static inline Bool intel_glamor_init(ScreenPtr screen) { return TRUE; }
+static inline Bool intel_glamor_screen_init(ScreenPtr screen) { return TRUE; }
 static inline Bool intel_glamor_create_screen_resources(ScreenPtr screen) { return TRUE; }
 static inline Bool intel_glamor_close_screen(ScreenPtr screen) { return TRUE; }
 static inline void intel_glamor_free_screen(int scrnIndex, int flags) { }
diff --git a/src/intel_uxa.c b/src/intel_uxa.c
index 6d202c7..86da341 100644
--- a/src/intel_uxa.c
+++ b/src/intel_uxa.c
@@ -626,6 +626,7 @@ dri_bo *intel_get_pixmap_bo(PixmapPtr pixmap)
 	intel = intel_get_pixmap_private(pixmap);
 	if (intel == NULL)
 		return NULL;
+ErrorF("$$$$$$$$$$$$$$ no the bo handle is %d\n", intel->bo->handle);
 
 	return intel->bo;
 }
@@ -1166,7 +1167,7 @@ Bool intel_uxa_create_screen_resources(ScreenPtr screen)
 				   intel->front_pitch,
 				   NULL);
 	scrn->displayWidth = intel->front_pitch / intel->cpp;
-
+ErrorF("#######################Screen Pix's bo handle is %d\n", bo->handle);
 	if (!intel_glamor_create_screen_resources(screen))
 		return FALSE;
 
diff --git a/uxa/uxa-accel.c b/uxa/uxa-accel.c
index 76425fe..3a0381c 100644
--- a/uxa/uxa-accel.c
+++ b/uxa/uxa-accel.c
@@ -51,7 +51,7 @@ uxa_fill_spans(DrawablePtr pDrawable, GCPtr pGC, int n,
 	int x1, x2, y;
 	int off_x, off_y;
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok = 0;
 
 		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
@@ -213,7 +213,7 @@ uxa_put_image(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
 {
 	uxa_screen_t *uxa_screen = uxa_get_screen(pDrawable->pScreen);
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok = 0;
 
 		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
@@ -375,7 +375,7 @@ uxa_copy_n_to_n(DrawablePtr pSrcDrawable,
 	int dst_off_x, dst_off_y;
 	PixmapPtr pSrcPixmap, pDstPixmap;
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok = 0;
 
 		if (uxa_prepare_access(pSrcDrawable, UXA_GLAMOR_ACCESS_RO)) {
@@ -563,7 +563,7 @@ uxa_poly_point(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
 	xRectangle *prect;
 	uxa_screen_t *uxa_screen = uxa_get_screen(pDrawable->pScreen);
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok = 0;
 
 		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
@@ -614,7 +614,7 @@ uxa_poly_lines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
 	int i;
 	uxa_screen_t *uxa_screen = uxa_get_screen(pDrawable->pScreen);
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok = 0;
 
 		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
@@ -688,7 +688,7 @@ uxa_poly_segment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSeg)
 	int i;
 	uxa_screen_t *uxa_screen = uxa_get_screen(pDrawable->pScreen);
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok = 0;
 
 		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
@@ -763,7 +763,7 @@ uxa_poly_fill_rect(DrawablePtr pDrawable,
 	int xorg, yorg;
 	int n;
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok = 0;
 
 		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
@@ -889,7 +889,7 @@ uxa_get_spans(DrawablePtr pDrawable,
 	ScreenPtr screen = pDrawable->pScreen;
 	uxa_screen_t *uxa_screen = uxa_get_screen(screen);
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok = 0;
 
 		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
@@ -915,7 +915,7 @@ uxa_set_spans(DrawablePtr pDrawable, GCPtr gc, char *src,
 	ScreenPtr screen = pDrawable->pScreen;
 	uxa_screen_t *uxa_screen = uxa_get_screen(screen);
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok = 0;
 
 		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
@@ -942,7 +942,7 @@ uxa_copy_plane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
 	ScreenPtr screen = pDst->pScreen;
 	uxa_screen_t *uxa_screen = uxa_get_screen(screen);
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok = 0;
 		RegionPtr region;
 
@@ -972,7 +972,7 @@ uxa_image_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
 	ScreenPtr screen = pDrawable->pScreen;
 	uxa_screen_t *uxa_screen = uxa_get_screen(screen);
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok = 0;
 
 		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
@@ -996,7 +996,7 @@ uxa_poly_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
 	ScreenPtr screen = pDrawable->pScreen;
 	uxa_screen_t *uxa_screen = uxa_get_screen(screen);
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok = 0;
 
 		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
@@ -1019,7 +1019,7 @@ uxa_push_pixels(GCPtr pGC, PixmapPtr pBitmap,
 	ScreenPtr screen = pDrawable->pScreen;
 	uxa_screen_t *uxa_screen = uxa_get_screen(screen);
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok = 0;
 
 		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
@@ -1245,7 +1245,7 @@ uxa_get_image(DrawablePtr pDrawable, int x, int y, int w, int h,
 	Box.x2 = Box.x1 + w;
 	Box.y2 = Box.y1 + h;
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		ok = 0;
 		if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
 			ok = glamor_get_image_nf(pDrawable, x, y, w, h,
diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c
index 527942a..9fc0c26 100644
--- a/uxa/uxa-glyphs.c
+++ b/uxa/uxa-glyphs.c
@@ -112,7 +112,7 @@ static void uxa_unrealize_glyph_caches(ScreenPtr pScreen)
 	uxa_screen_t *uxa_screen = uxa_get_screen(pScreen);
 	int i;
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR)
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED)
 		return;
 
 	if (!uxa_screen->glyph_cache_initialized)
@@ -217,7 +217,7 @@ Bool uxa_glyphs_init(ScreenPtr pScreen)
 
 	uxa_screen_t *uxa_screen = uxa_get_screen(pScreen);
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR)
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED)
 		return TRUE;
 #if HAS_DIXREGISTERPRIVATEKEY
 	if (!dixRegisterPrivateKey(&uxa_glyph_key, PRIVATE_GLYPH, 0))
@@ -315,7 +315,7 @@ uxa_glyph_unrealize(ScreenPtr screen,
 	struct uxa_glyph *priv;
 	uxa_screen_t *uxa_screen = uxa_get_screen(screen);
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		glamor_glyph_unrealize(screen, glyph);
 		return;
 	}
@@ -980,7 +980,7 @@ uxa_glyphs(CARD8 op,
 	ScreenPtr screen = pDst->pDrawable->pScreen;
 	uxa_screen_t *uxa_screen = uxa_get_screen(screen);
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok;
 
 		uxa_picture_prepare_access(pDst, UXA_GLAMOR_ACCESS_RW);
diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c
index 4463dc2..e0836d3 100644
--- a/uxa/uxa-render.c
+++ b/uxa/uxa-render.c
@@ -1358,7 +1358,7 @@ uxa_composite(CARD8 op,
 	RegionRec region;
 	int tx, ty;
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok;
 
 		uxa_picture_prepare_access(pDst, UXA_GLAMOR_ACCESS_RW);
@@ -1723,7 +1723,7 @@ uxa_trapezoids(CARD8 op, PicturePtr src, PicturePtr dst,
 	BoxRec bounds;
 	Bool direct;
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok;
 
 		uxa_picture_prepare_access(dst, UXA_GLAMOR_ACCESS_RW);
@@ -1952,7 +1952,7 @@ uxa_triangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
 	BoxRec bounds;
 	Bool direct;
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok;
 
 		uxa_picture_prepare_access(pDst, UXA_GLAMOR_ACCESS_RW);
@@ -2055,7 +2055,7 @@ uxa_add_traps(PicturePtr pPicture,
 	ScreenPtr pScreen = pPicture->pDrawable->pScreen;
 	uxa_screen_t *uxa_screen = uxa_get_screen(pScreen);
 
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		int ok;
 
 		uxa_picture_prepare_access(pPicture, UXA_GLAMOR_ACCESS_RW);
diff --git a/uxa/uxa.c b/uxa/uxa.c
index 2635b50..9e6b8d4 100644
--- a/uxa/uxa.c
+++ b/uxa/uxa.c
@@ -195,7 +195,7 @@ uxa_validate_gc(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
 	 * may be pure GLAMOR pixmap, then we should let the glamor
 	 * to do the validation.
 	 */
-	if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+	if (uxa_screen->info->flags & UXA_GLAMOR_GL_INITIALIZED) {
 		glamor_validate_gc(pGC, changes, pDrawable);
 		goto set_ops;
 	}
diff --git a/uxa/uxa.h b/uxa/uxa.h
index b8569f0..cf8a468 100644
--- a/uxa/uxa.h
+++ b/uxa/uxa.h
@@ -554,10 +554,10 @@ typedef struct _UxaDriver {
  */
 #define UXA_USE_GLAMOR			(1 << 3)
 
-/* UXA_GLAMOR_EGL_INITIALIZED indicates glamor egl layer get initialized
+/* UXA_GLAMOR_GL_INITIALIZED indicates glamor gl layer get initialized
  * successfully. UXA layer does not use this flag, before call to
  * glamor_init, ddx need to check this flag. */
-#define UXA_GLAMOR_EGL_INITIALIZED	(1 << 4)
+#define UXA_GLAMOR_GL_INITIALIZED	(1 << 4)
 
 /** @} */
 /** @name UXA CreatePixmap hint flags
-- 
1.7.10.4



More information about the Glamor mailing list