Mesa (master): gallium: introduce format modifier querying

Emil Velikov evelikov at kemper.freedesktop.org
Fri Jun 9 14:03:18 UTC 2017


Module: Mesa
Branch: master
Commit: e0965a2c8e0b6ed7de23ce359af14ad74c670e8f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e0965a2c8e0b6ed7de23ce359af14ad74c670e8f

Author: Varad Gautam <varad.gautam at collabora.com>
Date:   Tue May 30 17:41:46 2017 +0530

gallium: introduce format modifier querying

format modifiers tokens are driver specific, and hence, need to come
in from the driver. this allows drivers to be queried for supported
format modifiers for EGL_EXT_image_dma_buf_import_modifiers.

v2: rebase to master.
v3: drivers must return false on query failure.
v4: use pscreen->is_format_supported instead of adding a separate
    format query handle, remove PIPE_CAP_QUERY_DMABUF_ATTRIBS.
    (Lucas Stach)
v5: add external_only parameter.

Signed-off-by: Varad Gautam <varad.gautam at collabora.com>
Cc: Lucas Stach <l.stach at pengutronix.de>
Reviewed-by: Lucas Stach <l.stach at pengutronix.de>

---

 src/gallium/include/pipe/p_screen.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
index 5102827440..65e954aa87 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -343,6 +343,20 @@ struct pipe_screen {
                            struct pipe_screen *,
                            const struct pipe_resource *templat,
                            const uint64_t *modifiers, int count);
+
+   /**
+    * Get supported modifiers for a format.
+    * If \p max is 0, the total number of supported modifiers for the supplied
+    * format is returned in \p count, with no modification to \p modifiers.
+    * Otherwise, \p modifiers is filled with upto \p max supported modifier
+    * codes, and \p count with the number of modifiers copied.
+    * The \p external_only array is used to return whether the format and
+    * modifier combination can only be used with an external texture target.
+    */
+   void (*query_dmabuf_modifiers)(struct pipe_screen *screen,
+                                  enum pipe_format format, int max,
+                                  uint64_t *modifiers,
+                                  unsigned int *external_only, int *count);
 };
 
 




More information about the mesa-commit mailing list