@@ -123,9 +123,11 @@ static void pciDetectIntelSpecific(FFGPUResult* gpu, FFstrbuf* pciDir, FFstrbuf*
123123static bool loadPciIds (FFstrbuf * pciids )
124124{
125125 #ifdef FF_CUSTOM_PCI_IDS_PATH
126+
126127 ffReadFileBuffer (FF_STR (FF_CUSTOM_PCI_IDS_PATH ), pciids );
127128 if (pciids -> length > 0 ) return true;
128- #endif
129+
130+ #else
129131
130132 ffReadFileBuffer (FASTFETCH_TARGET_DIR_USR "/share/hwdata/pci.ids" , pciids );
131133 if (pciids -> length > 0 ) return true;
@@ -136,6 +138,8 @@ static bool loadPciIds(FFstrbuf* pciids)
136138 ffReadFileBuffer (FASTFETCH_TARGET_DIR_USR "/local/share/hwdata/pci.ids" , pciids );
137139 if (pciids -> length > 0 ) return true;
138140
141+ #endif
142+
139143 return false;
140144}
141145
@@ -188,7 +192,11 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf
188192 {
189193 char query [32 ];
190194 snprintf (query , sizeof (query ), "%X,\t%X," , (unsigned ) deviceId , (unsigned ) revision );
195+ #ifdef FF_CUSTOM_AMDGPU_IDS_PATH
196+ ffParsePropFile (FF_STR (FF_CUSTOM_AMDGPU_IDS_PATH ), query , & gpu -> name );
197+ #else
191198 ffParsePropFileData ("libdrm/amdgpu.ids" , query , & gpu -> name );
199+ #endif
192200 }
193201 }
194202 ffStrbufSubstrBefore (drmDir , drmDirPathLength );
@@ -202,8 +210,7 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf
202210 ffStrbufInit (& pciids );
203211 loadPciIds (& pciids );
204212 }
205- if (pciids .length )
206- ffGPUParsePciIds (& pciids , subclassId , (uint16_t ) vendorId , (uint16_t ) deviceId , gpu );
213+ ffGPUParsePciIds (& pciids , subclassId , (uint16_t ) vendorId , (uint16_t ) deviceId , gpu );
207214 }
208215
209216 pciDetectDriver (gpu , drmDir , buffer );
0 commit comments