From 85e00bf2ce6aa080a42ad6f8dd47733b514cceac Mon Sep 17 00:00:00 2001 From: Zhao Wei Liew Date: Sun, 26 Jun 2016 21:29:34 +0800 Subject: power: Simplify display_hint_sent Check for whether the display hint has been sent at the start of the set_interactive() function in the common powerHAL. This gets rid of the need to replicate the same variable in every target-specific powerHAL that implements the set_interactive_override() function. Change-Id: If7dd11fcb578211f4f83847f9257232c4138ce53 --- power-8916.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'power-8916.c') diff --git a/power-8916.c b/power-8916.c index 8241aeb..39f46e3 100644 --- a/power-8916.c +++ b/power-8916.c @@ -57,7 +57,6 @@ char scaling_min_freq[4][80] = {"sys/devices/system/cpu/cpu0/cpufreq/scaling_min "sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq"}; static int slack_node_rw_failed = 0; -static int display_hint_sent; int display_boost; /** @@ -121,11 +120,8 @@ int set_interactive_override(int on) { if (is_interactive_governor(governor)) { int resource_values[] = {TR_MS_50, THREAD_MIGRATION_SYNC_OFF}; - if (!display_hint_sent) { - perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values, - sizeof(resource_values) / sizeof(resource_values[0])); - display_hint_sent = 1; - } + perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values, + sizeof(resource_values) / sizeof(resource_values[0])); } /* Perf time rate set for 8916 target*/ /* End of display hint for 8916 */ } else { @@ -148,11 +144,8 @@ int set_interactive_override(int on) { } } - if (!display_hint_sent) { - perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values, - sizeof(resource_values) / sizeof(resource_values[0])); - display_hint_sent = 1; - } + perform_hint_action(DISPLAY_STATE_HINT_ID, resource_values, + sizeof(resource_values) / sizeof(resource_values[0])); } /* Perf time rate set for CORE0,CORE4 8939 target*/ /* End of display hint for 8939 */ } @@ -161,7 +154,6 @@ int set_interactive_override(int on) { if (is_target_8916()) { if (is_interactive_governor(governor)) { undo_hint_action(DISPLAY_STATE_HINT_ID); - display_hint_sent = 0; } } else { if (is_interactive_governor(governor)) { @@ -180,7 +172,6 @@ int set_interactive_override(int on) { } } undo_hint_action(DISPLAY_STATE_HINT_ID); - display_hint_sent = 0; } } /* End of check condition during the DISPLAY ON case */ } -- cgit v1.2.3