[Mesa-dev,18/27] gallium: introduce device/driver UUID queries v2

Submitted by Andres Rodriguez on July 12, 2017, 10:45 p.m.

Details

Message ID 20170712224532.1307-19-andresx7@gmail.com
State New
Headers show
Series "Initial support for EXT_external_objects v3" ( rev: 3 2 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Andres Rodriguez July 12, 2017, 10:45 p.m.
v2: remove unnecessary returns

Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
---
 src/gallium/drivers/ddebug/dd_screen.c | 17 +++++++++++++++++
 src/gallium/include/pipe/p_defines.h   |  1 +
 src/gallium/include/pipe/p_screen.h    | 13 +++++++++++++
 3 files changed, 31 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/ddebug/dd_screen.c b/src/gallium/drivers/ddebug/dd_screen.c
index fe9c841..78482f9 100644
--- a/src/gallium/drivers/ddebug/dd_screen.c
+++ b/src/gallium/drivers/ddebug/dd_screen.c
@@ -197,6 +197,21 @@  dd_screen_get_driver_query_group_info(struct pipe_screen *_screen,
 }
 
 
+static void
+dd_screen_get_driver_uuid(struct pipe_screen *_screen, char *uuid)
+{
+   struct pipe_screen *screen = dd_screen(_screen)->screen;
+
+   screen->get_driver_uuid(screen, uuid);
+}
+
+static void
+dd_screen_get_device_uuid(struct pipe_screen *_screen, char *uuid)
+{
+   struct pipe_screen *screen = dd_screen(_screen)->screen;
+
+   screen->get_device_uuid(screen, uuid);
+}
 /********************************************************************
  * resource
  */
@@ -462,6 +477,8 @@  ddebug_screen_create(struct pipe_screen *screen)
    SCR_INIT(get_driver_query_info);
    SCR_INIT(get_driver_query_group_info);
    SCR_INIT(get_compiler_options);
+   SCR_INIT(get_driver_uuid);
+   SCR_INIT(get_device_uuid);
 
 #undef SCR_INIT
 
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 91efa65..22d60d3 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -1066,6 +1066,7 @@  enum pipe_debug_type
    PIPE_DEBUG_TYPE_CONFORMANCE,
 };
 
+#define PIPE_UUID_SIZE 16
 
 #ifdef __cplusplus
 }
diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
index d81625c..acfbd03 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -393,6 +393,19 @@  struct pipe_screen {
                                                   struct pipe_memory_object *memobj,
                                                   uint64_t offset);
 
+   /**
+    * Fill @uuid with a unique driver identifier
+    *
+    * \param uuid    pointer to a memory region of PIPE_UUID_SIZE bytes
+    */
+   void (*get_driver_uuid)(struct pipe_screen *screen, char *uuid);
+
+   /**
+    * Fill @uuid with a unique device identifier
+    *
+    * \param uuid    pointer to a memory region of PIPE_UUID_SIZE bytes
+    */
+   void (*get_device_uuid)(struct pipe_screen *screen, char *uuid);
 };