From 176c2ad10cfce40f3ee73588e8e5f82826b748b6 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 14 Sep 2017 11:25:23 +0200 Subject: [PATCH] radv: add get_chip_name() callback Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- src/amd/vulkan/radv_radeon_winsys.h | 2 ++ src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/amd/vulkan/radv_radeon_winsys.h b/src/amd/vulkan/radv_radeon_winsys.h index 8e60c23f48f..f7399de1aed 100644 --- a/src/amd/vulkan/radv_radeon_winsys.h +++ b/src/amd/vulkan/radv_radeon_winsys.h @@ -159,6 +159,8 @@ struct radeon_winsys { bool (*read_registers)(struct radeon_winsys *ws, unsigned reg_offset, unsigned num_registers, uint32_t *out); + const char *(*get_chip_name)(struct radeon_winsys *ws); + struct radeon_winsys_bo *(*buffer_create)(struct radeon_winsys *ws, uint64_t size, unsigned alignment, diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c index 9e9b1bf061d..003b2be5e6b 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c @@ -82,6 +82,13 @@ static bool radv_amdgpu_winsys_read_registers(struct radeon_winsys *rws, 0xffffffff, 0, out) == 0; } +static const char *radv_amdgpu_winsys_get_chip_name(struct radeon_winsys *rws) +{ + amdgpu_device_handle dev = ((struct radv_amdgpu_winsys *)rws)->dev; + + return amdgpu_get_marketing_name(dev); +} + static void radv_amdgpu_winsys_destroy(struct radeon_winsys *rws) { struct radv_amdgpu_winsys *ws = (struct radv_amdgpu_winsys*)rws; @@ -122,6 +129,7 @@ radv_amdgpu_winsys_create(int fd, uint64_t debug_flags, uint64_t perftest_flags) pthread_mutex_init(&ws->global_bo_list_lock, NULL); ws->base.query_info = radv_amdgpu_winsys_query_info; ws->base.read_registers = radv_amdgpu_winsys_read_registers; + ws->base.get_chip_name = radv_amdgpu_winsys_get_chip_name; ws->base.destroy = radv_amdgpu_winsys_destroy; radv_amdgpu_bo_init_functions(ws); radv_amdgpu_cs_init_functions(ws); -- 2.30.2