From 7e55a41209a115da4f2235b7683387e282c1401a Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 29 Jul 2012 20:17:15 +1000 Subject: [PATCH] Sleep only the extra amount of time we overran the dynamic interval in dynamic mode. --- driver-opencl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver-opencl.c b/driver-opencl.c index b22017c1..0bfd805c 100644 --- a/driver-opencl.c +++ b/driver-opencl.c @@ -1510,7 +1510,7 @@ static int64_t opencl_scanhash(struct thr_info *thr, struct work *work, if (gpu->intensity > MIN_INTENSITY) --gpu->intensity; else - nmsleep(opt_dynamic_interval / 2 ? : 1); + nmsleep(gpu->gpu_us_average - dynamic_us); } else if (gpu->gpu_us_average < dynamic_us / 2) { if (gpu->intensity < MAX_INTENSITY) ++gpu->intensity;