[PATCH xf86-video-ati 5/6] Move amdgpu_glamor_destroy_pixmap before amdgpu_glamor_create_pixmap

Michel Dänzer michel at daenzer.net
Tue Feb 16 08:29:08 UTC 2016


From: jimqu <Jim.Qu at amd.com>

The next commit will call the former from the latter. No functional
change.

Signed-off-by: JimQu <jim.qu at amd.com>
(ported from amdgpu commit 5269a2228bff6023c1a7f3e8534027e1d7addc25)

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/radeon_glamor.c | 70 ++++++++++++++++++++++++++---------------------------
 1 file changed, 35 insertions(+), 35 deletions(-)

diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
index 86db4e2..6a12b33 100644
--- a/src/radeon_glamor.c
+++ b/src/radeon_glamor.c
@@ -159,6 +159,41 @@ radeon_glamor_create_textured_pixmap(PixmapPtr pixmap, struct radeon_pixmap *pri
 						 pixmap->devKind);
 }
 
+static Bool radeon_glamor_destroy_pixmap(PixmapPtr pixmap)
+{
+#ifndef HAVE_GLAMOR_EGL_DESTROY_TEXTURED_PIXMAP
+	ScreenPtr screen = pixmap->drawable.pScreen;
+	RADEONInfoPtr info = RADEONPTR(xf86ScreenToScrn(screen));
+	Bool ret;
+#endif
+
+	if (pixmap->refcnt == 1) {
+		if (pixmap->devPrivate.ptr) {
+			struct radeon_bo *bo = radeon_get_pixmap_bo(pixmap);
+
+			if (bo)
+				radeon_bo_unmap(bo);
+		}
+
+#ifdef HAVE_GLAMOR_EGL_DESTROY_TEXTURED_PIXMAP
+		glamor_egl_destroy_textured_pixmap(pixmap);
+#endif
+		radeon_set_pixmap_bo(pixmap, NULL);
+	}
+
+#ifdef HAVE_GLAMOR_EGL_DESTROY_TEXTURED_PIXMAP
+	fbDestroyPixmap(pixmap);
+	return TRUE;
+#else
+	screen->DestroyPixmap = info->glamor.SavedDestroyPixmap;
+	ret = screen->DestroyPixmap(pixmap);
+	info->glamor.SavedDestroyPixmap = screen->DestroyPixmap;
+	screen->DestroyPixmap = radeon_glamor_destroy_pixmap;
+
+	return ret;
+#endif
+}
+
 static PixmapPtr
 radeon_glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
 			unsigned usage)
@@ -250,41 +285,6 @@ fallback_pixmap:
 		return fbCreatePixmap(screen, w, h, depth, usage);
 }
 
-static Bool radeon_glamor_destroy_pixmap(PixmapPtr pixmap)
-{
-#ifndef HAVE_GLAMOR_EGL_DESTROY_TEXTURED_PIXMAP
-	ScreenPtr screen = pixmap->drawable.pScreen;
-	RADEONInfoPtr info = RADEONPTR(xf86ScreenToScrn(screen));
-	Bool ret;
-#endif
-
-	if (pixmap->refcnt == 1) {
-		if (pixmap->devPrivate.ptr) {
-			struct radeon_bo *bo = radeon_get_pixmap_bo(pixmap);
-
-			if (bo)
-				radeon_bo_unmap(bo);
-		}
-
-#ifdef HAVE_GLAMOR_EGL_DESTROY_TEXTURED_PIXMAP
-		glamor_egl_destroy_textured_pixmap(pixmap);
-#endif
-		radeon_set_pixmap_bo(pixmap, NULL);
-	}
-
-#ifdef HAVE_GLAMOR_EGL_DESTROY_TEXTURED_PIXMAP
-	fbDestroyPixmap(pixmap);
-	return TRUE;
-#else
-	screen->DestroyPixmap = info->glamor.SavedDestroyPixmap;
-	ret = screen->DestroyPixmap(pixmap);
-	info->glamor.SavedDestroyPixmap = screen->DestroyPixmap;
-	screen->DestroyPixmap = radeon_glamor_destroy_pixmap;
-
-	return ret;
-#endif
-}
-
 #ifdef RADEON_PIXMAP_SHARING
 
 static Bool
-- 
2.7.0



More information about the xorg-driver-ati mailing list