1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-03-13 06:01:03 +00:00

Store the targetfan even if the later getfanspeed fails in case it's temporary.

This commit is contained in:
Con Kolivas 2011-09-16 08:31:27 +10:00
parent 8feb661dbf
commit 92e1ffd374

8
adl.c
View File

@ -794,16 +794,16 @@ static int set_fanspeed(int gpu, int iFanSpeed)
return ret;
}
/* Store what fanspeed we're actually aiming for for re-entrant changes
* in case this device does not support fine setting changes */
ga->targetfan = iFanSpeed;
lock_adl();
if (ADL_Overdrive5_FanSpeed_Get(ga->iAdapterIndex, 0, &ga->lpFanSpeedValue) != ADL_OK) {
if (opt_debug)
applog(LOG_DEBUG, "GPU %d doesn't support fanspeed get", gpu);
goto out;
}
/* Store what fanspeed we're actually aiming for for re-entrant changes
* in case this device does not support fine setting changes */
ga->targetfan = iFanSpeed;
if (!(ga->lpFanSpeedInfo.iFlags & ADL_DL_FANCTRL_SUPPORTS_PERCENT_WRITE)) {
/* Must convert speed to an RPM */
iFanSpeed = ga->lpFanSpeedInfo.iMaxRPM * iFanSpeed / 100;