Hi, In order to constrain the expansion of DRM fourcc values to support non presentable formats like arrays of integers, or allowing per-plane imports of YUV surfaces, I am proposing the following change to the EXT_image_dma_buf specification.
The idea here is to allow the application to specify the dma_buf layout with standard GL or GLES "texture" internal formats. Note: I borrowed the EGL token from the equivalent GL namespace. Regards, Gwenole Beauchesne (2): dri: add support for EXT_dma_buf_import revision #7. i965: add support for EXT_image_dma_buf_import revision #7. include/EGL/eglext.h | 1 + include/GL/internal/dri_interface.h | 16 +++++++++++++++ src/egl/drivers/dri2/egl_dri2.c | 12 ++++++++++- src/egl/main/eglimage.c | 5 +++++ src/egl/main/eglimage.h | 1 + src/mesa/drivers/dri/common/dri_util.c | 6 ++++-- src/mesa/drivers/dri/i965/intel_screen.c | 32 +++++++++++++++++++++++++++++- 7 files changed, 69 insertions(+), 4 deletions(-) diff --git a/extensions/EXT/EGL_EXT_image_dma_buf_import.txt b/extensions/EXT/EGL_EXT_image_dma_buf_import.txt index 8cdb3b4..c96685f 100644 --- a/extensions/EXT/EGL_EXT_image_dma_buf_import.txt +++ b/extensions/EXT/EGL_EXT_image_dma_buf_import.txt @@ -23,7 +23,7 @@ Status Version - Version 6, December 05, 2013 + Version 7, March 19, 2014 Number @@ -63,6 +63,7 @@ New Tokens Accepted as an attribute in the <attrib_list> parameter of eglCreateImageKHR: + EGL_IMAGE_INTERNAL_FORMAT_EXT 0x1003 EGL_LINUX_DRM_FOURCC_EXT 0x3271 EGL_DMA_BUF_PLANE0_FD_EXT 0x3272 EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273 @@ -136,6 +137,11 @@ Additions to Chapter 2 of the EGL 1.2 Specification (EGL Operation) subsequent rows of samples in plane 0. May have special meaning for non-linear formats. + If the EGL_LINUX_DRM_FOURCC_EXT attribute is omitted, or if its value is + set to zero (0), then the EGL_IMAGE_INTERNAL_FORMAT_EXT attribute can be + used to specify the pixel format of the buffer. The associated value is + one of the standard OpenGL or OpenGL ES texture internal formats. + For images in an RGB color-space or those using a single-plane YUV format, only the first plane's file descriptor, offset & pitch should be specified. For semi-planar YUV formats, the chroma samples are stored in plane 1 and @@ -217,6 +223,10 @@ Additions to Chapter 2 of the EGL 1.2 Specification (EGL Operation) generated if any of the EGL_DMA_BUF_PLANE1_* or EGL_DMA_BUF_PLANE2_* attributes are specified. + * If <target> is EGL_LINUX_DMA_BUF_EXT, and the EGL_LINUX_DRM_FOURCC_EXT + attribute is omitted or set to zero (0), EGL_IMAGE_INTERNAL_FORMAT_EXT + shall be present instead or EGL_BAD_MATCH is generated. + * If <target> is EGL_LINUX_DMA_BUF_EXT and the value specified for EGL_YUV_COLOR_SPACE_HINT_EXT is not EGL_ITU_REC601_EXT, EGL_ITU_REC709_EXT or EGL_ITU_REC2020_EXT, EGL_BAD_ATTRIBUTE is @@ -234,7 +244,7 @@ Additions to Chapter 2 of the EGL 1.2 Specification (EGL Operation) * If <target> is EGL_LINUX_DMA_BUF_EXT and one or more of the values specified for a plane's pitch or offset isn't supported by EGL, - EGL_BAD_ACCESS is generated. + EGL_BAD_ACCESS is generated." Issues @@ -295,6 +305,9 @@ Issues ANSWER: Go for option 2) and just use values defined in drm_fourcc.h. + As of revision #7, it is now also permitted to specify the image format + with a standard OpenGL or OpenGL ES texture internal format. + 8. How can AYUV images be handled? ANSWER: At least on fourcc.org and in drm_fourcc.h, there only seems to be @@ -372,6 +385,10 @@ Issues Revision History +#7 (Gwenole Beauchesne, March 19, 2014) + - Added an additional attribute to allow an application to specify the pixel + format of a dma_buf with standard GL enum values. + #6 (David Garbett, December 05, 2013) - Application now retains ownership of dma_buf file descriptors. -- 1.7.9.5 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev