diff options
author | Frank Binns <[email protected]> | 2015-07-31 09:11:46 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-08-06 16:49:46 +0100 |
commit | 84ef345dffec02d790db13fd6257e2c08eb0d56a (patch) | |
tree | 25d403e5ff6042db55e16be0dbc3e54b540bee78 | |
parent | 7722a24cab4b8880d45fb723205e2eedfada2055 (diff) |
egl/dri: Add error info needed for EGL_EXT_image_dma_buf_import extension
Update the DRI image interface error codes to reflect the needs of the
EGL_EXT_image_dma_buf_import extension. This means updating the existing error
code documentation and adding a new __DRI_IMAGE_ERROR_BAD_ACCESS error code
so that drivers can correctly reject unsupported pitches and offsets. Hook
the new error code up in EGL to return EGL_BAD_ACCESS.
Cc: <[email protected]>
Signed-off-by: Frank Binns <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
(cherry picked from commit cfc3200a35647026a0b5cf188f378ce33802044b)
-rw-r--r-- | include/GL/internal/dri_interface.h | 8 | ||||
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index c827bb640f3..6674af07cbe 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -1180,7 +1180,8 @@ enum __DRIChromaSiting { }; /** - * \name Reasons that __DRIimageExtensionRec::createImageFromTexture might fail + * \name Reasons that __DRIimageExtensionRec::createImageFromTexture or + * __DRIimageExtensionRec::createImageFromDmaBufs might fail */ /*@{*/ /** Success! */ @@ -1189,11 +1190,14 @@ enum __DRIChromaSiting { /** Memory allocation failure */ #define __DRI_IMAGE_ERROR_BAD_ALLOC 1 -/** Client requested an invalid attribute for a texture object */ +/** Client requested an invalid attribute */ #define __DRI_IMAGE_ERROR_BAD_MATCH 2 /** Client requested an invalid texture object */ #define __DRI_IMAGE_ERROR_BAD_PARAMETER 3 + +/** Client requested an invalid pitch and/or offset */ +#define __DRI_IMAGE_ERROR_BAD_ACCESS 4 /*@}*/ /** diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index c33efd78747..3837eac34c2 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -1510,6 +1510,10 @@ dri2_create_image_khr_texture_error(int dri_error) egl_error = EGL_BAD_PARAMETER; break; + case __DRI_IMAGE_ERROR_BAD_ACCESS: + egl_error = EGL_BAD_ACCESS; + break; + default: assert(0); egl_error = EGL_BAD_MATCH; |