[Mesa-dev] [PATCH 4/6] egl: MESA_image_drm extension

Kristian Høgsberg krh at bitplanet.net
Fri Jun 11 06:37:45 PDT 2010


On Thu, Jun 10, 2010 at 5:33 AM, Chia-I Wu <olvaffe at gmail.com> wrote:
> 2010/6/4 Jakob Bornecrantz <wallbraker at gmail.com>:
>> Kristian and I discussed this on IRC and I think we got an agreement
>> on the way forward. I'll inline the comments below in the spec file.
>>
>> 2010/6/4 Kristian Høgsberg <krh at bitplanet.net>:
>>> ---
>>>  docs/MESA_image_drm.spec  |  101 +++++++++++++++++++++++++++++++++++++++++++++
>>>  include/EGL/eglext.h      |   23 ++++++++++
>>>  src/egl/main/eglapi.c     |   48 +++++++++++++++++++++
>>>  src/egl/main/eglapi.h     |   10 ++++
>>>  src/egl/main/eglconfig.c  |    1 +
>>>  src/egl/main/egldisplay.h |    1 +
>>>  src/egl/main/eglmisc.c    |    1 +
>>>  7 files changed, 185 insertions(+), 0 deletions(-)
>>>  create mode 100644 docs/MESA_image_drm.spec
>>>
>>> diff --git a/docs/MESA_image_drm.spec b/docs/MESA_image_drm.spec
>>> new file mode 100644
>>> index 0000000..fc0f076
>>> --- /dev/null
>>> +++ b/docs/MESA_image_drm.spec
>>> @@ -0,0 +1,101 @@
>>> +Name
>>> +
>>> +    MESA_image_drm
>>> +
>>> +Name Strings
>>> +
>>> +    EGL_MESA_image_drm
>>> +
>>> +Contact
>>> +
>>> +    Kristian Høgsberg <krh at bitplanet.net>
>>> +
>>> +Status
>>> +
>>> +    Proposal
>>> +
>>> +Version
>>> +
>>> +    Version 1, June 3, 2010
>>> +
>>> +Number
>>> +
>>> +    EGL Extension #not assigned
>>> +
>>> +Dependencies
>>> +
>>> +    Reguires EGL 1.4 or later.  This extension is written against the
>>> +    wording of the EGL 1.4 specification.
>>> +
>>> +    EGL_KHR_base_image is required.
>>> +
>>> +Overview
>>> +
>>> +    Create EGLImages from DRM buffer handles.
>>> +
>>> +IP Status
>>> +
>>> +    Open-source; freely implementable.
>>> +
>>> +Issues
>>> +
>>> +    Nopes
>>> +
>>> +New Procedures and Functions
>>> +
>>> +    EGLImageKHR eglCreateDRMImageMESA(EGLDisplay dpy,
>>> +                                      EGLContext ctx,
>>> +                                      khronos_uint32_t *handle,
>>> +                                      khronos_uint32_t *stride,
>>> +                                      const EGLint *attrib_list);
>>
>> I think we can drop the ctx argument as it is not needed, its only
>> there on eglCreateImage to know which context to lookup the
>> ClientBuffer in.
>>
>> As I outlined in my other mails I think having the handle and stride
>> arguments on this function so lets move these to eglShareDRMImageMesa
>> (see more below).
>>
>>> +
>>> +    EGLBoolean eglShareDRMImageMESA(EGLDisplay dpy,
>>> +                                    EGLImageKHR image,
>>> +                                    khronos_uint32_t *name);
>>
>> We could rename this function to eglExportDRMImageMesa and let it have
>> the following arguments.
>>
>> EGLBoolean eglExportDRMImageMesa(EGLDisplay dpy,
>>                                   khronos_uint32_t *name,
>>                                   khronos_uint32_t *handle,
>>                                   khronos_uint32_t *stride);
>>
>> Where the either name or handle can be null but not both. The function
>> will also check against EGL_IMAGE_USE_MESA to make sure that the image
>> was created with the correct uses.
>>
>>> +
>>> +New Tokens
>>> +
>>> +    Accepted in the <attrib_list> parameter of eglCreateDRMImageMESA:
>>> +
>>> +        EGL_IMAGE_FORMAT_MESA                  0xce01
>>> +        EGL_IMAGE_USE_MESA                     0xce02
>>> +
>>> +    Bits accepted in EGL_IMAGE_USE_MESA:
>>> +
>>> +        EGL_IMAGE_USE_SCANOUT_MESA             0x0001
>>> +        EGL_IMAGE_USE_SHARE_MESA               0x0002
>>> +
>>> +    Accepted in the <target> parameter of eglCreateImageKHR:
>>> +
>>> +        EGL_DRM_BUFFER_MESA                    0xce03
>>> +
>>> +    Use when importing drm buffer:
>>> +
>>> +        EGL_IMAGE_NAME_MESA                    0xce04
>>> +        EGL_IMAGE_STRIDE_MESA                  0xce05
>>> +
>>> +    Accepted as values for the EGL_IMAGE_FORMAT_MESA attribute:
>>> +
>>> +        EGL_IMAGE_FORMAT_ARGB8888_MESA         0xce06
>> Hmm since these tokens are for a none generic extension like this
>> maybe we should make them a bit less generic, maybe sprinkle some DRM
>> strings in there. Just a thought, could probably stay the same tho.
> I prefer to sprinkle DRM strings to the tokens.  Stride seems to in bytes now,
> where the last version depends on the format(?).  It might be more clear to use
> DRM_STRIDE and define the units.

Agree, will do.

> It seems bits-per-pixel is missing here.  Or should it be derived from the
> format?

It's defined by the format.

Kristian


More information about the mesa-dev mailing list