bcm27xx: switch to kernel v6.1
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.15 / 950-0756-drm-vc4-kms-Store-channel-in-local-variable.patch
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
5
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.
8
9 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
10 ---
11 drivers/gpu/drm/vc4/vc4_kms.c | 15 ++++++++-------
12 1 file changed, 8 insertions(+), 7 deletions(-)
13
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;
21
22 if (!vc4_state->update_muxing)
23 continue;
24
25 switch (vc4_crtc->data->hvs_output) {
26 case 2:
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
33 break;
34
35 case 3:
36 - if (vc4_state->assigned_channel == VC4_HVS_CHANNEL_DISABLED)
37 + if (channel == VC4_HVS_CHANNEL_DISABLED)
38 mux = 3;
39 else
40 - mux = vc4_state->assigned_channel;
41 + mux = channel;
42
43 reg = HVS_READ(SCALER_DISPCTRL);
44 HVS_WRITE(SCALER_DISPCTRL,
45 @@ -312,10 +313,10 @@ static void vc5_hvs_pv_muxing_commit(str
46 break;
47
48 case 4:
49 - if (vc4_state->assigned_channel == VC4_HVS_CHANNEL_DISABLED)
50 + if (channel == VC4_HVS_CHANNEL_DISABLED)
51 mux = 3;
52 else
53 - mux = vc4_state->assigned_channel;
54 + mux = channel;
55
56 reg = HVS_READ(SCALER_DISPEOLN);
57 HVS_WRITE(SCALER_DISPEOLN,
58 @@ -325,10 +326,10 @@ static void vc5_hvs_pv_muxing_commit(str
59 break;
60
61 case 5:
62 - if (vc4_state->assigned_channel == VC4_HVS_CHANNEL_DISABLED)
63 + if (channel == VC4_HVS_CHANNEL_DISABLED)
64 mux = 3;
65 else
66 - mux = vc4_state->assigned_channel;
67 + mux = channel;
68
69 reg = HVS_READ(SCALER_DISPDITHER);
70 HVS_WRITE(SCALER_DISPDITHER,