summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2016-08-16 13:04:37 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2016-10-14 12:16:05 +0100
commit8fb9ea413de31cc6a95ac4c38215b621de728687 (patch)
tree01b19e62da5d6cad31f25ce49584180902859674 /src/egl/drivers/dri2
parent02f1158746425617a5e4f5bff4575d7c416d6978 (diff)
downloadexternal_mesa3d-8fb9ea413de31cc6a95ac4c38215b621de728687.zip
external_mesa3d-8fb9ea413de31cc6a95ac4c38215b621de728687.tar.gz
external_mesa3d-8fb9ea413de31cc6a95ac4c38215b621de728687.tar.bz2
egl/dri2: move surface refcounting out of the platform code
All the platforms are duplicating what should be a driver/dri2 thing - refcounting. Just fold it accordingly. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Diffstat (limited to 'src/egl/drivers/dri2')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c4
-rw-r--r--src/egl/drivers/dri2/platform_android.c3
-rw-r--r--src/egl/drivers/dri2/platform_drm.c3
-rw-r--r--src/egl/drivers/dri2/platform_surfaceless.c3
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c3
-rw-r--r--src/egl/drivers/dri2/platform_x11.c3
-rw-r--r--src/egl/drivers/dri2/platform_x11_dri3.c3
7 files changed, 4 insertions, 18 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index bedb0bc..dacdfbd 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1366,6 +1366,10 @@ static EGLBoolean
dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+
+ if (!_eglPutSurface(surf))
+ return EGL_TRUE;
+
return dri2_dpy->vtbl->destroy_surface(drv, dpy, surf);
}
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index f868984..9581c96 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -344,9 +344,6 @@ droid_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
- if (!_eglPutSurface(surf))
- return EGL_TRUE;
-
droid_free_local_buffers(dri2_surf);
if (dri2_surf->base.Type == EGL_WINDOW_BIT) {
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index 47add12..2668dff 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -191,9 +191,6 @@ dri2_drm_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
unsigned i;
- if (!_eglPutSurface(surf))
- return EGL_TRUE;
-
(*dri2_dpy->core->destroyDrawable)(dri2_surf->dri_drawable);
for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c
index e0d383b..b4653cc 100644
--- a/src/egl/drivers/dri2/platform_surfaceless.c
+++ b/src/egl/drivers/dri2/platform_surfaceless.c
@@ -161,9 +161,6 @@ surfaceless_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *sur
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
- if (!_eglPutSurface(surf))
- return EGL_TRUE;
-
surfaceless_free_images(dri2_surf);
(*dri2_dpy->core->destroyDrawable)(dri2_surf->dri_drawable);
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index cbdcd76..8daa2d3 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -229,9 +229,6 @@ dri2_wl_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
(void) drv;
- if (!_eglPutSurface(surf))
- return EGL_TRUE;
-
(*dri2_dpy->core->destroyDrawable)(dri2_surf->dri_drawable);
for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index 179152f..06b8e1b 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -386,9 +386,6 @@ dri2_x11_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
(void) drv;
- if (!_eglPutSurface(surf))
- return EGL_TRUE;
-
(*dri2_dpy->core->destroyDrawable)(dri2_surf->dri_drawable);
if (dri2_dpy->dri2) {
diff --git a/src/egl/drivers/dri2/platform_x11_dri3.c b/src/egl/drivers/dri2/platform_x11_dri3.c
index d93f5bc..26bb430 100644
--- a/src/egl/drivers/dri2/platform_x11_dri3.c
+++ b/src/egl/drivers/dri2/platform_x11_dri3.c
@@ -142,9 +142,6 @@ dri3_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
(void) drv;
- if (!_eglPutSurface(surf))
- return EGL_TRUE;
-
loader_dri3_drawable_fini(&dri3_surf->loader_drawable);
free(surf);