[Mesa-dev] [PATCH 19/23] radeonsi: hook up device/driver UUID queries

Timothy Arceri tarceri at itsqueeze.com
Fri Aug 4 01:54:22 UTC 2017


From: Andres Rodriguez <andresx7 at gmail.com>

v2: move from r600_common to radeonsi

Signed-off-by: Andres Rodriguez <andresx7 at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
---
 src/gallium/drivers/radeonsi/si_pipe.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index b32a77dcc4..2266216511 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -960,36 +960,50 @@ static void si_test_vmfault(struct si_screen *sscreen)
 		ctx->flush(ctx, NULL, 0);
 		puts("VM fault test: SDMA - done.");
 	}
 	if (sscreen->b.debug_flags & DBG_TEST_VMFAULT_SHADER) {
 		util_test_constant_buffer(ctx, buf);
 		puts("VM fault test: Shader - done.");
 	}
 	exit(0);
 }
 
+static void radeonsi_get_driver_uuid(struct pipe_screen *pscreen, char *uuid)
+{
+	ac_compute_driver_uuid(uuid, PIPE_UUID_SIZE);
+}
+
+static void radeonsi_get_device_uuid(struct pipe_screen *pscreen, char *uuid)
+{
+	struct r600_common_screen *rscreen = (struct r600_common_screen *)pscreen;
+
+	ac_compute_device_uuid(&rscreen->info, uuid, PIPE_UUID_SIZE);
+}
+
 struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws,
 					   const struct pipe_screen_config *config)
 {
 	struct si_screen *sscreen = CALLOC_STRUCT(si_screen);
 	unsigned num_threads, num_compiler_threads, num_compiler_threads_lowprio, i;
 
 	if (!sscreen) {
 		return NULL;
 	}
 
 	/* Set functions first. */
 	sscreen->b.b.context_create = si_pipe_create_context;
 	sscreen->b.b.destroy = si_destroy_screen;
 	sscreen->b.b.get_param = si_get_param;
 	sscreen->b.b.get_shader_param = si_get_shader_param;
 	sscreen->b.b.get_compiler_options = si_get_compiler_options;
+	sscreen->b.b.get_device_uuid = radeonsi_get_device_uuid;
+	sscreen->b.b.get_driver_uuid = radeonsi_get_driver_uuid;
 	sscreen->b.b.resource_create = r600_resource_create_common;
 
 	si_init_screen_state_functions(sscreen);
 
 	if (!r600_common_screen_init(&sscreen->b, ws, config->flags) ||
 	    !si_init_gs_info(sscreen) ||
 	    !si_init_shader_cache(sscreen)) {
 		FREE(sscreen);
 		return NULL;
 	}
-- 
2.13.3



More information about the mesa-dev mailing list