174f6fb3a1942a4b1d495ea658250fc59570f58a
[openwrt/staging/chunkeey.git] / target / linux / bcm27xx / patches-5.10 / 950-0539-drm-vc4-hdmi-Convert-to-the-new-clock-request-API.patch
1 From ccc2fa16de3fef192885831595a168a36bfdd842 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 @@ -313,6 +313,7 @@ vc4_atomic_complete_commit(struct drm_at
18 struct vc4_hvs *hvs = vc4->hvs;
19 struct drm_crtc_state *new_crtc_state;
20 struct drm_crtc *crtc;
21 + struct clk_request *core_req;
22 int i;
23
24 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
25 @@ -326,7 +327,7 @@ vc4_atomic_complete_commit(struct drm_at
26 }
27
28 if (vc4->hvs && vc4->hvs->hvs5)
29 - clk_set_min_rate(hvs->core_clk, 500000000);
30 + core_req = clk_request_start(hvs->core_clk, 500000000);
31
32 drm_atomic_helper_wait_for_fences(dev, state, false);
33
34 @@ -358,7 +359,7 @@ vc4_atomic_complete_commit(struct drm_at
35 drm_atomic_helper_commit_cleanup_done(state);
36
37 if (vc4->hvs && vc4->hvs->hvs5)
38 - clk_set_min_rate(hvs->core_clk, 0);
39 + clk_request_done(core_req);
40
41 drm_atomic_state_put(state);
42