Browse Source

Implement menus to change temperature limits.

nfactor-troky
Con Kolivas 13 years ago
parent
commit
12a167a3f1
  1. 23
      adl.c
  2. 2
      main.c

23
adl.c

@ -720,10 +720,12 @@ void change_autosettings(int gpu) @@ -720,10 +720,12 @@ void change_autosettings(int gpu)
{
struct gpu_adl *ga = &gpus[gpu].adl;
char input;
int val;
wlogprint("Target temperature: %d\n", ga->targettemp);
wlogprint("Overheat temperature: %d\n", ga->overtemp);
wlogprint("Toggle [F]an auto [G]PU auto, change [T]arget [O]verheat\n");
wlogprint("Hysteresis differece: %d\n", opt_hysteresis);
wlogprint("Toggle [F]an auto [G]PU auto\nChange [T]arget [O]verheat [H]ysteresis\n");
wlogprint("Or press any other key to continue\n");
input = getch();
if (!strncasecmp(&input, "f", 1)) {
@ -740,6 +742,25 @@ void change_autosettings(int gpu) @@ -740,6 +742,25 @@ void change_autosettings(int gpu)
wlogprint("Resetting GPU engine clock to startup settings\n");
set_defaultengine(gpu);
}
} else if (!strncasecmp(&input, "t", 1)) {
val = curses_int("Enter target temperature for this GPU in °C (0-100)");
if (val < 0 || val > 100)
wlogprint("Invalid temperature");
else
ga->targettemp = val;
} else if (!strncasecmp(&input, "o", 1)) {
wlogprint("Enter oveheat temperature for this GPU in °C (%d-100)", ga->targettemp);
val = curses_int("");
if (val <= ga->targettemp || val > 100)
wlogprint("Invalid temperature");
else
ga->overtemp = val;
} else if (!strncasecmp(&input, "h", 1)) {
val = curses_int("Enter hysteresis temperature difference (0-10)");
if (val < 1 || val > 10)
wlogprint("Invalid value");
else
opt_hysteresis = val;
}
}

2
main.c

@ -1253,7 +1253,7 @@ static struct opt_table opt_config_table[] = { @@ -1253,7 +1253,7 @@ static struct opt_table opt_config_table[] = {
#endif
#ifdef HAVE_ADL
OPT_WITH_ARG("--temp-hysteresis",
set_int_0_to_10, opt_show_intval, &opt_hysteresis,
set_int_1_to_10, opt_show_intval, &opt_hysteresis,
"Set how much the temperature can fluctuate outside limits when automanaging speeds"),
OPT_WITH_ARG("--temp-overheat",
set_int_0_to_100, opt_show_intval, &opt_overheattemp,

Loading…
Cancel
Save