GPU: use driver reported adapter name if available

This commit is contained in:
Carter Li
2024-09-27 10:58:35 +08:00
committed by 李通洲
parent 5058a93428
commit 842ba9fd4e
5 changed files with 30 additions and 21 deletions
+4 -6
View File
@@ -302,11 +302,6 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf
if (drmKey) ffStrbufSetF(&gpu->platformApi, "DRM (%s)", drmKey);
if (gpu->name.length == 0)
{
ffGPUFillVendorAndName(subclassId, (uint16_t) vendorId, (uint16_t) deviceId, gpu);
}
pciDetectDriver(&gpu->driver, deviceDir, buffer, drmKey);
ffStrbufSubstrBefore(deviceDir, drmDirPathLength);
@@ -367,7 +362,7 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf
.coreUsage = options->driverSpecific ? &gpu->coreUsage : NULL,
.type = &gpu->type,
.frequency = options->driverSpecific ? &gpu->frequency : NULL,
.name = options->driverSpecific ? &gpu->name : NULL,
.name = &gpu->name,
}, soName);
}
@@ -388,6 +383,9 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf
}
}
if (gpu->name.length == 0)
ffGPUFillVendorAndName(subclassId, (uint16_t) vendorId, (uint16_t) deviceId, gpu);
return NULL;
}