aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.15/950-0617-drm-vc4-kms-Take-old-state-core-clock-rate-into-acco.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2022-05-16 23:40:32 +0200
committerÁlvaro Fernández Rojas <noltari@gmail.com>2022-05-17 15:11:22 +0200
commit20ea6adbf199097c4f5f591ffee088340630dae4 (patch)
treed6719d95e136611a1c25bbf7789652d6d402779d /target/linux/bcm27xx/patches-5.15/950-0617-drm-vc4-kms-Take-old-state-core-clock-rate-into-acco.patch
parentbca05bd072180dc38ef740b37ded9572a6db1981 (diff)
downloadupstream-20ea6adbf199097c4f5f591ffee088340630dae4.tar.gz
upstream-20ea6adbf199097c4f5f591ffee088340630dae4.tar.bz2
upstream-20ea6adbf199097c4f5f591ffee088340630dae4.zip
bcm27xx: add support for linux v5.15
Build system: x86_64 Build-tested: bcm2708, bcm2709, bcm2710, bcm2711 Run-tested: bcm2708/RPiB+, bcm2709/RPi3B, bcm2710/RPi3B, bcm2711/RPi4B Signed-off-by: Marty Jones <mj8263788@gmail.com> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-5.15/950-0617-drm-vc4-kms-Take-old-state-core-clock-rate-into-acco.patch')
-rw-r--r--target/linux/bcm27xx/patches-5.15/950-0617-drm-vc4-kms-Take-old-state-core-clock-rate-into-acco.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.15/950-0617-drm-vc4-kms-Take-old-state-core-clock-rate-into-acco.patch b/target/linux/bcm27xx/patches-5.15/950-0617-drm-vc4-kms-Take-old-state-core-clock-rate-into-acco.patch
new file mode 100644
index 0000000000..8eb8067732
--- /dev/null
+++ b/target/linux/bcm27xx/patches-5.15/950-0617-drm-vc4-kms-Take-old-state-core-clock-rate-into-acco.patch
@@ -0,0 +1,38 @@
+From ae03b35cf2792e7c4cf55c44dc37322487b72d1d Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <maxime@cerno.tech>
+Date: Thu, 18 Nov 2021 14:04:00 +0100
+Subject: [PATCH] drm/vc4: kms: Take old state core clock rate into
+ account
+
+During a commit, the core clock, which feeds the HVS, needs to run at
+a minimum of 500MHz.
+
+While doing that commit, we can also change the mode to one that
+requires a higher core clock, so we take the core clock rate associated
+to that new state into account for that boost.
+
+However, the old state also needs to be taken into account if it
+requires a core clock higher that the new one and our 500MHz limit,
+since it's still live in hardware at the beginning of our commit.
+
+Fixes: 16e101051f32 ("drm/vc4: Increase the core clock based on HVS load")
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+---
+ drivers/gpu/drm/vc4/vc4_kms.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/vc4/vc4_kms.c
++++ b/drivers/gpu/drm/vc4/vc4_kms.c
+@@ -390,9 +390,10 @@ static void vc4_atomic_commit_tail(struc
+ }
+
+ if (vc4->hvs && vc4->hvs->hvs5) {
++ unsigned long state_rate = max(old_hvs_state->core_clock_rate,
++ new_hvs_state->core_clock_rate);
+ unsigned long core_rate = max_t(unsigned long,
+- 500000000,
+- new_hvs_state->core_clock_rate);
++ 500000000, state_rate);
+
+ core_req = clk_request_start(hvs->core_clk, core_rate);
+ /*