Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e58d0cd5 authored by laxman's avatar laxman
Browse files

cpufreq bouncing mechanism

Change-Id: If103643c6ef03932e6957f7ff958599e678662f0
parent 1f4f5de5
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -769,3 +769,5 @@ CONFIG_MEMEX_STANDALONE=y
CONFIG_SLA=y
CONFIG_SLA=y
CONFIG_SLA_ALGO=y
CONFIG_SLA_ALGO=y
CONFIG_RATP=y
CONFIG_RATP=y
CONFIG_QCOM_QDSS_BRIDGE=y
CONFIG_CPUFREQ_BOUNCING=y
+1 −0
Original line number Original line Diff line number Diff line
@@ -834,3 +834,4 @@ CONFIG_MEMEX_STANDALONE=y
CONFIG_SLA=y
CONFIG_SLA=y
CONFIG_SLA_ALGO=y
CONFIG_SLA_ALGO=y
CONFIG_RATP=y
CONFIG_RATP=y
CONFIG_CPUFREQ_BOUNCING=y
+4 −1
Original line number Original line Diff line number Diff line
@@ -43,6 +43,7 @@
#endif
#endif
#define GOLD_CPU_NUMBER 6
#define GOLD_CPU_NUMBER 6
#define GOLD_PLUS_CPU_NUMBER 7
#define GOLD_PLUS_CPU_NUMBER 7
#include <linux/oem/cpufreq_bouncing.h>


static LIST_HEAD(cpufreq_policy_list);
static LIST_HEAD(cpufreq_policy_list);


@@ -544,6 +545,8 @@ unsigned int cpufreq_driver_resolve_freq(struct cpufreq_policy *policy,
#ifdef CONFIG_PCCORE
#ifdef CONFIG_PCCORE
	unsigned int min_target;
	unsigned int min_target;
#endif
#endif
	target_freq = cb_cap(policy, target_freq);

#ifdef CONFIG_CONTROL_CENTER
#ifdef CONFIG_CONTROL_CENTER
	if (likely(policy->cc_enable))
	if (likely(policy->cc_enable))
		target_freq = clamp_val(target_freq, policy->cc_min, policy->cc_max);
		target_freq = clamp_val(target_freq, policy->cc_min, policy->cc_max);
@@ -1992,7 +1995,7 @@ unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,
					unsigned int target_freq)
					unsigned int target_freq)
{
{
	int ret;
	int ret;

	target_freq = cb_cap(policy, target_freq);
	target_freq = clamp_val(target_freq, policy->min, policy->max);
	target_freq = clamp_val(target_freq, policy->min, policy->max);


	ret = cpufreq_driver->fast_switch(policy, target_freq);
	ret = cpufreq_driver->fast_switch(policy, target_freq);
+4 −1
Original line number Original line Diff line number Diff line
@@ -38,7 +38,7 @@
#ifdef CONFIG_IM
#ifdef CONFIG_IM
#include <linux/oem/im.h>
#include <linux/oem/im.h>
#endif
#endif

#include <linux/oem/cpufreq_bouncing.h>
DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);


#define TRACE_DEBUG 0
#define TRACE_DEBUG 0
@@ -6988,6 +6988,7 @@ int sched_isolate_cpu(int cpu)
	update_max_interval();
	update_max_interval();
	sched_update_group_capacities(cpu);
	sched_update_group_capacities(cpu);


	cb_reset(cpu, start_time);
out:
out:
	cpu_maps_update_done();
	cpu_maps_update_done();
	trace_sched_isolate(cpu, cpumask_bits(cpu_isolated_mask)[0],
	trace_sched_isolate(cpu, cpumask_bits(cpu_isolated_mask)[0],
@@ -7013,6 +7014,8 @@ int sched_unisolate_cpu_unlocked(int cpu)
	if (trace_sched_isolate_enabled())
	if (trace_sched_isolate_enabled())
		start_time = sched_clock();
		start_time = sched_clock();


	cb_reset(cpu, start_time);

	if (!cpu_isolation_vote[cpu]) {
	if (!cpu_isolation_vote[cpu]) {
		ret_code = -EINVAL;
		ret_code = -EINVAL;
		goto out;
		goto out;
+6 −0
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@
#ifdef CONFIG_HOUSTON
#ifdef CONFIG_HOUSTON
#include <oneplus/houston/houston_helper.h>
#include <oneplus/houston/houston_helper.h>
#endif
#endif
#include <linux/oem/cpufreq_bouncing.h>


struct sugov_tunables {
struct sugov_tunables {
	struct gov_attr_set	attr_set;
	struct gov_attr_set	attr_set;
@@ -724,6 +725,8 @@ static void sugov_update_single(struct update_util_data *hook, u64 time,
	struct cpufreq_policy *policy = sg_policy->policy;
	struct cpufreq_policy *policy = sg_policy->policy;
#endif
#endif


	cb_update(sg_policy->policy, time);

	if (!sg_policy->tunables->pl && flags & SCHED_CPUFREQ_PL)
	if (!sg_policy->tunables->pl && flags & SCHED_CPUFREQ_PL)
		return;
		return;


@@ -855,6 +858,9 @@ sugov_update_shared(struct update_util_data *hook, u64 time, unsigned int flags)
	struct cpufreq_policy *policy = sg_policy->policy;
	struct cpufreq_policy *policy = sg_policy->policy;
#endif
#endif


	if (!(flags & SCHED_CPUFREQ_CONTINUE))
		cb_update(sg_policy->policy, time);

	if (!sg_policy->tunables->pl && flags & SCHED_CPUFREQ_PL)
	if (!sg_policy->tunables->pl && flags & SCHED_CPUFREQ_PL)
		return;
		return;