Browse Source

Only adjust gpu engine speed in autotune mode if the gpu is currently at the performance level of that being adjusted.

nfactor-troky
Con Kolivas 13 years ago
parent
commit
f4d657ee7f
  1. 8
      adl.c

8
adl.c

@ -815,6 +815,7 @@ void gpu_autotune(int gpu, bool *enable)
ga = &cgpu->adl; ga = &cgpu->adl;
lock_adl(); lock_adl();
ADL_Overdrive5_CurrentActivity_Get(ga->iAdapterIndex, &ga->lpActivity);
temp = __gpu_temp(ga); temp = __gpu_temp(ga);
newpercent = fanpercent = __gpu_fanpercent(ga); newpercent = fanpercent = __gpu_fanpercent(ga);
unlock_adl(); unlock_adl();
@ -864,11 +865,14 @@ void gpu_autotune(int gpu, bool *enable)
} else if (temp > ga->overtemp && engine > ga->minspeed) { } else if (temp > ga->overtemp && engine > ga->minspeed) {
applog(LOG_WARNING, "Overheat detected, decreasing GPU %d clock speed", gpu); applog(LOG_WARNING, "Overheat detected, decreasing GPU %d clock speed", gpu);
newengine = ga->minspeed; newengine = ga->minspeed;
} else if (temp > ga->targettemp + opt_hysteresis && engine > ga->minspeed && fan_optimal) { /* Only try to tune engine speed if the current performance level is at max */
} else if ((ga->lpActivity.iCurrentPerformanceLevel == ga->lpOdParameters.iNumberOfPerformanceLevels) &&
(temp > ga->targettemp + opt_hysteresis && engine > ga->minspeed && fan_optimal)) {
if (opt_debug) if (opt_debug)
applog(LOG_DEBUG, "Temperature %d degrees over target, decreasing clock speed", opt_hysteresis); applog(LOG_DEBUG, "Temperature %d degrees over target, decreasing clock speed", opt_hysteresis);
newengine = engine - ga->lpOdParameters.sEngineClock.iStep; newengine = engine - ga->lpOdParameters.sEngineClock.iStep;
} else if (temp < ga->targettemp && engine < ga->maxspeed) { } else if ((ga->lpActivity.iCurrentPerformanceLevel == ga->lpOdParameters.iNumberOfPerformanceLevels) &&
(temp < ga->targettemp && engine < ga->maxspeed)) {
if (opt_debug) if (opt_debug)
applog(LOG_DEBUG, "Temperature below target, increasing clock speed"); applog(LOG_DEBUG, "Temperature below target, increasing clock speed");
newengine = engine + ga->lpOdParameters.sEngineClock.iStep; newengine = engine + ga->lpOdParameters.sEngineClock.iStep;

Loading…
Cancel
Save