Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
[FIXUP] 445e1bc ("sched/boost: Boost CPU and DDR bus when sched_boost…
Browse files Browse the repository at this point in the history
… is triggered")

In addition to inhibiting CAF's sched_boost functionality, we will
repurpose /proc/sys/kernel/sched_boost to act as a userspace hint
for (CPU_INPUT|DEVFREQ)_BOOST to sustain boosts in order to cover
extended user interactions which exceed the inital
INPUT_BOOST_DURATION_MS window.

This is a revision of the (ultimately no-op) concept introduced by
the original commit, seen to fruition by piggy-backing on an
alternative frame boost implementation which will only be allowed
to engage when sched_boost > 0.

Suggested-by: Yaroslav Furman <yaro330@gmail.com>
Co-authored-by: idkwhoiam322 <idkwhoiam322@raphielgang.org>
[@0ctobot: Squash idkwhoiam322/weeb_kernel_oneplus_sm8150@652b6ae
with idkwhoiam322/weeb_kernel_oneplus_sm8150@2289c62 and
idkwhoiam322/weeb_kernel_oneplus_sm8150@65ce97e]
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
  • Loading branch information
0ctobot and idkwhoiam322 committed Feb 5, 2020
1 parent 5ffe056 commit a704a53
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
8 changes: 1 addition & 7 deletions drivers/cpufreq/cpu_input_boost.c
Expand Up @@ -40,8 +40,6 @@ static unsigned int cpu_freq_min_prime __read_mostly =
static unsigned int cpu_freq_idle_little __read_mostly =
CONFIG_CPU_FREQ_IDLE_LP;

static unsigned short input_boost_duration __read_mostly =
CONFIG_INPUT_BOOST_DURATION_MS;
static unsigned short wake_boost_duration __read_mostly =
CONFIG_WAKE_BOOST_DURATION_MS;

Expand All @@ -56,7 +54,6 @@ module_param(cpu_freq_min_big, uint, 0644);
module_param(cpu_freq_min_prime, uint, 0644);
module_param(cpu_freq_idle_little, uint, 0644);

module_param(input_boost_duration, short, 0644);
module_param(wake_boost_duration, short, 0644);

enum {
Expand Down Expand Up @@ -161,12 +158,9 @@ static void __cpu_input_boost_kick(struct boost_drv *b)
if (!test_bit(SCREEN_ON, &b->state))
return;

if (!input_boost_duration)
return;

set_bit(INPUT_BOOST, &b->state);
if (!mod_delayed_work(system_unbound_wq, &b->input_unboost,
msecs_to_jiffies(input_boost_duration)))
msecs_to_jiffies(CONFIG_INPUT_BOOST_DURATION_MS)))
wake_up(&b->boost_waitq);
}

Expand Down
5 changes: 4 additions & 1 deletion drivers/gpu/drm/drm_atomic.c
Expand Up @@ -33,6 +33,7 @@
#include <linux/sync_file.h>
#include <linux/cpu_input_boost.h>
#include <linux/devfreq_boost.h>
#include <linux/sched/sysctl.h>

#include "drm_crtc_internal.h"

Expand Down Expand Up @@ -2249,7 +2250,9 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
(arg->flags & DRM_MODE_PAGE_FLIP_EVENT))
return -EINVAL;

if (!(arg->flags & DRM_MODE_ATOMIC_TEST_ONLY)) {
/* Boost CPU and DDR when committing a new frame if sched_boost > 0 */
if (!(arg->flags & DRM_MODE_ATOMIC_TEST_ONLY) &&
sysctl_sched_boost) {
cpu_input_boost_kick();
devfreq_boost_kick(DEVFREQ_MSM_CPUBW);
}
Expand Down
9 changes: 0 additions & 9 deletions kernel/sched/boost.c
Expand Up @@ -15,8 +15,6 @@
#include <linux/of.h>
#include <linux/sched/core_ctl.h>
#include <trace/events/sched.h>
#include <linux/cpu_input_boost.h>
#include <linux/devfreq_boost.h>

/*
* Scheduler boost is a mechanism to temporarily place tasks on CPUs
Expand Down Expand Up @@ -216,13 +214,6 @@ static void sched_boost_disable_all(void)

static void _sched_set_boost(int type)
{
#if defined(CONFIG_CPU_INPUT_BOOST) && defined(CONFIG_DEVFREQ_BOOST)
if (type > 0) {
cpu_input_boost_kick();
devfreq_boost_kick(DEVFREQ_MSM_CPUBW);
}
return;
#endif
if (type == 0)
sched_boost_disable_all();
else if (type > 0)
Expand Down

0 comments on commit a704a53

Please sign in to comment.