radv: Use a fallback for marketing name when libdrm doesn't know it.

Currently for GPUs which don't have a marketing name in libdrm,
RADV just prints "(null) (RADV ...)", which looks bad.

This commit replaces the "(null)" with "AMD Unknown".

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18775>
(cherry picked from commit 25e1c3d5b3ab4e066dd36c0a964ce7d413dac02e)
This commit is contained in:
Timur Kristóf 2022-09-23 14:03:10 +02:00 committed by Dylan Baker
parent 34aa290747
commit 4295192f35
2 changed files with 3 additions and 2 deletions

View File

@ -544,7 +544,7 @@
"description": "radv: Use a fallback for marketing name when libdrm doesn't know it.",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View File

@ -782,7 +782,8 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm
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));
marketing_name ? marketing_name : "AMD Unknown", device->rad_info.name,
radv_get_compiler_string(device));
#ifdef ENABLE_SHADER_CACHE
if (radv_device_get_cache_uuid(device, device->cache_uuid)) {