From 9b42fd1772b13b10f397d80d11aa8351e6313085 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Tue, 18 Feb 2014 03:04:03 +0000 Subject: dri_interface: Update __DRItexBufferExtensionRec to version 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With commit e59fa4c46c8("dri2: release texture image.") we updated the extension without bumping the version number. The patch itself added an interface required to enable texture_from_pixmap on certain platforms. The new code was effectively never build, as it depended on __DRI_TEX_BUFFER_VERSION >= 3, which never came to be in upstream mesa. This commit bumps the version number, drops the __DRI_TEX_BUFFER_VERSION checks and resolves all the build conflicts. Additionally it add a version check as egl and dri3, as require version 2 of the extension which does not have the releaseTexBuffer hook. Cc: Juan Zhao Cc: Kristian Høgsberg Signed-off-by: Emil Velikov Reviewed-by: Ian Romanick Reviewed-by: Kristian Høgsberg --- src/egl/drivers/dri2/egl_dri2.c | 13 +++++++------ src/egl/main/eglsurface.c | 11 +++++++++++ src/egl/main/eglsurface.h | 3 +++ 3 files changed, 21 insertions(+), 6 deletions(-) (limited to 'src/egl') diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index a132964ea21..81a354236f4 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -1189,7 +1189,6 @@ static EGLBoolean dri2_release_tex_image(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, EGLint buffer) { -#if __DRI_TEX_BUFFER_VERSION >= 3 struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf); struct dri2_egl_context *dri2_ctx; @@ -1209,11 +1208,13 @@ dri2_release_tex_image(_EGLDriver *drv, default: assert(0); } - if (dri2_dpy->tex_buffer->releaseTexBuffer!=NULL) - (*dri2_dpy->tex_buffer->releaseTexBuffer)(dri2_ctx->dri_context, - target, - dri2_surf->dri_drawable); -#endif + + if (dri2_dpy->tex_buffer->base.version >= 3 && + dri2_dpy->tex_buffer->releaseTexBuffer != NULL) { + (*dri2_dpy->tex_buffer->releaseTexBuffer)(dri2_ctx->dri_context, + target, + dri2_surf->dri_drawable); + } return EGL_TRUE; } diff --git a/src/egl/main/eglsurface.c b/src/egl/main/eglsurface.c index c5ea2245b3d..e2cb73b7e91 100644 --- a/src/egl/main/eglsurface.c +++ b/src/egl/main/eglsurface.c @@ -531,6 +531,17 @@ _eglBindTexImage(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface, return EGL_TRUE; } +EGLBoolean +_eglReleaseTexImage(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, + EGLint buffer) +{ + /* TODO: do basic error checking and return success/fail. + * Drivers must implement the real stuff. + */ + + return EGL_TRUE; +} + EGLBoolean _eglSwapInterval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, diff --git a/src/egl/main/eglsurface.h b/src/egl/main/eglsurface.h index a9541239701..d13d301f643 100644 --- a/src/egl/main/eglsurface.h +++ b/src/egl/main/eglsurface.h @@ -94,6 +94,9 @@ _eglSurfaceAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint a PUBLIC extern EGLBoolean _eglBindTexImage(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint buffer); +PUBLIC extern EGLBoolean +_eglReleaseTexImage(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf, EGLint buffer); + extern EGLBoolean _eglSwapInterval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint interval); -- cgit v1.2.3