drm/vc4: hdmi: Convert to the new clock request API
authorDom Cobley <popcornmix@gmail.com>
Tue, 13 Apr 2021 13:10:03 +0000 (14:10 +0100)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Mon, 19 Apr 2021 20:50:55 +0000 (21:50 +0100)
The new clock request API allows us to increase the rate of the
core clock as required during mode set while decreasing it when
we're done, resulting in a better power-efficiency.

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
drivers/gpu/drm/vc4/vc4_kms.c

index 5d0974c..48e3dc1 100644 (file)
@@ -313,6 +313,7 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state)
        struct vc4_hvs *hvs = vc4->hvs;
        struct drm_crtc_state *new_crtc_state;
        struct drm_crtc *crtc;
+       struct clk_request *core_req;
        int i;
 
        for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
@@ -326,7 +327,7 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state)
        }
 
        if (vc4->hvs && vc4->hvs->hvs5)
-               clk_set_min_rate(hvs->core_clk, 500000000);
+               core_req = clk_request_start(hvs->core_clk, 500000000);
 
        drm_atomic_helper_wait_for_fences(dev, state, false);
 
@@ -358,7 +359,7 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state)
        drm_atomic_helper_commit_cleanup_done(state);
 
        if (vc4->hvs && vc4->hvs->hvs5)
-               clk_set_min_rate(hvs->core_clk, 0);
+               clk_request_done(core_req);
 
        drm_atomic_state_put(state);