@ -473,8 +473,8 @@ void init_adl(int nDevs)
@@ -473,8 +473,8 @@ void init_adl(int nDevs)
ga - > lpTemperature . iSize = sizeof ( ADLTemperature ) ;
ga - > lpFanSpeedInfo . iSize = sizeof ( ADLFanSpeedInfo ) ;
ga - > lpFanSpeedValue . iSize = ga - > DefFanSpeedValue . iSize = sizeof ( ADLFanSpeedValue ) ;
ga - > lpFanSpeedValue . iSpeedType = ADL_DL_FANCTRL_SPEED_TYPE_PERCENT ;
ga - > DefFanSpeedValue . iSpeedType = ADL_DL_FANCTRL_SPEED_TYPE_PERCENT ;
ga - > lpFanSpeedValue . iSpeedType = ADL_DL_FANCTRL_SPEED_TYPE_RPM ;
ga - > DefFanSpeedValue . iSpeedType = ADL_DL_FANCTRL_SPEED_TYPE_RPM ;
/* Now get the current performance levels for any existing overclock */
if ( ADL_Overdrive5_ODPerformanceLevels_Get ( iAdapterIndex , 0 , lpOdPerformanceLevels ) ! = ADL_OK )
@ -546,6 +546,7 @@ void init_adl(int nDevs)
@@ -546,6 +546,7 @@ void init_adl(int nDevs)
applog ( LOG_INFO , " Failed to ADL_Overdrive5_FanSpeed_Get for default value " ) ;
else
ga - > def_fan_valid = true ;
if ( gpus [ gpu ] . gpu_fan )
set_fanspeed ( gpu , gpus [ gpu ] . gpu_fan ) ;
else
@ -1089,20 +1090,21 @@ int set_fanspeed(int gpu, int iFanSpeed)
@@ -1089,20 +1090,21 @@ int set_fanspeed(int gpu, int iFanSpeed)
ga - > targetfan = iFanSpeed ;
lock_adl ( ) ;
ga - > lpFanSpeedValue . iSpeedType = ADL_DL_FANCTRL_SPEED_TYPE_RPM ;
if ( ADL_Overdrive5_FanSpeed_Get ( ga - > iAdapterIndex , 0 , & ga - > lpFanSpeedValue ) ! = ADL_OK ) {
applog ( LOG_DEBUG , " GPU %d call to fanspeed get failed " , gpu ) ;
}
if ( ! ( ga - > lpFanSpeedValue . iFlags & ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED ) ) {
/* If user defined is not already specified, set it first */
ga - > lpFanSpeedValue . iFlags | = ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED ;
ADL_Overdrive5_FanSpeed_Set ( ga - > iAdapterIndex , 0 , & ga - > lpFanSpeedValue ) ;
}
if ( ! ( ga - > lpFanSpeedInfo . iFlags & ADL_DL_FANCTRL_SUPPORTS_PERCENT_WRITE ) ) {
/* Must convert speed to an RPM */
iFanSpeed = ga - > lpFanSpeedInfo . iMaxRPM * iFanSpeed / 100 ;
ga - > lpFanSpeedValue . iSpeedType = ADL_DL_FANCTRL_SPEED_TYPE_RPM ;
} else
ga - > lpFanSpeedValue . iSpeedType = ADL_DL_FANCTRL_SPEED_TYPE_PERCENT ;
if ( ! ( ga - > lpFanSpeedValue . iFlags & ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED ) ) {
/* If user defined is not already specified, set it first */
ga - > lpFanSpeedValue . iFlags = ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED ;
ADL_Overdrive5_FanSpeed_Set ( ga - > iAdapterIndex , 0 , & ga - > lpFanSpeedValue ) ;
}
ga - > lpFanSpeedValue . iFanSpeed = iFanSpeed ;
ret = ADL_Overdrive5_FanSpeed_Set ( ga - > iAdapterIndex , 0 , & ga - > lpFanSpeedValue ) ;
ga - > managed = true ;