[PATCH xf86-video-amdgpu 1/5] glamor: Make amdgpu_glamor_create_textured_pixmap take amdgpu_buffer*

Michel Dänzer michel at daenzer.net
Wed Jun 15 10:00:46 UTC 2016


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

Preparation for the following fixes.

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/amdgpu_bo_helper.c | 2 +-
 src/amdgpu_glamor.c    | 8 ++++----
 src/amdgpu_glamor.h    | 2 +-
 src/drmmode_display.c  | 3 +--
 4 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/amdgpu_bo_helper.c b/src/amdgpu_bo_helper.c
index 783347b..f5a67e3 100644
--- a/src/amdgpu_bo_helper.c
+++ b/src/amdgpu_bo_helper.c
@@ -426,7 +426,7 @@ Bool amdgpu_set_shared_pixmap_backing(PixmapPtr ppix, void *fd_handle)
 
 #ifdef USE_GLAMOR
 		if (info->use_glamor &&
-		    !amdgpu_glamor_create_textured_pixmap(ppix, priv)) {
+		    !amdgpu_glamor_create_textured_pixmap(ppix, priv->bo)) {
 			free(priv->bo);
 			free(priv);
 			return FALSE;
diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c
index 3f4b1af..9785ad7 100644
--- a/src/amdgpu_glamor.c
+++ b/src/amdgpu_glamor.c
@@ -127,7 +127,7 @@ Bool amdgpu_glamor_pre_init(ScrnInfoPtr scrn)
 }
 
 Bool
-amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_pixmap *priv)
+amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_buffer *bo)
 {
 	ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen);
 	AMDGPUInfoPtr info = AMDGPUPTR(scrn);
@@ -136,7 +136,7 @@ amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_pixmap *pri
 	if ((info->use_glamor) == 0)
 		return TRUE;
 
-	if (!amdgpu_bo_get_handle(priv->bo, &bo_handle))
+	if (!amdgpu_bo_get_handle(bo, &bo_handle))
 		return FALSE;
 
 	return glamor_egl_create_textured_pixmap(pixmap, bo_handle,
@@ -233,7 +233,7 @@ amdgpu_glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
 
 		pixmap->devPrivate.ptr = NULL;
 
-		if (!amdgpu_glamor_create_textured_pixmap(pixmap, priv))
+		if (!amdgpu_glamor_create_textured_pixmap(pixmap, priv->bo))
 			goto fallback_glamor;
 	}
 
@@ -372,7 +372,7 @@ amdgpu_glamor_set_shared_pixmap_backing(PixmapPtr pixmap, void *handle)
 
 	priv = amdgpu_get_pixmap_private(pixmap);
 
-	if (!amdgpu_glamor_create_textured_pixmap(pixmap, priv)) {
+	if (!amdgpu_glamor_create_textured_pixmap(pixmap, priv->bo)) {
 		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
 			   "Failed to get PRIME drawable for glamor pixmap.\n");
 		return FALSE;
diff --git a/src/amdgpu_glamor.h b/src/amdgpu_glamor.h
index 05ca5cf..4473495 100644
--- a/src/amdgpu_glamor.h
+++ b/src/amdgpu_glamor.h
@@ -69,7 +69,7 @@ void amdgpu_glamor_flush(ScrnInfoPtr pScrn);
 void amdgpu_glamor_finish(ScrnInfoPtr pScrn);
 
 Bool
-amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_pixmap *priv);
+amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_buffer *bo);
 void amdgpu_glamor_exchange_buffers(PixmapPtr src, PixmapPtr dst);
 PixmapPtr amdgpu_glamor_set_pixmap_bo(DrawablePtr drawable, PixmapPtr pixmap);
 
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 7b326bb..a675c73 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -117,8 +117,7 @@ static PixmapPtr drmmode_create_bo_pixmap(ScrnInfoPtr pScrn,
 
 	amdgpu_set_pixmap_bo(pixmap, bo);
 
-	if (!amdgpu_glamor_create_textured_pixmap(pixmap,
-						  amdgpu_get_pixmap_private(pixmap))) {
+	if (!amdgpu_glamor_create_textured_pixmap(pixmap, bo)) {
 		pScreen->DestroyPixmap(pixmap);
 		return NULL;
 	}
-- 
2.8.1



More information about the xorg-driver-ati mailing list