Commit dcc97e45db281823ff8c0024fd3d473985030ad1

Con Kolivas 2011-09-03T15:46:57

Add an --auto-fan command line option to allow all GPUs to have autofan enabled from startup.

diff --git a/adl.c b/adl.c
index 614bfd1..3b3b55f 100644
--- a/adl.c
+++ b/adl.c
@@ -228,6 +228,8 @@ void init_adl(int nDevs)
 		/* Set some default temperatures for autotune when enabled */
 		ga->targettemp = 75;
 		ga->overtemp = 85;
+		if (opt_autofan)
+			ga->autofan = true;
 
 		gpus[devices - 1].has_adl = true;
 	}
diff --git a/main.c b/main.c
index f83fa8b..ebf5e44 100644
--- a/main.c
+++ b/main.c
@@ -221,6 +221,7 @@ static bool opt_nogpu;
 static bool opt_usecpu;
 static int opt_shares;
 static bool opt_fail_only;
+bool opt_autofan;
 
 char *opt_kernel_path;
 
@@ -1131,6 +1132,11 @@ static struct opt_table opt_config_table[] = {
 		     "\n\tsse4_64\t\tSSE4.1 64 bit implementation for x86_64 machines"
 #endif
 		),
+#ifdef HAVE_ADL
+	OPT_WITHOUT_ARG("--auto-fan",
+			opt_set_bool, &opt_autofan,
+			"Automatically adjust all GPU fan speeds to maintain a target temperature"),
+#endif
 	OPT_WITH_ARG("--bench-algo|-b",
 		     set_int_0_to_9999, opt_show_intval, &opt_bench_algo,
 		     opt_hidden),
diff --git a/miner.h b/miner.h
index ad9d2ae..9035a2b 100644
--- a/miner.h
+++ b/miner.h
@@ -295,6 +295,8 @@ extern bool opt_debug;
 extern bool opt_protocol;
 extern bool opt_log_output;
 extern char *opt_kernel_path;
+extern bool opt_autofan;
+
 extern const uint32_t sha256_init_state[];
 extern json_t *json_rpc_call(CURL *curl, const char *url, const char *userpass,
 			     const char *rpc_req, bool, bool, bool *,