@@ -36,7 +36,7 @@ static const char* ffAdlStatusToString(int status) {
36
36
}
37
37
38
38
// Memory allocation function
39
- void * __attribute__ ( (__stdcall__ )) ADL_Main_Memory_Alloc (int iSize )
39
+ static void * __attribute__ ( (__stdcall__ )) ffAdlMainMemoryAlloc (int iSize )
40
40
{
41
41
return malloc ((size_t ) iSize );
42
42
}
@@ -97,7 +97,7 @@ const char* ffDetectAmdGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverResu
97
97
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE (atiadl , adlData , ADL2_Overdrive6_StateInfo_Get )
98
98
FF_DEBUG ("ADL library loaded" );
99
99
100
- int result = ffADL2_Main_Control_Create (ADL_Main_Memory_Alloc , 1 /*iEnumConnectedAdapters*/ , & adlData .apiHandle );
100
+ int result = ffADL2_Main_Control_Create (ffAdlMainMemoryAlloc , 1 /*iEnumConnectedAdapters*/ , & adlData .apiHandle );
101
101
FF_DEBUG ("ADL2_Main_Control_Create returned %s (%d)" , ffAdlStatusToString (result ), result );
102
102
if (result != ADL_OK )
103
103
return "ffADL2_Main_Control_Create() failed" ;
@@ -243,15 +243,18 @@ const char* ffDetectAmdGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverResu
243
243
FF_DEBUG ("Setting adapter name: %s" , device -> strAdapterName );
244
244
}
245
245
246
- int overdrive_supported = 0 ;
247
- int odParam = 0 ;
248
- int activity_supported = 0 ;
249
- int caps_status = adlData .ffADL2_Overdrive_Caps (adlData .apiHandle , device -> iAdapterIndex , & overdrive_supported , & odParam , & activity_supported );
250
- FF_DEBUG ("ADL2_Overdrive_Caps returned %s (%d), overdrive_supported: %d" , ffAdlStatusToString (caps_status ), caps_status , overdrive_supported );
246
+ int odVersion = 0 ;
251
247
252
- if (overdrive_supported >= 7 )
253
248
{
254
- FF_DEBUG ("Using OverdriveN API" );
249
+ int odSupported = 0 ;
250
+ int odEnabled = 0 ;
251
+ int status = adlData .ffADL2_Overdrive_Caps (adlData .apiHandle , device -> iAdapterIndex , & odSupported , & odEnabled , & odVersion );
252
+ FF_DEBUG ("ADL2_Overdrive_Caps returned %s (%d); supported %d, enabled %d; version %d" , ffAdlStatusToString (status ), status , odSupported , odEnabled , odVersion );
253
+ }
254
+
255
+ if (odVersion >= 6 )
256
+ {
257
+ FF_DEBUG ("Using OverdriveN API (odVersion=%d)" , odVersion );
255
258
256
259
if (result .frequency )
257
260
{
@@ -305,13 +308,9 @@ const char* ffDetectAmdGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverResu
305
308
}
306
309
}
307
310
}
308
- else if (overdrive_supported >= 6 )
309
- {
310
- FF_DEBUG ("Using Overdrive8 API; to be supported" );
311
- }
312
311
else
313
312
{
314
- FF_DEBUG ("Using Overdrive6 API" );
313
+ FF_DEBUG ("Using Overdrive6 API (odVersion=%d)" , odVersion );
315
314
316
315
if (result .frequency )
317
316
{
@@ -346,11 +345,8 @@ const char* ffDetectAmdGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverResu
346
345
347
346
if (apiStatus == ADL_OK )
348
347
{
349
- if (result .coreUsage )
350
- {
351
- * result .coreUsage = status .iActivityPercent ;
352
- FF_DEBUG ("Got GPU activity: %d%%" , status .iActivityPercent );
353
- }
348
+ * result .coreUsage = status .iActivityPercent ;
349
+ FF_DEBUG ("Got GPU activity: %d%%" , status .iActivityPercent );
354
350
}
355
351
else
356
352
{
0 commit comments