raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=cf6b3667c3649a232fff829cc7aa35ade37f05dd

commit cf6b3667c3649a232fff829cc7aa35ade37f05dd
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Fri Mar 26 20:31:27 2021 +0000

    evas - gl add export for getting dmabuf formats and modifiers
    
    we need this to do formats and modifiers properly... and this is what
    broke on the rpi4 - it started using  interesting formats etc. ... new
    feature to support a bug fix in e
    
    @feat
---
 src/lib/evas/Evas_GL.h                             | 22 +++++++++++++++++++++-
 .../evas/engines/gl_common/evas_gl_api_ext.c       | 18 ++++++++++++++++++
 .../evas/engines/gl_common/evas_gl_api_ext_def.h   | 19 +++++++++++++++++++
 3 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/Evas_GL.h b/src/lib/evas/Evas_GL.h
index 614fef9334..c740439d31 100644
--- a/src/lib/evas/Evas_GL.h
+++ b/src/lib/evas/Evas_GL.h
@@ -5117,8 +5117,9 @@ typedef unsigned long long EvasGLTime;
  * Version 4: [version 3] + GLES3.0 + GLES3.0 extensions
  * Version 5: [version 4] + GLES3.1
  * Version 6: [version 5] + GLES3.2
+ * Version 7: [version 7] + query formats + modifiers
  */
-#define EVAS_GL_API_VERSION 6
+#define EVAS_GL_API_VERSION 7
 
 /**
  * @brief The Evas GL API
@@ -6106,6 +6107,25 @@ EvasGLImage *img = glapi->evasglCreateImageForContext
     * new APIs here, please bump the struct version number (together with
     * the EFL version bump).
     */
+
+   /**
+    * @name Evas GL Wayland functions
+    *
+    * Evas_GL_API version 7 or higher.
+    *
+    * @since 1.26
+    * @{ */
+   /**
+    * @anchor evasglQueryDmaBufFormats
+    * @brief Direct map to eglQueryDmaBufFormatsEXT
+    */
+   Eina_Bool    (*evasglQueryDmaBufFormats) (Evas_GL *evas_gl, int 
max_formats, int *formats, int *num_formats);
+   /**
+    * @anchor evasglQueryDmaBufModifiers
+    * @brief RDirect map to eglQueryDmaBufModifiersEXT
+    */
+   Eina_Bool    (*evasglQueryDmaBufModifiers) (Evas_GL *evas_gl, int format, 
int max_modifiers, uint64_t *modifiers, Eina_Bool *external_only, int 
*num_modifiers);
+   /** @} */
 };
 
 /**
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c 
b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
index 11e76eed8b..1d47f98214 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
@@ -414,6 +414,24 @@ _evgl_evasglQueryWaylandBuffer(Evas_GL *evas_gl,
    return EXT_FUNC_EGL(eglQueryWaylandBufferWL)(dpy, buffer, attribute, value);
 }
 
+static Eina_Bool
+_evgl_evasglQueryDmaBufFormats(Evas_GL *evas_gl,
+                               int max_formats, int *formats, int *num_formats)
+{
+   EGLDisplay dpy = EGLDISPLAY_GET(evas_gl);
+   if (!dpy) return EINA_FALSE;
+   return EXT_FUNC_EGL(eglQueryDmaBufFormatsEXT)(dpy, max_formats, formats, 
num_formats);
+}
+
+static Eina_Bool
+_evgl_evasglQueryDmaBufModifiers(Evas_GL *evas_gl,
+                                 int format, int max_modifiers, uint64_t 
*modifiers, Eina_Bool *external_only, int *num_modifiers)
+{
+   EGLDisplay dpy = EGLDISPLAY_GET(evas_gl);
+   if (!dpy) return EINA_FALSE;
+   return EXT_FUNC_EGL(eglQueryDmaBufModifiersEXT)(dpy, format, max_modifiers, 
modifiers, external_only, num_modifiers);
+}
+
 #else
 #endif
 
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h 
b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
index 581dd6c3b3..3a5afcbdfc 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
@@ -1675,6 +1675,25 @@ _EVASGL_EXT_BEGIN(EGL_WL_bind_wayland_display)
 
 _EVASGL_EXT_END()
 
+_EVASGL_EXT_BEGIN(EGL_EXT_image_dma_buf_import_modifiers)
+
+        _EVASGL_EXT_DRVNAME(EGL_EXT_image_dma_buf_import_modifiers)
+
+        _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(EGLBoolean, 
eglQueryDmaBufFormatsEXT, (EGLDisplay dpy, int max_formats, int *formats, int 
*num_formats), (dpy, max_formats, formats, num_formats))
+                
_EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("eglQueryDmaBufFormatsEXT")
+        _EVASGL_EXT_FUNCTION_PRIVATE_END()
+        _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(EGLBoolean, 
eglQueryDmaBufModifiersEXT, (EGLDisplay dpy, int format, int max_modifiers, 
uint64_t *modifiers, Eina_Bool *external_only, int *num_modifiers), (dpy, 
format, max_modifiers, modifiers, external_only, num_modifiers))
+                
_EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("eglQueryDmaBufModifiersEXT")
+        _EVASGL_EXT_FUNCTION_PRIVATE_END()
+
+        _EVASGL_EXT_FUNCTION_BEGIN(Eina_Bool, evasglQueryDmaBufFormats, 
(Evas_GL *evas_gl, int max_formats, int *formats, int *num_formats), (evas_gl, 
max_formats, formats, num_formats))
+                _EVASGL_EXT_FUNCTION_DRVFUNC(_evgl_evasglQueryDmaBufFormats)
+        _EVASGL_EXT_FUNCTION_END()
+        _EVASGL_EXT_FUNCTION_BEGIN(Eina_Bool, evasglQueryDmaBufModifiers, 
(Evas_GL *evas_gl, int format, int max_modifiers, uint64_t *modifiers, 
Eina_Bool *external_only, int *num_modifiers), (evas_gl, format, max_modifiers, 
modifiers, external_only, num_modifiers))
+                _EVASGL_EXT_FUNCTION_DRVFUNC(_evgl_evasglQueryDmaBufModifiers)
+        _EVASGL_EXT_FUNCTION_END()
+_EVASGL_EXT_END()
+
 
 #if 0
 _EVASGL_EXT_BEGIN(EGL_SEC_map_image)

-- 


Reply via email to