summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2022-09-26 17:19:27 -0400
committerAlex Deucher <alexander.deucher@amd.com>2022-10-17 16:19:44 -0400
commita81b9ab8f3fb6840b36f732c1dd25fe5e0d68d0a (patch)
treecb8f4261370ca5df769935c92cd04a4e2eada43f
parent613cc945b36e7ba3ce8de0e42b5057b32bc7c69c (diff)
downloadlibdrm-a81b9ab8f3fb6840b36f732c1dd25fe5e0d68d0a.tar.gz
libdrm-a81b9ab8f3fb6840b36f732c1dd25fe5e0d68d0a.tar.bz2
libdrm-a81b9ab8f3fb6840b36f732c1dd25fe5e0d68d0a.zip
amdgpu: Add a default marketing name if none is found
Apparently quite a few apps use this API to get the GPU name and end up with NULL as the GPU name. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--amdgpu/amdgpu_device.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c
index 73fd27f6..aeb5e3c5 100644
--- a/amdgpu/amdgpu_device.c
+++ b/amdgpu/amdgpu_device.c
@@ -292,7 +292,10 @@ drm_public int amdgpu_device_get_fd(amdgpu_device_handle device_handle)
drm_public const char *amdgpu_get_marketing_name(amdgpu_device_handle dev)
{
- return dev->marketing_name;
+ if (dev->marketing_name)
+ return dev->marketing_name;
+ else
+ return "AMD Radeon Graphics";
}
drm_public int amdgpu_query_sw_info(amdgpu_device_handle dev,