mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
GPU (Linux): lazy load pci.ids
This commit is contained in:
@@ -81,7 +81,6 @@ static const char* pciDetectGPUs(const FFGPUOptions* options, FFlist* gpus)
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate();
|
||||
FF_STRBUF_AUTO_DESTROY pciids = ffStrbufCreate();
|
||||
loadPciIds(&pciids);
|
||||
|
||||
struct dirent* entry;
|
||||
while((entry = readdir(dirp)) != NULL)
|
||||
@@ -141,7 +140,11 @@ static const char* pciDetectGPUs(const FFGPUOptions* options, FFlist* gpus)
|
||||
}
|
||||
|
||||
if (gpu->name.length == 0)
|
||||
{
|
||||
if (!pciids.length)
|
||||
loadPciIds(&pciids);
|
||||
ffGPUParsePciIds(&pciids, subclassId, (uint16_t) vendorId, (uint16_t) deviceId, (uint16_t) subVendorId, (uint16_t) subDeviceId, gpu);
|
||||
}
|
||||
|
||||
pciDetectDriver(gpu, &pciDir, &buffer);
|
||||
ffStrbufSubstrBefore(&pciDir, pciDevDirLength);
|
||||
|
||||
Reference in New Issue
Block a user