Commit 7bcda9a28fcaff801ed9ee9e0b6613cbdb3be646

Con Kolivas 2012-01-30T12:42:43

Pass the correct GPU from the menu to the adl code.

diff --git a/adl.c b/adl.c
index 2d97a81..d705575 100644
--- a/adl.c
+++ b/adl.c
@@ -1153,8 +1153,9 @@ void change_autosettings(int gpu)
 	}
 }
 
-void change_gpusettings(int gpu)
+void change_gpusettings(int disp_gpu)
 {
+	int gpu = gpus[disp_gpu].virtual_gpu;
 	struct gpu_adl *ga = &gpus[gpu].adl;
 	float fval, fmin = 0, fmax = 0;
 	int val, imin = 0, imax = 0;
diff --git a/adl.h b/adl.h
index 50bd5b8..8e54983 100644
--- a/adl.h
+++ b/adl.h
@@ -16,13 +16,13 @@ int gpu_fanspeed(int gpu);
 int gpu_fanpercent(int gpu);
 bool gpu_stats(int gpu, float *temp, int *engineclock, int *memclock, float *vddc,
 	       int *activity, int *fanspeed, int *fanpercent, int *powertune);
-void change_gpusettings(int gpu);
+void change_gpusettings(int disp_gpu);
 void gpu_autotune(int gpu, bool *enable);
 void clear_adl(int nDevs);
 #else /* HAVE_ADL */
 #define adl_active (0)
 static inline void init_adl(int nDevs) {}
-static inline void change_gpusettings(int gpu) { }
+static inline void change_gpusettings(int disp_gpu) { }
 static inline void clear_adl(int nDevs) {}
 #endif
 #endif