summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-09-14 11:25:23 +0200
committerSamuel Pitoiset <[email protected]>2017-09-15 09:16:34 +0200
commit176c2ad10cfce40f3ee73588e8e5f82826b748b6 (patch)
treecf753510aafd9ff2a367290746f1b1f7bf64f96b /src
parent1b163238f5b652d1c6c9e50ec36afe537f77411f (diff)
radv: add get_chip_name() callback
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/vulkan/radv_radeon_winsys.h2
-rw-r--r--src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c8
2 files changed, 10 insertions, 0 deletions
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);