[Mesa-dev] [PATCH 4/6] egl: MESA_image_drm extension
Jakob Bornecrantz
wallbraker at gmail.com
Fri Jun 4 08:55:10 PDT 2010
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.
> +
> +Additions to the EGL 1.4 Specification:
> +
> + Goes here...
> +
> + Create drm buffers by calling eglCreateDRMImageMESA, pass
> + EGL_WIDTH, EGL_EIGHT and format and use in the attrib list using
> + EGL_IMAGE_FORMAT_MESA and EGL_IMAGE_USE_MESA. If non-NULL, the
> + handle (local to the drm fd, for use with KMS) is written to
> + <handle> and the stride (in bytes) is written to <stride>.
> +
> + Create a global name for a buffer using eglShareDRMImageMESA.
> +
> + Import a shared buffer by calling eglCreateImageKHR with
> + EGL_DRM_BUFFER_MESA as the target, using EGL_WIDTH, EGL_HEIGHT,
> + EGL_IMAGE_FORMAT_MESA, EGL_IMAGE_NAME_MESA, EGL_IMAGE_STRIDE_MESA
> + in the attrib list.
> +
> +Revision History
> +
> + June 3, 2010
> + Initial draft (Kristian Høgsberg)
> diff --git a/include/EGL/eglext.h b/include/EGL/eglext.h
>-- snip --<
You can probably grab some of the text and tables the extensions in my
patch series for some of the functions.
Cheers Jakob.
More information about the mesa-dev
mailing list