egl: advertise EGL_EXT_image_dma_buf_import_modifiers
authorVarad Gautam <varad.gautam@collabora.com>
Tue, 30 May 2017 11:53:40 +0000 (17:23 +0530)
committerEric Engestrom <eric.engestrom@imgtec.com>
Tue, 30 May 2017 12:56:20 +0000 (13:56 +0100)
v2: check for DRIimageExtension version 15 (Jason Ekstrand)

Signed-off-by: Varad Gautam <varad.gautam@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
src/egl/drivers/dri2/egl_dri2.c
src/egl/main/eglapi.c

index bcafdf9f4c5a8989696698881ceadcb4f1ebcfb9..d31a0bf8e09ea318f0af59552b3d2ea007d67b64 100644 (file)
@@ -726,6 +726,12 @@ dri2_setup_screen(_EGLDisplay *disp)
           dri2_dpy->image->createImageFromDmaBufs) {
          disp->Extensions.EXT_image_dma_buf_import = EGL_TRUE;
       }
+      if (dri2_dpy->image->base.version >= 15 &&
+          dri2_dpy->image->createImageFromDmaBufs2 &&
+          dri2_dpy->image->queryDmaBufFormats &&
+          dri2_dpy->image->queryDmaBufModifiers) {
+         disp->Extensions.EXT_image_dma_buf_import_modifiers = EGL_TRUE;
+      }
 #endif
    }
 }
index a4d5f896e6dccefad90f98b29982ea802f3e460a..e6355ace872bd4761149c9530526885a89c69a1c 100644 (file)
@@ -488,6 +488,7 @@ _eglCreateExtensionsString(_EGLDisplay *dpy)
    _EGL_CHECK_EXTENSION(EXT_buffer_age);
    _EGL_CHECK_EXTENSION(EXT_create_context_robustness);
    _EGL_CHECK_EXTENSION(EXT_image_dma_buf_import);
+   _EGL_CHECK_EXTENSION(EXT_image_dma_buf_import_modifiers);
    _EGL_CHECK_EXTENSION(EXT_swap_buffers_with_damage);
 
    _EGL_CHECK_EXTENSION(KHR_cl_event2);