bcm27xx: add support for linux v5.15
[openwrt/staging/chunkeey.git] / target / linux / bcm27xx / patches-5.15 / 950-0434-drm-vc4-hdmi-Convert-to-the-new-clock-request-API.patch
1 From e2f73520b94f49c6ef3ae27e6dc899ec855567ab Mon Sep 17 00:00:00 2001
2 From: Dom Cobley <popcornmix@gmail.com>
3 Date: Tue, 13 Apr 2021 14:10:03 +0100
4 Subject: [PATCH] drm/vc4: hdmi: Convert to the new clock request API
5
6 The new clock request API allows us to increase the rate of the
7 core clock as required during mode set while decreasing it when
8 we're done, resulting in a better power-efficiency.
9
10 Signed-off-by: Dom Cobley <popcornmix@gmail.com>
11 ---
12 drivers/gpu/drm/vc4/vc4_kms.c | 5 +++--
13 1 file changed, 3 insertions(+), 2 deletions(-)
14
15 --- a/drivers/gpu/drm/vc4/vc4_kms.c
16 +++ b/drivers/gpu/drm/vc4/vc4_kms.c
17 @@ -345,6 +345,7 @@ static void vc4_atomic_commit_tail(struc
18 struct drm_crtc *crtc;
19 struct vc4_hvs_state *old_hvs_state;
20 unsigned int channel;
21 + struct clk_request *core_req;
22 int i;
23
24 old_hvs_state = vc4_hvs_get_old_global_state(state);
25 @@ -389,7 +390,7 @@ static void vc4_atomic_commit_tail(struc
26 500000000,
27 new_hvs_state->core_clock_rate);
28
29 - clk_set_min_rate(hvs->core_clk, core_rate);
30 + core_req = clk_request_start(hvs->core_clk, core_rate);
31 }
32
33 drm_atomic_helper_commit_modeset_disables(dev, state);
34 @@ -417,7 +418,7 @@ static void vc4_atomic_commit_tail(struc
35 drm_dbg(dev, "Running the core clock at %lu Hz\n",
36 new_hvs_state->core_clock_rate);
37
38 - clk_set_min_rate(hvs->core_clk, new_hvs_state->core_clock_rate);
39 + clk_request_done(core_req);
40 }
41 }
42