[Mesa-dev] [PATCH 1/3] egl: error out on eglCreateWaylandBufferFromImageWL

Emil Velikov emil.l.velikov at gmail.com
Mon May 15 15:14:15 UTC 2017


From: Emil Velikov <emil.velikov at collabora.com>

Currently f one does the silly thing by probing the entry point w/o
checking the extension they will attempt to use the extension even
though it cannot work.
That is due our of of an assert which gets removed in release builds.

Simply error out if the extension is not enabled. Thus we can
apply some cleanups with next commits.

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 src/egl/main/eglapi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index aa0eb94666a..bd0e92a5b74 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -2151,7 +2151,8 @@ eglCreateWaylandBufferFromImageWL(EGLDisplay dpy, EGLImage image)
    _EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL, EGL_FALSE);
 
    _EGL_CHECK_DISPLAY(disp, NULL, drv);
-   assert(disp->Extensions.WL_create_wayland_buffer_from_image);
+   if (!disp->Extensions.WL_create_wayland_buffer_from_image)
+      RETURN_EGL_EVAL(disp, NULL);
 
    img = _eglLookupImage(image, disp);
 
-- 
2.12.2



More information about the mesa-dev mailing list