mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-20 07:00:11 +01:00
amdgpu: Only read /proc/cpuinfo as a fallback
Some older Vega APUs don't provide a very useful string. If we have a string in amdgpu.ids use that, but fallback to /proc/cpuinfo. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
This commit is contained in:
parent
90656fc8e4
commit
871e326ac7
1 changed files with 7 additions and 7 deletions
|
|
@ -169,17 +169,11 @@ void amdgpu_parse_asic_ids(struct amdgpu_device *dev)
|
||||||
int line_num = 1;
|
int line_num = 1;
|
||||||
int r = 0;
|
int r = 0;
|
||||||
|
|
||||||
if (dev->info.ids_flags & AMDGPU_IDS_FLAGS_FUSION) {
|
|
||||||
amdgpu_parse_proc_cpuinfo(dev);
|
|
||||||
if (dev->marketing_name != NULL)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
fp = fopen(AMDGPU_ASIC_ID_TABLE, "r");
|
fp = fopen(AMDGPU_ASIC_ID_TABLE, "r");
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
fprintf(stderr, "%s: %s\n", AMDGPU_ASIC_ID_TABLE,
|
fprintf(stderr, "%s: %s\n", AMDGPU_ASIC_ID_TABLE,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
return;
|
goto get_cpu;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 1st valid line is file version */
|
/* 1st valid line is file version */
|
||||||
|
|
@ -220,4 +214,10 @@ void amdgpu_parse_asic_ids(struct amdgpu_device *dev)
|
||||||
|
|
||||||
free(line);
|
free(line);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
|
get_cpu:
|
||||||
|
if (dev->info.ids_flags & AMDGPU_IDS_FLAGS_FUSION &&
|
||||||
|
dev->marketing_name == NULL) {
|
||||||
|
amdgpu_parse_proc_cpuinfo(dev);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue