@@ -45,12 +45,6 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
45
45
{
46
46
FF_DEBUG ("Processing device ID: %ls" , devId );
47
47
48
- if (wcsncmp (devId , L"SWD\\" , 4 ) == 0 )
49
- {
50
- FF_DEBUG ("Skipping SWD device interface to avoid duplicates" );
51
- continue ;
52
- }
53
-
54
48
DEVINST devInst = 0 ;
55
49
56
50
{
@@ -121,6 +115,25 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
121
115
122
116
wchar_t buffer [256 ];
123
117
ULONG bufferLen = 0 ;
118
+
119
+ FF_DEBUG ("Get device description as device name" );
120
+ bufferLen = sizeof (buffer );
121
+ if (CM_Get_DevNode_Registry_PropertyW (devInst , CM_DRP_DEVICEDESC , NULL , buffer , & bufferLen , 0 ) == CR_SUCCESS )
122
+ {
123
+ ffStrbufSetWS (& gpu -> name , buffer );
124
+ FF_DEBUG ("Found device description: %s" , gpu -> name .chars );
125
+ }
126
+ else
127
+ {
128
+ FF_DEBUG ("Failed to get device description" );
129
+ }
130
+
131
+ if (wcsncmp (devId , L"SWD\\" , 4 ) == 0 || wcsncmp (devId , L"ROOT\\DISPLAY\\" , 13 ) == 0 )
132
+ {
133
+ FF_DEBUG ("Skipping virtual devices to avoid duplicates" );
134
+ continue ;
135
+ }
136
+
124
137
if (CM_Open_DevNode_Key (devInst , KEY_QUERY_VALUE , 0 , RegDisposition_OpenExisting , & hVideoIdKey , CM_REGISTRY_HARDWARE ) == CR_SUCCESS )
125
138
{
126
139
FF_DEBUG ("Opened device node registry key" );
@@ -145,8 +158,12 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
145
158
}
146
159
}
147
160
148
- if (ffRegReadStrbuf (hDirectxKey , L"Description" , & gpu -> name , NULL ))
149
- FF_DEBUG ("Found GPU description: %s" , gpu -> name .chars );
161
+ if (gpu -> name .length == 0 )
162
+ {
163
+ FF_DEBUG ("Trying to get GPU name from DirectX registry" );
164
+ if (ffRegReadStrbuf (hDirectxKey , L"Description" , & gpu -> name , NULL ))
165
+ FF_DEBUG ("Found GPU description: %s" , gpu -> name .chars );
166
+ }
150
167
151
168
if (ffRegReadUint64 (hDirectxKey , L"DedicatedVideoMemory" , & gpu -> dedicated .total , NULL ))
152
169
FF_DEBUG ("Found dedicated video memory: %llu bytes" , gpu -> dedicated .total );
@@ -309,21 +326,6 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
309
326
FF_DEBUG ("No driver-specific detection function found for vendor: %s" , gpu -> vendor .chars );
310
327
}
311
328
312
- if (!gpu -> name .length )
313
- {
314
- FF_DEBUG ("Trying to get device description as fallback" );
315
- bufferLen = sizeof (buffer );
316
- if (CM_Get_DevNode_Registry_PropertyW (devInst , CM_DRP_DEVICEDESC , NULL , buffer , & bufferLen , 0 ) == CR_SUCCESS )
317
- {
318
- ffStrbufSetWS (& gpu -> name , buffer );
319
- FF_DEBUG ("Found device description: %s" , gpu -> name .chars );
320
- }
321
- else
322
- {
323
- FF_DEBUG ("Failed to get device description" );
324
- }
325
- }
326
-
327
329
if (gpu -> type == FF_GPU_TYPE_UNKNOWN && adapterLuid > 0 )
328
330
{
329
331
FF_DEBUG ("Trying to determine GPU type using D3DKMT APIs" );
0 commit comments