Mesa (master): egl/dri: fix error value with unknown drm format

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 16 10:28:46 UTC 2018


Module: Mesa
Branch: master
Commit: 1c56d211563300e8b837378962dd455d45d7956e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1c56d211563300e8b837378962dd455d45d7956e

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Tue Nov 13 14:10:45 2018 +0000

egl/dri: fix error value with unknown drm format

According to the EGL_EXT_image_dma_buf_import spec, creating an EGL
image with a DRM format not supported should yield the BAD_MATCH
error :

"
       * If <target> is EGL_LINUX_DMA_BUF_EXT, and the EGL_LINUX_DRM_FOURCC_EXT
         attribute is set to a format not supported by the EGL, EGL_BAD_MATCH
         is generated.
"

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Fixes: 20de7f9f226401 ("egl/dri2: support for creating images out of dma buffers")
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>
Reviewed-by: Chad Versace <chadversary at chromium.org>

---

 src/egl/drivers/dri2/egl_dri2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 3b63aebbf9..198ba73247 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -2310,7 +2310,7 @@ dri2_check_dma_buf_format(const _EGLImageAttribs *attrs)
 {
    unsigned plane_n = dri2_num_fourcc_format_planes(attrs->DMABufFourCC.Value);
    if (plane_n == 0) {
-      _eglError(EGL_BAD_ATTRIBUTE, "invalid format");
+      _eglError(EGL_BAD_MATCH, "unknown drm fourcc format");
       return 0;
    }
 




More information about the mesa-commit mailing list