summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>2018-11-13 14:08:03 +0000
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>2018-11-15 23:35:47 +0000
commitc79d8d223c266f113dce194dd0d929f46a9a3dea (patch)
tree21bd0613b94d7e35cc4baf91ad4d153268c77695
parentb84a94113eea238cd6eb8753899f177a3095587a (diff)
EGL_EXT_image_dma_buf_import: fix error check 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. " v2: Add spec quote (Eric) Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Fixes: 0ee445dbbc161f ("tests/spec: EXT_image_dma_buf_import invalid attributes") Reviewed-by: Eric Anholt <eric@anholt.net>
-rw-r--r--tests/spec/ext_image_dma_buf_import/invalid_attributes.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/spec/ext_image_dma_buf_import/invalid_attributes.c b/tests/spec/ext_image_dma_buf_import/invalid_attributes.c
index cc0b0462a..e4bc78f7d 100644
--- a/tests/spec/ext_image_dma_buf_import/invalid_attributes.c
+++ b/tests/spec/ext_image_dma_buf_import/invalid_attributes.c
@@ -162,10 +162,17 @@ test_invalid_format(unsigned w, unsigned h, int fd, unsigned stride,
EGL_NONE
};
+ /**
+ * The spec says:
+ *
+ * "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."
+ */
img = eglCreateImageKHR(eglGetCurrentDisplay(), EGL_NO_CONTEXT,
EGL_LINUX_DMA_BUF_EXT, (EGLClientBuffer)0, attr);
- if (!piglit_check_egl_error(EGL_BAD_ATTRIBUTE)) {
+ if (!piglit_check_egl_error(EGL_BAD_MATCH)) {
if (img)
eglDestroyImageKHR(eglGetCurrentDisplay(), img);
return false;