summaryrefslogtreecommitdiff
path: root/src/radeon_glamor.c
diff options
context:
space:
mode:
authorjimqu <Jim.Qu@amd.com>2016-02-16 17:03:24 +0900
committerMichel Dänzer <michel@daenzer.net>2016-02-17 11:43:14 +0900
commit4cc32031467157ab8788f5c684fb1ac67ae96ff9 (patch)
treebd2374bcadc36f82ec58409588620a8d7acf54e5 /src/radeon_glamor.c
parenta9b181083d56b5de9b6822d0ed89fcc86de777a6 (diff)
Move radeon_glamor_destroy_pixmap before radeon_glamor_create_pixmap
The next commit will call the former from the latter. No functional change. Signed-off-by: JimQu <jim.qu@amd.com> (ported from amdgpu commit 5269a2228bff6023c1a7f3e8534027e1d7addc25) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/radeon_glamor.c')
-rw-r--r--src/radeon_glamor.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
index 86db4e20..6a12b334 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