Browse Source

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>
tags/11.0-branchpoint
Frank Binns 10 years ago
parent
commit
cfc3200a35
2 changed files with 10 additions and 2 deletions
  1. 6
    2
      include/GL/internal/dri_interface.h
  2. 4
    0
      src/egl/drivers/dri2/egl_dri2.c

+ 6
- 2
include/GL/internal/dri_interface.h View File

}; };


/** /**
* \name Reasons that __DRIimageExtensionRec::createImageFromTexture might fail
* \name Reasons that __DRIimageExtensionRec::createImageFromTexture or
* __DRIimageExtensionRec::createImageFromDmaBufs might fail
*/ */
/*@{*/ /*@{*/
/** Success! */ /** Success! */
/** 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
/*@}*/ /*@}*/


/** /**

+ 4
- 0
src/egl/drivers/dri2/egl_dri2.c View File

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;

Loading…
Cancel
Save