devfreq_boost: Update and expand to handle CPUBW/LLCCBW boosting

This will enable us to more accurately replicate Pixel 4 userspace
DDR boosting by adding support for both CPUBW and LLCCBW devices.

https://android.googlesource.com/device/google/coral/+/refs/heads/master/init.power.rc
https://android.googlesource.com/device/google/coral/+/refs/heads/master/powerhint.json

Change-Id: Iae78fa01f96de8338725fa9309e5eee6d8c82313
Signed-off-by: idkwhoiam322 <idkwhoiam322@raphielgang.org>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This commit is contained in:
idkwhoiam322 2020-01-29 05:23:27 -05:00 committed by Richard Raya
parent 2d8bd072e8
commit b470582782
8 changed files with 24 additions and 24 deletions

View File

@ -288,17 +288,17 @@ config DEVFREQ_WAKE_BOOST_DURATION_MS
help
Wake boost duration in milliseconds for all boostable devices.
config DEVFREQ_CPU_LLCC_DDR_BW_BOOST_FREQ
int "Boost freq for cpu-llcc-ddr-bw device"
config DEVFREQ_MSM_CPUBW_BOOST_FREQ
int "Boost freq for cpubw device"
default "0"
help
Boost frequency for the MSM DDR bus.
CPUBW boost frequency for the MSM DDR bus.
config DEVFREQ_CPU_CPU_LLCC_BW_BOOST_FREQ
int "Boost freq for cpu-cpu-llcc-bw device"
config DEVFREQ_MSM_LLCCBW_BOOST_FREQ
int "Boost freq for llccbw device"
default "0"
help
Boost frequency for the CPU LLCC bus.
LLCCBW boost frequency for the MSM DDR bus.
endif

View File

@ -50,10 +50,10 @@ static void devfreq_max_unboost(struct work_struct *work);
}
static struct df_boost_drv df_boost_drv_g __read_mostly = {
BOOST_DEV_INIT(df_boost_drv_g, DEVFREQ_CPU_LLCC_DDR_BW,
CONFIG_DEVFREQ_CPU_LLCC_DDR_BW_BOOST_FREQ),
BOOST_DEV_INIT(df_boost_drv_g, DEVFREQ_CPU_CPU_LLCC_BW,
CONFIG_DEVFREQ_CPU_CPU_LLCC_BW_BOOST_FREQ)
BOOST_DEV_INIT(df_boost_drv_g, DEVFREQ_MSM_CPUBW,
CONFIG_DEVFREQ_MSM_CPUBW_BOOST_FREQ),
BOOST_DEV_INIT(df_boost_drv_g, DEVFREQ_MSM_LLCCBW,
CONFIG_DEVFREQ_MSM_LLCCBW_BOOST_FREQ)
};
static void __devfreq_boost_kick(struct boost_dev *b)

View File

@ -238,11 +238,11 @@ int devfreq_add_devbw(struct device *dev)
return PTR_ERR(d->df);
}
if (!strcmp(dev_name(dev), "soc:qcom,cpu-llcc-ddr-bw"))
devfreq_register_boost_device(DEVFREQ_CPU_LLCC_DDR_BW, d->df);
if (!strcmp(dev_name(dev), "soc:qcom,cpu-cpu-llcc-bw"))
devfreq_register_boost_device(DEVFREQ_CPU_CPU_LLCC_BW, d->df);
devfreq_register_boost_device(DEVFREQ_MSM_CPUBW, d->df);
if (!strcmp(dev_name(dev), "soc:qcom,cpu-llcc-ddr-bw"))
devfreq_register_boost_device(DEVFREQ_MSM_LLCCBW, d->df);
return 0;
}

View File

@ -2263,8 +2263,8 @@ static int __drm_mode_atomic_ioctl(struct drm_device *dev, void *data,
return -EINVAL;
if (!(arg->flags & DRM_MODE_ATOMIC_TEST_ONLY)) {
devfreq_boost_kick(DEVFREQ_CPU_LLCC_DDR_BW);
devfreq_boost_kick(DEVFREQ_CPU_CPU_LLCC_BW);
devfreq_boost_kick(DEVFREQ_MSM_CPUBW);
devfreq_boost_kick(DEVFREQ_MSM_LLCCBW);
cpu_input_boost_kick();
}

View File

@ -4370,8 +4370,8 @@ void sde_crtc_commit_kickoff(struct drm_crtc *crtc,
SDE_ATRACE_BEGIN("crtc_commit");
/* Boost when a new frame is ready to be committed */
devfreq_boost_kick(DEVFREQ_CPU_LLCC_DDR_BW);
devfreq_boost_kick(DEVFREQ_CPU_CPU_LLCC_BW);
devfreq_boost_kick(DEVFREQ_MSM_CPUBW);
devfreq_boost_kick(DEVFREQ_MSM_LLCCBW);
cpu_input_boost_kick();
is_error = _sde_crtc_prepare_for_kickoff_rot(dev, crtc);

View File

@ -9,8 +9,8 @@
#include <linux/types.h>
enum df_device {
DEVFREQ_CPU_LLCC_DDR_BW,
DEVFREQ_CPU_CPU_LLCC_BW,
DEVFREQ_MSM_CPUBW,
DEVFREQ_MSM_LLCCBW,
DEVFREQ_MAX
};

View File

@ -2249,8 +2249,8 @@ long _do_fork(unsigned long clone_flags,
/* Boost to the max for 50 ms when userspace launches an app */
if (task_is_zygote(current)) {
devfreq_boost_kick_max(DEVFREQ_CPU_LLCC_DDR_BW, 50);
devfreq_boost_kick_max(DEVFREQ_CPU_CPU_LLCC_BW, 50);
devfreq_boost_kick_max(DEVFREQ_MSM_CPUBW, 50);
devfreq_boost_kick_max(DEVFREQ_MSM_LLCCBW, 50);
cpu_input_boost_kick_max(50);
}

View File

@ -4326,8 +4326,8 @@ retry:
wake_all_kswapds(order, ac);
/* Boost when memory is low so allocation latency doesn't get too bad */
devfreq_boost_kick_max(DEVFREQ_CPU_LLCC_DDR_BW, 100);
devfreq_boost_kick_max(DEVFREQ_CPU_CPU_LLCC_BW, 100);
devfreq_boost_kick_max(DEVFREQ_MSM_CPUBW, 100);
devfreq_boost_kick_max(DEVFREQ_MSM_LLCCBW, 100);
cpu_input_boost_kick_max(100);
reserve_flags = __gfp_pfmemalloc_flags(gfp_mask);