diff options
Diffstat (limited to 'src/radeon_glamor.c')
-rw-r--r-- | src/radeon_glamor.c | 70 |
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 |