summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvaibhav bhalla <vbhalla@codeaurora.org>2015-03-25 22:20:28 +0530
committerMichael Bestas <mkbestas@lineageos.org>2019-10-23 01:12:56 +0300
commit4f5e237caeebfc29bb9ccc569d311e7d023f00fe (patch)
treeb602c5186afea5a7afe62730eb7d0668882d3e51
parentd856943e8f05179f6d35047fc845c49a303c6e6f (diff)
downloadvendor_qcom_opensource_power-4f5e237caeebfc29bb9ccc569d311e7d023f00fe.zip
vendor_qcom_opensource_power-4f5e237caeebfc29bb9ccc569d311e7d023f00fe.tar.gz
vendor_qcom_opensource_power-4f5e237caeebfc29bb9ccc569d311e7d023f00fe.tar.bz2
power: Change the Hi-Speed freq to 800Mhz for camcorder case
Changes to set Hi-Speed freq for 8909 target as below: -Camcorder ON : set to 800Mhz -Camcorder OFF : set to 998.4Mhz. Change-Id: I8e4ca512c137a137fabe7762695e336a3ed37fdd
-rw-r--r--performance.h1
-rw-r--r--power-8909.c45
2 files changed, 45 insertions, 1 deletions
diff --git a/performance.h b/performance.h
index b7bf34b..5196076 100644
--- a/performance.h
+++ b/performance.h
@@ -184,6 +184,7 @@ enum INTERACTIVE_OPCODES {
enum INTERACTIVE_HISPEED_FREQ_LVL {
HS_FREQ_1026 = 0xF0A,
+ HS_FREQ_800 = 0xF08,
};
enum INTERACTIVE_HISPEED_LOAD_LVL {
diff --git a/power-8909.c b/power-8909.c
index e774b61..25ae2a2 100644
--- a/power-8909.c
+++ b/power-8909.c
@@ -48,12 +48,55 @@
#include "power-common.h"
+static void process_video_encode_hint(void *metadata)
+{
+ char governor[80];
+ struct video_encode_metadata_t video_encode_metadata;
+ char tmp_str[NODE_MAX];
+
+ if (get_scaling_governor(governor, sizeof(governor)) == -1) {
+ ALOGE("Can't obtain scaling governor.");
+
+ return;
+ }
+
+ /* Initialize encode metadata struct fields. */
+ memset(&video_encode_metadata, 0, sizeof(struct video_encode_metadata_t));
+ video_encode_metadata.state = -1;
+ video_encode_metadata.hint_id = DEFAULT_VIDEO_ENCODE_HINT_ID;
+
+ if (metadata) {
+ if (parse_video_encode_metadata((char *)metadata, &video_encode_metadata) ==
+ -1) {
+ ALOGE("Error occurred while parsing metadata.");
+ return;
+ }
+ } else {
+ return;
+ }
+
+ if (video_encode_metadata.state == 1) {
+ if ((strncmp(governor, INTERACTIVE_GOVERNOR, strlen(INTERACTIVE_GOVERNOR)) == 0) &&
+ (strlen(governor) == strlen(INTERACTIVE_GOVERNOR))) {
+ int resource_values[] = {HS_FREQ_800, THREAD_MIGRATION_SYNC_OFF};
+ perform_hint_action(video_encode_metadata.hint_id,
+ resource_values, sizeof(resource_values)/sizeof(resource_values[0]));
+ }
+ } else if (video_encode_metadata.state == 0) {
+ if ((strncmp(governor, INTERACTIVE_GOVERNOR, strlen(INTERACTIVE_GOVERNOR)) == 0) &&
+ (strlen(governor) == strlen(INTERACTIVE_GOVERNOR))) {
+ undo_hint_action(video_encode_metadata.hint_id);
+ }
+ }
+}
+
int power_hint_override(struct power_module *module, power_hint_t hint, void *data)
{
switch(hint) {
case POWER_HINT_VIDEO_ENCODE:
{
- return HINT_HANDLED;
+ process_video_encode_hint(data);
+ return HINT_HANDLED;
}
default:
{