GPU: simplify logic of pci.ids file loading

This commit is contained in:
李通洲
2024-09-25 16:24:51 +08:00
parent 582b0fa087
commit ae6817e106
5 changed files with 43 additions and 33 deletions
+1 -7
View File
@@ -303,13 +303,7 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf
if (gpu->name.length == 0)
{
static FFstrbuf pciids;
if (pciids.chars == NULL)
{
ffStrbufInit(&pciids);
loadPciIds(&pciids);
}
ffGPUParsePciIds(&pciids, subclassId, (uint16_t) vendorId, (uint16_t) deviceId, gpu);
ffGPUParsePciIds(subclassId, (uint16_t) vendorId, (uint16_t) deviceId, gpu);
}
pciDetectDriver(&gpu->driver, deviceDir, buffer, drmKey);