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.
Also remove the unnecessary saved_interactive_mode variable
used by the msm-dcvs governor; its function is superseded by
the variable display_hint_sent.
Change-Id: If7dd11fcb578211f4f83847f9257232c4138ce53
diff --git a/power-8992.c b/power-8992.c
index c87ba5a..d4b020d 100644
--- a/power-8992.c
+++ b/power-8992.c
@@ -47,8 +47,6 @@
#include "performance.h"
#include "power-common.h"
-static int display_hint_sent;
-
static int process_video_encode_hint(void *metadata)
{
char governor[80];
@@ -125,18 +123,14 @@
/* Display off */
if (is_interactive_governor(governor)) {
int resource_values[] = {0x777}; /* 4+0 core config in display off */
- if (!display_hint_sent) {
- perform_hint_action(DISPLAY_STATE_HINT_ID,
- resource_values, ARRAY_SIZE(resource_values));
- display_hint_sent = 1;
- return HINT_HANDLED;
- }
+ perform_hint_action(DISPLAY_STATE_HINT_ID,
+ resource_values, ARRAY_SIZE(resource_values));
+ return HINT_HANDLED;
}
} else {
/* Display on */
if (is_interactive_governor(governor)) {
undo_hint_action(DISPLAY_STATE_HINT_ID);
- display_hint_sent = 0;
return HINT_HANDLED;
}
}