summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac6
-rw-r--r--src/radeon_glamor.c18
2 files changed, 24 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 0ff901b0..0a95420b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,6 +119,12 @@ if test "x$GLAMOR" != "xno"; then
[Have glamor_glyphs_init API])], [],
[#include "xorg-server.h"
#include "glamor.h"])
+
+ AC_CHECK_DECL(glamor_egl_destroy_textured_pixmap,
+ [AC_DEFINE(HAVE_GLAMOR_EGL_DESTROY_TEXTURED_PIXMAP, 1,
+ [Have glamor_egl_destroy_textured_pixmap API])], [],
+ [#include "xorg-server.h"
+ #include "glamor.h"])
fi
if test "x$GLAMOR_XSERVER" != xyes; then
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