summaryrefslogtreecommitdiff
path: root/src/radeon_glamor.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2015-11-10 16:31:09 +0900
committerMichel Dänzer <michel@daenzer.net>2015-11-17 12:25:15 +0900
commit10b7c3def58bb34acc38f076bc230e25b454ab79 (patch)
tree1dcae48f6dbc4441816c117242329c51793e870a /src/radeon_glamor.c
parent535e5438b2c32f774b9c8c27ee0289b4749548ef (diff)
glamor: Deal with glamor_egl_destroy_textured_pixmap being removed
When it's not available, it's safe to call down to the glamor DestroyPixmap hook instead. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/radeon_glamor.c')
-rw-r--r--src/radeon_glamor.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
index 8fb3a1ee..86db4e20 100644
--- a/src/radeon_glamor.c
+++ b/src/radeon_glamor.c
@@ -252,6 +252,12 @@ fallback_pixmap:
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);
@@ -260,11 +266,23 @@ static Bool radeon_glamor_destroy_pixmap(PixmapPtr pixmap)
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