From 8722b5b142bb2dcbd7e0aa14c867eb17b9aeb850 Mon Sep 17 00:00:00 2001 From: Sameer Nanda Date: Wed, 28 Nov 2012 11:10:36 -0800 Subject: [PATCH] temp_metrics: Set GPU min freq On systems with modems, a harmonic of the lowest GPU frequency of 350Mhz interferes with the cellular signal. Set the minimum GPU frequency for such systems to 450Mhz. BUG=chrome-os-partner:16439 TEST="cat /sys/kernel/debug/dri/0/i915_min_freq". On systems without this modem, it should read back 350. On systems with the modem, it should read back 450. BRANCH=none Change-Id: I103a55af11955aed2f3e8c945904444475c63865 Signed-off-by: Sameer Nanda Reviewed-on: https://gerrit.chromium.org/gerrit/38826 Reviewed-by: Vincent Palatin Reviewed-by: Todd Broch --- util/temp_metrics.conf | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/util/temp_metrics.conf b/util/temp_metrics.conf index 56b64b2e08..d9c3b4f063 100644 --- a/util/temp_metrics.conf +++ b/util/temp_metrics.conf @@ -142,9 +142,21 @@ script done } - set_gpu_freq() { - gpu_freq=$1 - echo $gpu_freq > /sys/kernel/debug/dri/0/i915_max_freq + set_gpu_min_freq() { + GPU_MIN_FREQ=350 + if lsusb -d 1410:9010; then + # Set min GPU freq to 450 to reduce intereference with modem. + GPU_MIN_FREQ=450 + fi + echo $GPU_MIN_FREQ > /sys/kernel/debug/dri/0/i915_min_freq + } + + set_gpu_max_freq() { + gpu_max_freq=$1 + if [ $GPU_MIN_FREQ -gt $gpu_max_freq ]; then + gpu_max_freq=$GPU_MIN_FREQ + fi + echo $gpu_max_freq > /sys/kernel/debug/dri/0/i915_max_freq } set_duty_cycle() { @@ -240,7 +252,7 @@ script pkg_power_limit=$(get_field $PKG_POWER_LIMIT_FIELD "$step") set_cpu_freq $cpu_max_freq $cpu_min_freq - set_gpu_freq $gpu_max_freq + set_gpu_max_freq $gpu_max_freq set_duty_cycle $cpu_duty_cycle set_pkg_power_limit $pkg_power_limit } @@ -332,6 +344,9 @@ script # Set sensor calibration data. set_calibration_data + # Set minimum GPU frequency. + set_gpu_min_freq + loop_count=0 ec_fan_loop=0