Mesa (master): i965: plumb device/driver UUID generators
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Apr 28 15:02:47 UTC 2021
Module: Mesa
Branch: master
Commit: 62b51bb43b635bdc2617e7bde4594f1f3bfb8018
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=62b51bb43b635bdc2617e7bde4594f1f3bfb8018
Author: Rohan Garg <rohan.garg at collabora.com>
Date: Mon Jun 8 11:57:12 2020 +0200
i965: plumb device/driver UUID generators
Use the same generators as used in anv driver so both Vulkan and OpenGL
drivers can share the same external memory objects.
Signed-off-by: Rohan Garg <rohan.garg at collabora.com>
Reviewed-by: Eleni Maria Stea <estea at igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5594>
---
src/mesa/drivers/dri/i965/brw_context.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index e36313ff112..252640f8167 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -79,6 +79,7 @@
#include "isl/isl.h"
#include "common/intel_defines.h"
+#include "common/intel_uuid.h"
#include "compiler/spirv/nir_spirv.h"
/***************************************
@@ -323,6 +324,29 @@ brw_finish(struct gl_context * ctx)
brw_bo_wait_rendering(brw->batch.last_bo);
}
+static void
+brw_get_device_uuid(struct gl_context *ctx, char *uuid)
+{
+ struct brw_context *brw = brw_context(ctx);
+ struct brw_screen *screen = brw->screen;
+
+ assert(GL_UUID_SIZE_EXT >= PIPE_UUID_SIZE);
+ memset(uuid, 0, GL_UUID_SIZE_EXT);
+ intel_uuid_compute_device_id((uint8_t *)uuid, &screen->isl_dev, PIPE_UUID_SIZE);
+}
+
+
+static void
+brw_get_driver_uuid(struct gl_context *ctx, char *uuid)
+{
+ struct brw_context *brw = brw_context(ctx);
+ struct brw_screen *screen = brw->screen;
+
+ assert(GL_UUID_SIZE_EXT >= PIPE_UUID_SIZE);
+ memset(uuid, 0, GL_UUID_SIZE_EXT);
+ intel_uuid_compute_driver_id((uint8_t *)uuid, &screen->devinfo, PIPE_UUID_SIZE);
+}
+
static void
brw_init_driver_functions(struct brw_context *brw,
struct dd_function_table *functions)
@@ -412,6 +436,9 @@ brw_init_driver_functions(struct brw_context *brw,
}
functions->SetBackgroundContext = brw_set_background_context;
+
+ functions->GetDeviceUuid = brw_get_device_uuid;
+ functions->GetDriverUuid = brw_get_driver_uuid;
}
static void
More information about the mesa-commit
mailing list