radv: report the marketing name as part of the device name

This now reports something like "AMD Radeon RX 5700 XT (RADV NAVI10)".

This introduces a new variable for storing the marketing name because
the existing device name is used by the shaders cache and must remain
the same to avoid any issues with precompilation.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4802
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11027>
This commit is contained in:
Samuel Pitoiset 2021-05-27 09:03:24 +02:00 committed by Marge Bot
parent 42b3735716
commit f06da59fd7
3 changed files with 8 additions and 6 deletions

View File

@ -621,18 +621,15 @@ radv_dump_device_name(struct radv_device *device, FILE *f)
char kernel_version[128] = {0};
struct utsname uname_data;
#endif
const char *chip_name;
chip_name = device->ws->get_chip_name(device->ws);
#ifdef _WIN32
fprintf(f, "Device name: %s (%s / DRM %i.%i.%i)\n\n", chip_name, device->physical_device->name,
fprintf(f, "Device name: %s (DRM %i.%i.%i)\n\n", device->physical_device->marketing_name,
info->drm_major, info->drm_minor, info->drm_patchlevel);
#else
if (uname(&uname_data) == 0)
snprintf(kernel_version, sizeof(kernel_version), " / %s", uname_data.release);
fprintf(f, "Device name: %s (%s / DRM %i.%i.%i%s)\n\n", chip_name, device->physical_device->name,
fprintf(f, "Device name: %s (DRM %i.%i.%i%s)\n\n", device->physical_device->marketing_name,
info->drm_major, info->drm_minor, info->drm_patchlevel, kernel_version);
#endif
}

View File

@ -719,6 +719,10 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm
snprintf(device->name, sizeof(device->name), "AMD RADV %s%s", device->rad_info.name,
radv_get_compiler_string(device));
const char *marketing_name = device->ws->get_chip_name(device->ws);
snprintf(device->marketing_name, sizeof(device->name), "%s (RADV %s%s)",
marketing_name, device->rad_info.name, radv_get_compiler_string(device));
#ifdef ENABLE_SHADER_CACHE
if (radv_device_get_cache_uuid(device, device->cache_uuid)) {
result = vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED, "cannot generate UUID");
@ -1939,7 +1943,7 @@ radv_GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice,
},
};
strcpy(pProperties->deviceName, pdevice->name);
strcpy(pProperties->deviceName, pdevice->marketing_name);
memcpy(pProperties->pipelineCacheUUID, pdevice->cache_uuid, VK_UUID_SIZE);
}

View File

@ -271,6 +271,7 @@ struct radv_physical_device {
struct radeon_winsys *ws;
struct radeon_info rad_info;
char name[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE];
char marketing_name[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE];
uint8_t driver_uuid[VK_UUID_SIZE];
uint8_t device_uuid[VK_UUID_SIZE];
uint8_t cache_uuid[VK_UUID_SIZE];