1 From 753f22ccb26a9085c987700206bdf6724be9b547 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Fri, 4 Mar 2022 15:58:51 +0100
4 Subject: [PATCH] drm/vc4: kms: Store channel in local variable
6 We use the channel from our vc4_crtc_state structure in multiple places,
7 let's store it in a local variable to make it cleaner.
9 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
11 drivers/gpu/drm/vc4/vc4_kms.c | 15 ++++++++-------
12 1 file changed, 8 insertions(+), 7 deletions(-)
14 --- a/drivers/gpu/drm/vc4/vc4_kms.c
15 +++ b/drivers/gpu/drm/vc4/vc4_kms.c
16 @@ -286,13 +286,14 @@ static void vc5_hvs_pv_muxing_commit(str
17 for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
18 struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc_state);
19 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
20 + unsigned int channel = vc4_state->assigned_channel;
22 if (!vc4_state->update_muxing)
25 switch (vc4_crtc->data->hvs_output) {
27 - mux = (vc4_state->assigned_channel == 2) ? 0 : 1;
28 + mux = (channel == 2) ? 0 : 1;
29 reg = HVS_READ(SCALER_DISPECTRL);
30 HVS_WRITE(SCALER_DISPECTRL,
31 (reg & ~SCALER_DISPECTRL_DSP2_MUX_MASK) |
32 @@ -300,10 +301,10 @@ static void vc5_hvs_pv_muxing_commit(str
36 - if (vc4_state->assigned_channel == VC4_HVS_CHANNEL_DISABLED)
37 + if (channel == VC4_HVS_CHANNEL_DISABLED)
40 - mux = vc4_state->assigned_channel;
43 reg = HVS_READ(SCALER_DISPCTRL);
44 HVS_WRITE(SCALER_DISPCTRL,
45 @@ -312,10 +313,10 @@ static void vc5_hvs_pv_muxing_commit(str
49 - if (vc4_state->assigned_channel == VC4_HVS_CHANNEL_DISABLED)
50 + if (channel == VC4_HVS_CHANNEL_DISABLED)
53 - mux = vc4_state->assigned_channel;
56 reg = HVS_READ(SCALER_DISPEOLN);
57 HVS_WRITE(SCALER_DISPEOLN,
58 @@ -325,10 +326,10 @@ static void vc5_hvs_pv_muxing_commit(str
62 - if (vc4_state->assigned_channel == VC4_HVS_CHANNEL_DISABLED)
63 + if (channel == VC4_HVS_CHANNEL_DISABLED)
66 - mux = vc4_state->assigned_channel;
69 reg = HVS_READ(SCALER_DISPDITHER);
70 HVS_WRITE(SCALER_DISPDITHER,