diff options
author | Pekka Paalanen <[email protected]> | 2017-05-30 17:23:35 +0530 |
---|---|---|
committer | Eric Engestrom <[email protected]> | 2017-05-30 13:56:20 +0100 |
commit | fb2a1c2327bef00014210097e7e805247f37b33d (patch) | |
tree | 7f4420dd69dd4b76eb4b1a3eb4eb7f3e6bb972a1 /src/egl/main | |
parent | 9434f057c8f4297e94e08a06257ea66e354deaa7 (diff) |
egl/main: add support for fourth plane tokens
The EGL_EXT_dma_buf_import_modifiers extension adds support for a
fourth plane, just like DRM KMS API does.
Bump maximum dma_buf plane count to four.
v2: prevent attribute tokens from being parsed if
EXT_image_dma_buf_import_modifiers is not suported. (Emil Velikov)
Signed-off-by: Pekka Paalanen <[email protected]>
Signed-off-by: Varad Gautam <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Diffstat (limited to 'src/egl/main')
-rw-r--r-- | src/egl/main/egldisplay.h | 1 | ||||
-rw-r--r-- | src/egl/main/eglimage.c | 18 | ||||
-rw-r--r-- | src/egl/main/eglimage.h | 5 |
3 files changed, 22 insertions, 2 deletions
diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h index 4d3d96e1749..9685bed360c 100644 --- a/src/egl/main/egldisplay.h +++ b/src/egl/main/egldisplay.h @@ -102,6 +102,7 @@ struct _egl_extensions EGLBoolean EXT_buffer_age; EGLBoolean EXT_create_context_robustness; EGLBoolean EXT_image_dma_buf_import; + EGLBoolean EXT_image_dma_buf_import_modifiers; EGLBoolean EXT_swap_buffers_with_damage; EGLBoolean KHR_cl_event2; diff --git a/src/egl/main/eglimage.c b/src/egl/main/eglimage.c index d062cbfe014..fed390a4982 100644 --- a/src/egl/main/eglimage.c +++ b/src/egl/main/eglimage.c @@ -130,6 +130,24 @@ _eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy, attrs->DMABufPlanePitches[2].Value = val; attrs->DMABufPlanePitches[2].IsPresent = EGL_TRUE; break; + case EGL_DMA_BUF_PLANE3_FD_EXT: + if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers) + err = EGL_BAD_PARAMETER; + attrs->DMABufPlaneFds[3].Value = val; + attrs->DMABufPlaneFds[3].IsPresent = EGL_TRUE; + break; + case EGL_DMA_BUF_PLANE3_OFFSET_EXT: + if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers) + err = EGL_BAD_PARAMETER; + attrs->DMABufPlaneOffsets[3].Value = val; + attrs->DMABufPlaneOffsets[3].IsPresent = EGL_TRUE; + break; + case EGL_DMA_BUF_PLANE3_PITCH_EXT: + if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers) + err = EGL_BAD_PARAMETER; + attrs->DMABufPlanePitches[3].Value = val; + attrs->DMABufPlanePitches[3].IsPresent = EGL_TRUE; + break; case EGL_YUV_COLOR_SPACE_HINT_EXT: if (val != EGL_ITU_REC601_EXT && val != EGL_ITU_REC709_EXT && val != EGL_ITU_REC2020_EXT) { diff --git a/src/egl/main/eglimage.h b/src/egl/main/eglimage.h index 9a75d0c9537..a909d9b5889 100644 --- a/src/egl/main/eglimage.h +++ b/src/egl/main/eglimage.h @@ -46,7 +46,7 @@ struct _egl_image_attrib_int EGLBoolean IsPresent; }; -#define DMA_BUF_MAX_PLANES 3 +#define DMA_BUF_MAX_PLANES 4 struct _egl_image_attribs { @@ -67,7 +67,8 @@ struct _egl_image_attribs /* EGL_WL_bind_wayland_display */ EGLint PlaneWL; - /* EGL_EXT_image_dma_buf_import */ + /* EGL_EXT_image_dma_buf_import and + * EGL_EXT_image_dma_buf_import_modifiers */ struct _egl_image_attrib_int DMABufFourCC; struct _egl_image_attrib_int DMABufPlaneFds[DMA_BUF_MAX_PLANES]; struct _egl_image_attrib_int DMABufPlaneOffsets[DMA_BUF_MAX_PLANES]; |