[Mesa-dev,16/25] gallium: introduce device/driver UUID queries

Submitted by Andres Rodriguez on July 7, 2017, 4:24 a.m.

Details

Message ID 20170707042457.18219-17-andresx7@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 3 2 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Andres Rodriguez July 7, 2017, 4:24 a.m.
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..955158f 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;
+
+   return 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;
+
+   return 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);
 };
 
 

Comments

On Fri, Jul 7, 2017 at 6:24 AM, Andres Rodriguez <andresx7@gmail.com> wrote:
> 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(+)
>
> diff --git a/src/gallium/drivers/ddebug/dd_screen.c b/src/gallium/drivers/ddebug/dd_screen.c
> index fe9c841..955158f 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;
> +
> +   return screen->get_driver_uuid(screen, uuid);

return is unnecessary

> +}
> +
> +static void
> +dd_screen_get_device_uuid(struct pipe_screen *_screen, char *uuid)
> +{
> +   struct pipe_screen *screen = dd_screen(_screen)->screen;
> +
> +   return screen->get_device_uuid(screen, uuid);

return is unnecessary

Marek