summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarad Gautam <varad@localhost.localdomain>2016-10-21 12:46:40 (GMT)
committerVarad Gautam <varadgautam@gmail.com>2016-10-21 13:44:18 (GMT)
commit9ad87e9ea58bbe46af28ea7cc13cce1c41334832 (patch)
tree23dffec8912c42093482e185a28191ee453360b7
parent138ea90c1c3c0b8946400f23a6b67406511315a8 (diff)
downloadmesa-9ad87e9ea58bbe46af28ea7cc13cce1c41334832.tar.gz
mesa-9ad87e9ea58bbe46af28ea7cc13cce1c41334832.tar.xz
egl: fix format/modifier query error codes
Signed-off-by: Varad Gautam <varad@localhost.localdomain>
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 3704763..db0cd5e 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -2115,17 +2115,17 @@ dri2_check_dma_buf_format(const _EGLImageAttribs *attrs)
}
static EGLBoolean
-dri2_query_dma_buf_formats (_EGLDriver *drv, _EGLDisplay *disp,
+dri2_query_dma_buf_formats(_EGLDriver *drv, _EGLDisplay *disp,
EGLint max, EGLint *formats, EGLint *count)
{
EGLint i;
- if (max < 0) {
- _eglError(EGL_BAD_ATTRIBUTE, "invalid value for max count of formats");
+ if (max < 0 || (max > 0 && formats == NULL)) {
+ _eglError(EGL_BAD_PARAMETER, "invalid value for max count of formats");
return EGL_FALSE;
}
- if (max == 0 || formats == NULL) {
+ if (max == 0) {
*count = ARRAY_SIZE(dma_buf_formats);
return EGL_TRUE;
}
@@ -2147,12 +2147,12 @@ dri2_query_dma_buf_modifiers(_EGLDriver *drv, _EGLDisplay *disp, EGLint format,
EGLint i;
if (max < 0) {
- _eglError(EGL_BAD_ATTRIBUTE, "invalid value for max count of formats");
+ _eglError(EGL_BAD_PARAMETER, "invalid value for max count of formats");
return EGL_FALSE;
}
if (max > 0 && modifiers == NULL) {
- _eglError(EGL_BAD_ATTRIBUTE, "invalid modifiers array");
+ _eglError(EGL_BAD_PARAMETER, "invalid modifiers array");
return EGL_FALSE;
}
@@ -2161,7 +2161,7 @@ dri2_query_dma_buf_modifiers(_EGLDriver *drv, _EGLDisplay *disp, EGLint format,
break;
}
if (i == ARRAY_SIZE(dma_buf_formats)) {
- _eglError(EGL_BAD_ATTRIBUTE, "invalid format");
+ _eglError(EGL_BAD_PARAMETER, "invalid format");
return EGL_FALSE;
}