From: Maxime Ripard Date: Thu, 4 Nov 2021 13:04:37 +0000 (+0100) Subject: drm/vc4: kms: Move clock request to our HVS state X-Git-Tag: accepted/tizen/unified/20230118.172025~987 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=99b231f3ac6e10e457ee5c1c0a651d6bee44ef72;p=platform%2Fkernel%2Flinux-rpi.git drm/vc4: kms: Move clock request to our HVS state Our current clock request has been stored so far on the main HVS structure, but even though we shouldn't have two commits in parallel and it shouldn't cause any functional change, the request itself is linked to a given HVS state. Move the request there to make a bit more sense. Signed-off-by: Maxime Ripard --- diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index 67a70d3..81bca15 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h @@ -326,7 +326,6 @@ struct vc4_hvs { u32 __iomem *dlist; struct clk *core_clk; - struct clk_request *core_req; /* Memory manager for CRTCs to allocate space in the display * list. Units are dwords. diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index 0334529..6d78cd5 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -40,6 +40,7 @@ static struct vc4_ctm_state *to_vc4_ctm_state(struct drm_private_state *priv) struct vc4_hvs_state { struct drm_private_state base; unsigned long core_clock_rate; + struct clk_request *core_req; struct { unsigned in_use: 1; @@ -398,7 +399,8 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state) * And remove the previous one based on the HVS * requirements if any. */ - clk_request_done(hvs->core_req); + clk_request_done(old_hvs_state->core_req); + old_hvs_state->core_req = NULL; } drm_atomic_helper_commit_modeset_disables(dev, state); @@ -432,8 +434,8 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state) * Request a clock rate based on the current HVS * requirements. */ - hvs->core_req = clk_request_start(hvs->core_clk, - new_hvs_state->core_clock_rate); + new_hvs_state->core_req = clk_request_start(hvs->core_clk, + new_hvs_state->core_clock_rate); /* And drop the temporary request */ clk_request_done(core_req);