summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-09-11 13:26:27 (GMT)
committerMicah Fedke <micah.fedke@collabora.co.uk>2017-01-09 20:24:07 (GMT)
commit0847661e5415fb3243f9cf197f5fa4dae006ebb1 (patch)
tree4e2677a9c6b877169a0bb6c564a447bfdde2d33e
parent150410ff895be6e85d59282950afeb6e93b2b225 (diff)
downloadmesa-4th_plane_3.tar.gz
mesa-4th_plane_3.tar.xz
egl: return error for unknown EGLImage attributes4th_plane_3
Commit 0135e5d6c83add5e539492a4899504e33f3f2434 "egl: Add support for more EGLImage extensions to EGL core." removed an error code for unknown EGLImage attributes without explaining why. EGL_KHR_image_base says: * If an attribute specified in <attrib_list> is not one of the attributes listed in Table bbb, the error EGL_BAD_PARAMETER is generated. Implement this. Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk>
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c12
-rw-r--r--src/egl/main/eglimage.c2
2 files changed, 10 insertions, 4 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 52fbdff..0c50dfb 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1771,14 +1771,18 @@ dri2_create_image_khr_texture(_EGLDisplay *disp, _EGLContext *ctx,
GLuint depth;
GLenum gl_target;
unsigned error;
+ EGLint err;
if (texture == 0) {
_eglError(EGL_BAD_PARAMETER, "dri2_create_image_khr");
return EGL_NO_IMAGE_KHR;
}
- if (_eglParseImageAttribList(&attrs, disp, attr_list) != EGL_SUCCESS)
+ err = _eglParseImageAttribList(&attrs, disp, attr_list);
+ if (err != EGL_SUCCESS){
+ _eglError(err, "dri2_create_image_khr_texture");
return EGL_NO_IMAGE_KHR;
+ }
switch (target) {
case EGL_GL_TEXTURE_2D_KHR:
@@ -1869,8 +1873,10 @@ dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, _EGLContext *ctx,
name = (EGLint) (uintptr_t) buffer;
err = _eglParseImageAttribList(&attrs, disp, attr_list);
- if (err != EGL_SUCCESS)
+ if (err != EGL_SUCCESS){
+ _eglError(err, "dri2_create_image_mesa_drm_buffer");
return NULL;
+ }
if (attrs.Width <= 0 || attrs.Height <= 0 ||
attrs.DRMBufferStrideMESA <= 0) {
@@ -2098,7 +2104,7 @@ dri2_create_image_dma_buf(_EGLDisplay *disp, _EGLContext *ctx,
err = _eglParseImageAttribList(&attrs, disp, attr_list);
if (err != EGL_SUCCESS) {
- _eglError(err, "bad attribute");
+ _eglError(err, "dri2_create_image_dma_buf");
return NULL;
}
diff --git a/src/egl/main/eglimage.c b/src/egl/main/eglimage.c
index 818b597..411d1ca 100644
--- a/src/egl/main/eglimage.c
+++ b/src/egl/main/eglimage.c
@@ -170,7 +170,7 @@ _eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
break;
default:
- /* unknown attrs are ignored */
+ err = EGL_BAD_PARAMETER;
break;
}