From 282b87dd03317ff39eb409b0ac2cbdc17d7e5aa3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tapani=20P=C3=A4lli?= Date: Thu, 20 Oct 2016 13:51:40 +0300 Subject: [PATCH] egl: fix type mismatch error type in _eglInitSurface MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit EGL spec defines EGL_BAD_MATCH for windows, pixmaps and pbuffers in case where user creates a surface but config does not support rendering to such surface type. Following quotes are from EGL 1.5 spec 3.5 "Rendering Surfaces" : for eglCreatePlatformWindowSurface, eglCreateWindowSurface: "If config does not support rendering to windows (the EGL_SURFACE_TYPE attribute does not contain EGL_WINDOW_BIT ), an EGL_BAD_MATCH error is generated." for eglCreatePbufferSurface: "If config does not support pbuffers, an EGL_BAD_MATCH error is generated." for eglCreatePlatformPixmapSurface, eglCreatePixmapSurface: "If config does not support rendering to pixmaps (the EGL_SURFACE_TYPE attribute does not contain EGL_PIXMAP_BIT ), an EGL_BAD_MATCH error is generated." Fixes following dEQP test: dEQP-EGL.functional.negative_api.create_pbuffer_surface Signed-off-by: Tapani Pälli Reviewed-by: Eric Engestrom --- src/egl/main/eglsurface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/egl/main/eglsurface.c b/src/egl/main/eglsurface.c index 231a5f0..eb0bdfe 100644 --- a/src/egl/main/eglsurface.c +++ b/src/egl/main/eglsurface.c @@ -284,7 +284,7 @@ _eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type, if ((conf->SurfaceType & type) == 0) { /* The config can't be used to create a surface of this type */ - _eglError(EGL_BAD_CONFIG, func); + _eglError(EGL_BAD_MATCH, func); return EGL_FALSE; } -- 2.7.4