diff options
Diffstat (limited to 'glamor/glamor_egl.c')
-rw-r--r-- | glamor/glamor_egl.c | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c index 8638063ce..6eeb7f217 100644 --- a/glamor/glamor_egl.c +++ b/glamor/glamor_egl.c @@ -225,24 +225,6 @@ glamor_egl_check_has_gem(int fd) return FALSE; } -static void -glamor_egl_set_pixmap_image(PixmapPtr pixmap, EGLImageKHR image) -{ - struct glamor_pixmap_private *pixmap_priv = - glamor_get_pixmap_private(pixmap); - EGLImageKHR old; - - old = pixmap_priv->image; - if (old) { - ScreenPtr screen = pixmap->drawable.pScreen; - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - struct glamor_egl_screen_private *glamor_egl = glamor_egl_get_screen_private(scrn); - - eglDestroyImageKHR(glamor_egl->display, old); - } - pixmap_priv->image = image; -} - Bool glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride) { @@ -284,7 +266,7 @@ glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride) glamor_create_texture_from_image(screen, image, &texture); glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM); glamor_set_pixmap_texture(pixmap, texture); - glamor_egl_set_pixmap_image(pixmap, image); + eglDestroyImageKHR(glamor_egl->display, image); ret = TRUE; done: @@ -321,7 +303,6 @@ glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, glamor_create_texture_from_image(screen, image, &texture); glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM); glamor_set_pixmap_texture(pixmap, texture); - glamor_egl_set_pixmap_image(pixmap, image); if (pixmap_priv->gbm) gbm_bo_destroy(pixmap_priv->gbm); pixmap_priv->gbm = bo; @@ -532,13 +513,10 @@ glamor_egl_destroy_pixmap(PixmapPtr pixmap) Bool ret; if (pixmap->refcnt == 1) { +#ifdef GLAMOR_HAS_GBM struct glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); - if (pixmap_priv->image) - eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image); - -#ifdef GLAMOR_HAS_GBM if (pixmap_priv->gbm) { gbm_bo_destroy(pixmap_priv->gbm); pixmap_priv->gbm = NULL; @@ -557,7 +535,6 @@ glamor_egl_destroy_pixmap(PixmapPtr pixmap) _X_EXPORT void glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back) { - EGLImageKHR temp_image; struct gbm_bo *temp_bo; struct glamor_pixmap_private *front_priv = glamor_get_pixmap_private(front); @@ -566,10 +543,6 @@ glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back) glamor_pixmap_exchange_fbos(front, back); - temp_image = back_priv->image; - back_priv->image = front_priv->image; - front_priv->image = temp_image; - temp_bo = back_priv->gbm; back_priv->gbm = front_priv->gbm; front_priv->gbm = temp_bo; @@ -591,8 +564,10 @@ glamor_egl_close_screen(ScreenPtr screen) screen_pixmap = screen->GetScreenPixmap(screen); pixmap_priv = glamor_get_pixmap_private(screen_pixmap); - eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image); - pixmap_priv->image = NULL; + if (pixmap_priv->gbm) { + gbm_bo_destroy(pixmap_priv->gbm); + pixmap_priv->gbm = NULL; + } screen->CloseScreen = glamor_egl->saved_close_screen; |