diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2015-11-10 16:31:09 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2015-11-17 12:25:15 +0900 |
commit | 10b7c3def58bb34acc38f076bc230e25b454ab79 (patch) | |
tree | 1dcae48f6dbc4441816c117242329c51793e870a | |
parent | 535e5438b2c32f774b9c8c27ee0289b4749548ef (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>
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | src/radeon_glamor.c | 18 |
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 |