mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
iris: 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. v2: removed extra parameter from function gen_uuid_compute_device_id Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Signed-off-by: Eleni Maria Stea <estea@igalia.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Rohan Garg <rohan.garg@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7025>
This commit is contained in:
parent
e9a766a8c0
commit
456fa9b838
4 changed files with 23 additions and 4 deletions
|
|
@ -55,6 +55,7 @@
|
|||
#include "intel/compiler/brw_compiler.h"
|
||||
#include "intel/common/gen_gem.h"
|
||||
#include "intel/common/gen_l3_config.h"
|
||||
#include "intel/common/gen_uuid.h"
|
||||
#include "iris_monitor.h"
|
||||
|
||||
static void
|
||||
|
|
@ -77,6 +78,24 @@ iris_get_device_vendor(struct pipe_screen *pscreen)
|
|||
return "Intel";
|
||||
}
|
||||
|
||||
static void
|
||||
iris_get_device_uuid(struct pipe_screen *pscreen, char *uuid)
|
||||
{
|
||||
struct iris_screen *screen = (struct iris_screen *)pscreen;
|
||||
const struct isl_device *isldev = &screen->isl_dev;
|
||||
|
||||
gen_uuid_compute_device_id((uint8_t *)uuid, isldev, PIPE_UUID_SIZE);
|
||||
}
|
||||
|
||||
static void
|
||||
iris_get_driver_uuid(struct pipe_screen *pscreen, char *uuid)
|
||||
{
|
||||
struct iris_screen *screen = (struct iris_screen *)pscreen;
|
||||
const struct gen_device_info *devinfo = &screen->devinfo;
|
||||
|
||||
gen_uuid_compute_driver_id((uint8_t *)uuid, devinfo, PIPE_UUID_SIZE);
|
||||
}
|
||||
|
||||
static const char *
|
||||
iris_get_name(struct pipe_screen *pscreen)
|
||||
{
|
||||
|
|
@ -768,6 +787,8 @@ iris_screen_create(int fd, const struct pipe_screen_config *config)
|
|||
pscreen->get_compute_param = iris_get_compute_param;
|
||||
pscreen->get_paramf = iris_get_paramf;
|
||||
pscreen->get_compiler_options = iris_get_compiler_options;
|
||||
pscreen->get_device_uuid = iris_get_device_uuid;
|
||||
pscreen->get_driver_uuid = iris_get_driver_uuid;
|
||||
pscreen->get_disk_shader_cache = iris_get_disk_shader_cache;
|
||||
pscreen->is_format_supported = iris_is_format_supported;
|
||||
pscreen->context_create = iris_create_context;
|
||||
|
|
|
|||
|
|
@ -27,12 +27,12 @@
|
|||
|
||||
void
|
||||
gen_uuid_compute_device_id(uint8_t *uuid,
|
||||
const struct gen_device_info *devinfo,
|
||||
const struct isl_device *isldev,
|
||||
size_t size)
|
||||
{
|
||||
struct mesa_sha1 sha1_ctx;
|
||||
uint8_t sha1[20];
|
||||
const struct gen_device_info *devinfo = isldev->info;
|
||||
|
||||
assert(size <= sizeof(sha1));
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
void gen_uuid_compute_device_id(uint8_t *uuid,
|
||||
const struct gen_device_info *devinfo,
|
||||
const struct isl_device *isldev,
|
||||
size_t size);
|
||||
|
||||
|
|
|
|||
|
|
@ -255,8 +255,7 @@ anv_physical_device_init_uuids(struct anv_physical_device *device)
|
|||
memcpy(device->pipeline_cache_uuid, sha1, VK_UUID_SIZE);
|
||||
|
||||
gen_uuid_compute_driver_id(device->driver_uuid, &device->info, VK_UUID_SIZE);
|
||||
gen_uuid_compute_device_id(device->device_uuid, &device->info,
|
||||
&device->isl_dev, VK_UUID_SIZE);
|
||||
gen_uuid_compute_device_id(device->device_uuid, &device->isl_dev, VK_UUID_SIZE);
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue