[PATCH 5/7] glamor: Add radeon_pixmap parameter to radeon_glamor_create_textured_pixmap

Michel Dänzer michel at daenzer.net
Wed Apr 1 03:04:47 PDT 2015


From: Michel Dänzer <michel.daenzer at amd.com>

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/drmmode_display.c |  3 ++-
 src/radeon_glamor.c   | 16 ++++++----------
 src/radeon_glamor.h   |  6 ++++--
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index e68f17e..d8d3ca3 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -149,7 +149,8 @@ static PixmapPtr drmmode_create_bo_pixmap(ScrnInfoPtr pScrn,
 		}
 	}
 
-	if (!radeon_glamor_create_textured_pixmap(pixmap)) {
+	if (!radeon_glamor_create_textured_pixmap(pixmap,
+						  radeon_get_pixmap_private(pixmap))) {
 		pScreen->DestroyPixmap(pixmap);
 	  	return NULL;
 	}
diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
index 46148ad..74d9584 100644
--- a/src/radeon_glamor.c
+++ b/src/radeon_glamor.c
@@ -151,23 +151,19 @@ radeon_glamor_pre_init(ScrnInfoPtr scrn)
 }
 
 Bool
-radeon_glamor_create_textured_pixmap(PixmapPtr pixmap)
+radeon_glamor_create_textured_pixmap(PixmapPtr pixmap, struct radeon_pixmap *priv)
 {
 	ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
 	RADEONInfoPtr info = RADEONPTR(scrn);
-	struct radeon_pixmap *priv;
 
 	if ((info->use_glamor) == 0)
 		return TRUE;
 
-	priv = radeon_get_pixmap_private(pixmap);
 	if (!priv->stride)
 		priv->stride = pixmap->devKind;
-	if (glamor_egl_create_textured_pixmap(pixmap, priv->bo->handle,
-					      priv->stride))
-		return TRUE;
-	else
-		return FALSE;
+
+	return glamor_egl_create_textured_pixmap(pixmap, priv->bo->handle,
+						 priv->stride);
 }
 
 #ifndef CREATE_PIXMAP_USAGE_SHARED
@@ -222,7 +218,7 @@ radeon_glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
 
 		screen->ModifyPixmapHeader(pixmap, w, h, 0, 0, priv->stride, NULL);
 
-		if (!radeon_glamor_create_textured_pixmap(pixmap))
+		if (!radeon_glamor_create_textured_pixmap(pixmap, priv))
 			goto fallback_glamor;
 	}
 
@@ -298,7 +294,7 @@ radeon_glamor_set_shared_pixmap_backing(PixmapPtr pixmap, void *handle)
 	priv->stride = pixmap->devKind;
 	priv->surface = surface;
 
-	if (!radeon_glamor_create_textured_pixmap(pixmap)) {
+	if (!radeon_glamor_create_textured_pixmap(pixmap, priv)) {
 		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
 			   "Failed to get PRIME drawable for glamor pixmap.\n");
 		return FALSE;
diff --git a/src/radeon_glamor.h b/src/radeon_glamor.h
index e766bcc..8010b4a 100644
--- a/src/radeon_glamor.h
+++ b/src/radeon_glamor.h
@@ -51,12 +51,14 @@
 #define GLAMOR_USE_PICTURE_SCREEN 0
 #endif
 
+struct radeon_pixmap;
+
 Bool radeon_glamor_pre_init(ScrnInfoPtr scrn);
 Bool radeon_glamor_init(ScreenPtr screen);
 Bool radeon_glamor_create_screen_resources(ScreenPtr screen);
 void radeon_glamor_free_screen(int scrnIndex, int flags);
 
-Bool radeon_glamor_create_textured_pixmap(PixmapPtr pixmap);
+Bool radeon_glamor_create_textured_pixmap(PixmapPtr pixmap, struct radeon_pixmap *priv);
 void radeon_glamor_exchange_buffers(PixmapPtr src, PixmapPtr dst);
 
 XF86VideoAdaptorPtr radeon_glamor_xv_init(ScreenPtr pScreen, int num_adapt);
@@ -68,7 +70,7 @@ static inline Bool radeon_glamor_init(ScreenPtr screen) { return FALSE; }
 static inline Bool radeon_glamor_create_screen_resources(ScreenPtr screen) { return FALSE; }
 static inline void radeon_glamor_free_screen(int scrnIndex, int flags) { }
 
-static inline Bool radeon_glamor_create_textured_pixmap(PixmapPtr pixmap) { return TRUE; }
+static inline Bool radeon_glamor_create_textured_pixmap(PixmapPtr pixmap, struct radeon_pixmap *priv) { return TRUE; }
 
 static inline void radeon_glamor_exchange_buffers(PixmapPtr src, PixmapPtr dst) {}
 
-- 
2.1.4



More information about the xorg-driver-ati mailing list