radv: add get_chip_name() callback
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 14 Sep 2017 09:25:23 +0000 (11:25 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 15 Sep 2017 07:16:34 +0000 (09:16 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_radeon_winsys.h
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c

index 8e60c23f48f47db7dddf45fd0a95bfa534c53ef6..f7399de1aed780069cc3a3af804b716ab8ecf28e 100644 (file)
@@ -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,
index 9e9b1bf061d04c26172e77816daa8dbdc08c0eaa..003b2be5e6bb000b189266e992d555b5cc6fb99e 100644 (file)
@@ -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);