diff options
author | Varad Gautam <[email protected]> | 2017-05-30 17:23:39 +0530 |
---|---|---|
committer | Eric Engestrom <[email protected]> | 2017-05-30 13:56:20 +0100 |
commit | de3c459bbd617275a9ed57be42f7c594bae04116 (patch) | |
tree | 8428357cad628f626080ddc829148e9c15ed6df5 /src/egl/main | |
parent | 6719e058d6b8a38cc66accf1609fcabb66571e86 (diff) |
egl: implement eglQueryDmaBufModifiersEXT
query and return supported dmabuf format modifiers for
EGL_EXT_image_dma_buf_import_modifiers.
v2: move format check to the driver instead of making format queries
here and then checking.
v3: Check DRIimageExtension version before query (Daniel Stone)
v4:
- move to DRIimageExtension version 15, check queryDmaBufModifiers before
calling (Jason Ekstrand)
- pass external_only to the driver instead of setting as EGL_TRUE here
(Emil Velikov, Daniel Stone)
Signed-off-by: Varad Gautam <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/egl/main')
-rw-r--r-- | src/egl/main/eglapi.c | 20 | ||||
-rw-r--r-- | src/egl/main/eglapi.h | 5 | ||||
-rw-r--r-- | src/egl/main/eglentrypoint.h | 1 |
3 files changed, 26 insertions, 0 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index d613920b012..a4d5f896e6d 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -2404,6 +2404,26 @@ eglQueryDmaBufFormatsEXT(EGLDisplay dpy, EGLint max_formats, RETURN_EGL_EVAL(disp, ret); } +static EGLBoolean EGLAPIENTRY +eglQueryDmaBufModifiersEXT(EGLDisplay dpy, EGLint format, EGLint max_modifiers, + EGLuint64KHR *modifiers, EGLBoolean *external_only, + EGLint *num_modifiers) +{ + _EGLDisplay *disp = _eglLockDisplay(dpy); + _EGLDriver *drv; + EGLBoolean ret; + + _EGL_FUNC_START(NULL, EGL_NONE, NULL, EGL_FALSE); + + _EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv); + + ret = drv->API.QueryDmaBufModifiersEXT(drv, disp, format, max_modifiers, + modifiers, external_only, + num_modifiers); + + RETURN_EGL_EVAL(disp, ret); +} + __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const char *procname) { diff --git a/src/egl/main/eglapi.h b/src/egl/main/eglapi.h index c9f98963dba..cab3e9605a0 100644 --- a/src/egl/main/eglapi.h +++ b/src/egl/main/eglapi.h @@ -202,6 +202,11 @@ struct _egl_api EGLBoolean (*QueryDmaBufFormatsEXT)(_EGLDriver *drv, _EGLDisplay *dpy, EGLint max_formats, EGLint *formats, EGLint *num_formats); + EGLBoolean (*QueryDmaBufModifiersEXT) (_EGLDriver *drv, _EGLDisplay *dpy, + EGLint format, EGLint max_modifiers, + EGLuint64KHR *modifiers, + EGLBoolean *external_only, + EGLint *num_modifiers); }; #ifdef __cplusplus diff --git a/src/egl/main/eglentrypoint.h b/src/egl/main/eglentrypoint.h index 91536239e9f..b9dca7ceda2 100644 --- a/src/egl/main/eglentrypoint.h +++ b/src/egl/main/eglentrypoint.h @@ -57,6 +57,7 @@ EGL_ENTRYPOINT(eglQueryAPI) EGL_ENTRYPOINT(eglQueryContext) EGL_ENTRYPOINT(eglQueryDebugKHR) EGL_ENTRYPOINT(eglQueryDmaBufFormatsEXT) +EGL_ENTRYPOINT(eglQueryDmaBufModifiersEXT) EGL_ENTRYPOINT(eglQueryString) EGL_ENTRYPOINT(eglQuerySurface) EGL_ENTRYPOINT(eglQueryWaylandBufferWL) |