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: <mesa-stable@lists.freedesktop.org> Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
@@ -1178,7 +1178,8 @@ enum __DRIChromaSiting {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \name Reasons that __DRIimageExtensionRec::createImageFromTexture might fail
|
* \name Reasons that __DRIimageExtensionRec::createImageFromTexture or
|
||||||
|
* __DRIimageExtensionRec::createImageFromDmaBufs might fail
|
||||||
*/
|
*/
|
||||||
/*@{*/
|
/*@{*/
|
||||||
/** Success! */
|
/** Success! */
|
||||||
@@ -1187,11 +1188,14 @@ enum __DRIChromaSiting {
|
|||||||
/** Memory allocation failure */
|
/** Memory allocation failure */
|
||||||
#define __DRI_IMAGE_ERROR_BAD_ALLOC 1
|
#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
|
#define __DRI_IMAGE_ERROR_BAD_MATCH 2
|
||||||
|
|
||||||
/** Client requested an invalid texture object */
|
/** Client requested an invalid texture object */
|
||||||
#define __DRI_IMAGE_ERROR_BAD_PARAMETER 3
|
#define __DRI_IMAGE_ERROR_BAD_PARAMETER 3
|
||||||
|
|
||||||
|
/** Client requested an invalid pitch and/or offset */
|
||||||
|
#define __DRI_IMAGE_ERROR_BAD_ACCESS 4
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1545,6 +1545,10 @@ dri2_create_image_khr_texture_error(int dri_error)
|
|||||||
egl_error = EGL_BAD_PARAMETER;
|
egl_error = EGL_BAD_PARAMETER;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case __DRI_IMAGE_ERROR_BAD_ACCESS:
|
||||||
|
egl_error = EGL_BAD_ACCESS;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
egl_error = EGL_BAD_MATCH;
|
egl_error = EGL_BAD_MATCH;
|
||||||
|
Reference in New Issue
Block a user