[Mesa-dev] [v8] EXT_image_dma_buf_import for intel

Topi Pohjolainen topi.pohjolainen at intel.com
Wed Jul 24 03:23:32 PDT 2013


The set introduces new target for 'eglCreateImageKHR()' allowing one
to create EGL images out of externally allocated buffers. For now
only natively supported RGB formatted buffers are accepted.

This revision ties the dma-buffer import extension tightly with the
image external extension. One can access the dma-buffers only for
reading and via the image external sampler. Image external extension
itseff is not previously supported and here it is enabled solely for
imported dma-buffers and for nothing else.

I left the generic plumbing for YUV specific attributes in place as
people spent quite a bit of time reviewing it and it is likely to be
useful later on.

v2:
   - added support for treating buffers having packed format
     separately from the planar (that require special care)
       intel: allow packed prime buffers to be treated normally

   - tried to address all Eric's comments:  
       intel: refactor planar format lookup
       intel: prepare for dri images having more than plane

   - added missing check for explicit "no context"
       egl: definitions for EXT_image_dma_buf_import

v3-4:
   - close the file descriptors as the ownership is transferred
     to EGL
   - declare the extension as EGL (not GLES)
   - import EGL definitions from khronos
   - no not break DRI image ABI, but introduce new entry and update
     the version of the interface

v5-6:
   - clarified the use of regions-array (Chad)
   - omit duplication of image with no regions (Chad)
   - distinguish invalid drm format from unsupported (Chad)
   - fix the rejection of all hints (Chad)
   - report invalid context as EGL_BAD_PARAMETER instead of as
     EGL_BAD_CONTEXT (Eric)

v7:
   - native RGB formats only and only via image external sampler

v8:
   - fixed return EGL errors codes, documentation and plane
     attribute checking

Topi Pohjolainen (9):
  intel: allow packed prime buffers to be treated normally
  intel: do not create renderbuffers out of planar images
  intel: refactor planar format lookup
  intel: set dri image dimensions even when creating out of primes
  dri: propagate extra dma_buf import attributes to the drivers
  egl: definitions for EXT_image_dma_buf_import
  intel: restrict dma-buf-import images to external sampling only
  egl/dri2: support for creating images out of dma buffers
  i965: enable image external sampling for imported dma-buffers

 include/GL/internal/dri_interface.h          |  39 +++-
 src/egl/drivers/dri2/egl_dri2.c              | 262 +++++++++++++++++++++++++++
 src/egl/main/eglapi.c                        |   5 +
 src/egl/main/egldisplay.h                    |   1 +
 src/egl/main/eglimage.c                      |  76 ++++++++
 src/egl/main/eglimage.h                      |  15 ++
 src/egl/main/eglmisc.c                       |   1 +
 src/mesa/drivers/dri/i965/intel_extensions.c |   1 +
 src/mesa/drivers/dri/i965/intel_fbo.c        |  14 ++
 src/mesa/drivers/dri/i965/intel_regions.h    |  14 ++
 src/mesa/drivers/dri/i965/intel_screen.c     |  88 +++++++--
 src/mesa/drivers/dri/i965/intel_tex_image.c  |  18 ++
 12 files changed, 517 insertions(+), 17 deletions(-)

-- 
1.8.1.2



More information about the mesa-dev mailing list