From e2f73520b94f49c6ef3ae27e6dc899ec855567ab Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 13 Apr 2021 14:10:03 +0100 Subject: [PATCH] drm/vc4: hdmi: Convert to the new clock request API 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 --- 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 @@ -345,6 +345,7 @@ static void vc4_atomic_commit_tail(struc struct drm_crtc *crtc; struct vc4_hvs_state *old_hvs_state; unsigned int channel; + struct clk_request *core_req; int i; old_hvs_state = vc4_hvs_get_old_global_state(state); @@ -389,7 +390,7 @@ static void vc4_atomic_commit_tail(struc 500000000, new_hvs_state->core_clock_rate); - clk_set_min_rate(hvs->core_clk, core_rate); + core_req = clk_request_start(hvs->core_clk, core_rate); } drm_atomic_helper_commit_modeset_disables(dev, state); @@ -417,7 +418,7 @@ static void vc4_atomic_commit_tail(struc drm_dbg(dev, "Running the core clock at %lu Hz\n", new_hvs_state->core_clock_rate); - clk_set_min_rate(hvs->core_clk, new_hvs_state->core_clock_rate); + clk_request_done(core_req); } }