|
@@ -869,6 +869,18 @@ static void fan_autotune(int gpu, int temp, int fanpercent, bool *fan_optimal)
|
|
|
if (opt_debug)
|
|
if (opt_debug)
|
|
|
applog(LOG_DEBUG, "Temperature %d degrees below target, decreasing fanspeed", opt_hysteresis);
|
|
applog(LOG_DEBUG, "Temperature %d degrees below target, decreasing fanspeed", opt_hysteresis);
|
|
|
newpercent = ga->targetfan - 1;
|
|
newpercent = ga->targetfan - 1;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ /* We're in the optimal range, make minor adjustments if the
|
|
|
|
|
+ * temp is still drifting */
|
|
|
|
|
+ if (fanpercent > bot && temp < ga->lasttemp && temp < ga->targettemp) {
|
|
|
|
|
+ if (opt_debug)
|
|
|
|
|
+ applog(LOG_DEBUG, "Temperature dropping while in target range, decreasing fanspeed");
|
|
|
|
|
+ newpercent = ga->targetfan - 1;
|
|
|
|
|
+ } else if (fanpercent < top && temp > ga->lasttemp && temp > ga->targettemp - opt_hysteresis) {
|
|
|
|
|
+ if (opt_debug)
|
|
|
|
|
+ applog(LOG_DEBUG, "Temperature rising while in target range, increasing fanspeed");
|
|
|
|
|
+ newpercent = ga->targetfan + 1;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (newpercent > iMax)
|
|
if (newpercent > iMax)
|