diff options
author | Ricardo Cerqueira <ricardo@cyngn.com> | 2016-07-16 02:31:00 +0100 |
---|---|---|
committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2016-07-15 18:32:22 -0700 |
commit | ac2ef6c927a34057cac0fb040f461979624c6ba9 (patch) | |
tree | b7b2bf42c533f45017f5f0a5884eda077c4307dc | |
parent | 85f0d13a8b6c0a027f2b9953a8885993126a3cbd (diff) |
power: 8937: All in with mpctl v3
Change-Id: I56ed97396b2e6f952780591d8409dbda15b7fbe8
-rw-r--r-- | power/power-8937.c | 61 |
1 files changed, 20 insertions, 41 deletions
diff --git a/power/power-8937.c b/power/power-8937.c index 3c5425f..02440a6 100644 --- a/power/power-8937.c +++ b/power/power-8937.c @@ -57,37 +57,20 @@ static void process_video_encode_hint(void *metadata); extern void interaction(int duration, int num_args, int opt_list[]); static int profile_high_performance[] = { -#ifdef MPCTLV3 SCHED_BOOST_ON_V3, 0x1, ALL_CPUS_PWR_CLPS_DIS_V3, 0x1, CPUS_ONLINE_MIN_BIG, 0x2, CPUS_ONLINE_MIN_LITTLE, 0x2, MIN_FREQ_BIG_CORE_0, 0xFFF, MIN_FREQ_LITTLE_CORE_0, 0xFFF, -#else - SCHED_BOOST_ON, - 0x704, 0x4d04, /* Enable all CPUs */ - CPU0_MIN_FREQ_TURBO_MAX, CPU1_MIN_FREQ_TURBO_MAX, - CPU2_MIN_FREQ_TURBO_MAX, CPU3_MIN_FREQ_TURBO_MAX, - CPU4_MIN_FREQ_TURBO_MAX, CPU5_MIN_FREQ_TURBO_MAX, - CPU6_MIN_FREQ_TURBO_MAX, CPU7_MIN_FREQ_TURBO_MAX, -#endif }; static int profile_power_save[] = { -#ifdef MPCTLV3 CPUS_ONLINE_MAX_LIMIT_BIG, 0x1, MAX_FREQ_BIG_CORE_0, 0x3bf, MAX_FREQ_LITTLE_CORE_0, 0x300, -#else - 0x8fe, 0x3dfd, /* 1 big core, 2 little cores*/ - CPUS_ONLINE_MAX_LIMIT_2, - CPU0_MAX_FREQ_NONTURBO_MAX, CPU1_MAX_FREQ_NONTURBO_MAX, - CPU2_MAX_FREQ_NONTURBO_MAX, CPU3_MAX_FREQ_NONTURBO_MAX, -#endif }; -#ifdef MPCTLV3 static int profile_bias_power[] = { MAX_FREQ_BIG_CORE_0, 0x4B0, MAX_FREQ_LITTLE_CORE_0, 0x300, @@ -98,14 +81,9 @@ static int profile_bias_performance[] = { CPUS_ONLINE_MAX_LIMIT_LITTLE, 0x2, MIN_FREQ_BIG_CORE_0, 0x540, }; -#endif int get_number_of_profiles() { -#ifdef MPCTLV3 return 5; -#else - return 3; -#endif } static void set_power_profile(int profile) { @@ -129,7 +107,6 @@ static void set_power_profile(int profile) { perform_hint_action(DEFAULT_PROFILE_HINT_ID, profile_power_save, ARRAY_SIZE(profile_power_save)); ALOGD("%s: set powersave", __func__); -#ifdef MPCTLV3 } else if (profile == PROFILE_BIAS_POWER) { perform_hint_action(DEFAULT_PROFILE_HINT_ID, profile_bias_power, ARRAY_SIZE(profile_bias_power)); @@ -139,8 +116,6 @@ static void set_power_profile(int profile) { perform_hint_action(DEFAULT_PROFILE_HINT_ID, profile_bias_performance, ARRAY_SIZE(profile_bias_performance)); ALOGD("%s: Set bias perf mode", __func__); - -#endif } current_power_profile = profile; @@ -155,24 +130,28 @@ int power_hint_override(struct power_module *module, power_hint_t hint, struct timeval cur_boost_timeval = {0, 0}; double elapsed_time; int resources_launch_boost[] = { - ALL_CPUS_PWR_CLPS_DIS, - SCHED_BOOST_ON, - SCHED_PREFER_IDLE_DIS, - 0x20f, - 0x4001, - 0x4101, - 0x4201, + SCHED_BOOST_ON_V3, 0x1, + MAX_FREQ_BIG_CORE_0, 0xFFF, + MAX_FREQ_LITTLE_CORE_0, 0xFFF, + MIN_FREQ_BIG_CORE_0, 0xFFF, + MIN_FREQ_LITTLE_CORE_0, 0xFFF, + ALL_CPUS_PWR_CLPS_DIS_V3, 0x1, + STOR_CLK_SCALE_DIS, 0x1, }; + int resources_cpu_boost[] = { - ALL_CPUS_PWR_CLPS_DIS, - SCHED_BOOST_ON, - SCHED_PREFER_IDLE_DIS, - 0x20d, + SCHED_BOOST_ON_V3, 0x1, + MIN_FREQ_BIG_CORE_0, 0x3BF, + }; + + int resources_interaction_fling_boost[] = { + MIN_FREQ_BIG_CORE_0, 0x3BF, + MIN_FREQ_LITTLE_CORE_0, 0x300, + SCHED_BOOST_ON_V3, 0x1, }; + int resources_interaction_boost[] = { - SCHED_PREFER_IDLE_DIS, - 0x20d, - 0x3d01, + MIN_FREQ_BIG_CORE_0, 0x300, }; if (hint == POWER_HINT_SET_PROFILE) { @@ -210,8 +189,8 @@ int power_hint_override(struct power_module *module, power_hint_t hint, previous_boost_time = cur_boost_time; if (duration >= 1500) { - interaction(duration, ARRAY_SIZE(resources_cpu_boost), - resources_cpu_boost); + interaction(duration, ARRAY_SIZE(resources_interaction_fling_boost), + resources_interaction_fling_boost); } else { interaction(duration, ARRAY_SIZE(resources_interaction_boost), resources_interaction_boost); |