bcm27xx: update 6.1 patches to latest version
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-6.1 / 950-1067-drm-vc4-Correct-logic-on-stopping-an-HVS-channel.patch
1 From 6e9f68bba01b9c36a77b68c4b3167c317da986da Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 26 Oct 2023 17:46:13 +0100
4 Subject: [PATCH] drm/vc4: Correct logic on stopping an HVS channel
5
6 When factoring out __vc4_hvs_stop_channel, the logic got inverted from
7 if (condition)
8 // stop channel
9 to
10 if (condition)
11 goto out
12 //stop channel
13 out:
14 and also changed the exact register writes used to stop the channel.
15
16 Correct the logic so that the channel is actually stopped, and revert
17 to the original register writes.
18
19 Fixes: 6d01a106b4c8 ("drm/vc4: crtc: Move HVS init and close to a function")
20 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
21 ---
22 drivers/gpu/drm/vc4/vc4_hvs.c | 10 ++++------
23 1 file changed, 4 insertions(+), 6 deletions(-)
24
25 --- a/drivers/gpu/drm/vc4/vc4_hvs.c
26 +++ b/drivers/gpu/drm/vc4/vc4_hvs.c
27 @@ -992,13 +992,11 @@ static void __vc4_hvs_stop_channel(struc
28 if (!drm_dev_enter(drm, &idx))
29 return;
30
31 - if (HVS_READ(SCALER_DISPCTRLX(chan)) & SCALER_DISPCTRLX_ENABLE)
32 + if (!(HVS_READ(SCALER_DISPCTRLX(chan)) & SCALER_DISPCTRLX_ENABLE))
33 goto out;
34
35 - HVS_WRITE(SCALER_DISPCTRLX(chan),
36 - HVS_READ(SCALER_DISPCTRLX(chan)) | SCALER_DISPCTRLX_RESET);
37 - HVS_WRITE(SCALER_DISPCTRLX(chan),
38 - HVS_READ(SCALER_DISPCTRLX(chan)) & ~SCALER_DISPCTRLX_ENABLE);
39 + HVS_WRITE(SCALER_DISPCTRLX(chan), SCALER_DISPCTRLX_RESET);
40 + HVS_WRITE(SCALER_DISPCTRLX(chan), 0);
41
42 /* Once we leave, the scaler should be disabled and its fifo empty. */
43 WARN_ON_ONCE(HVS_READ(SCALER_DISPCTRLX(chan)) & SCALER_DISPCTRLX_RESET);
44 @@ -1026,7 +1024,7 @@ static void __vc6_hvs_stop_channel(struc
45 if (!drm_dev_enter(drm, &idx))
46 return;
47
48 - if (HVS_READ(SCALER6_DISPX_CTRL0(chan)) & SCALER6_DISPX_CTRL0_ENB)
49 + if (!(HVS_READ(SCALER6_DISPX_CTRL0(chan)) & SCALER6_DISPX_CTRL0_ENB))
50 goto out;
51
52 HVS_WRITE(SCALER6_DISPX_CTRL0(chan),