bcm27xx: add support for linux v5.15
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.15 / 950-0621-drm-vc4-hvs-Ignore-atomic_flush-if-we-re-disabled.patch
1 From ba067c30a6456a28c42f74d2134ce9a54a10337f Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Mon, 6 Dec 2021 16:32:10 +0100
4 Subject: [PATCH] drm/vc4: hvs: Ignore atomic_flush if we're disabled
5
6 atomic_flush will be called for each CRTC even if they aren't enabled.
7
8 The whole code we have there will thus run without a properly affected
9 channel, which can then result in all sorts of weird behaviour.
10
11 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
12 ---
13 drivers/gpu/drm/vc4/vc4_hvs.c | 3 +++
14 1 file changed, 3 insertions(+)
15
16 --- a/drivers/gpu/drm/vc4/vc4_hvs.c
17 +++ b/drivers/gpu/drm/vc4/vc4_hvs.c
18 @@ -686,6 +686,9 @@ void vc4_hvs_atomic_flush(struct drm_crt
19 u32 __iomem *dlist_start = vc4->hvs->dlist + vc4_state->mm.start;
20 u32 __iomem *dlist_next = dlist_start;
21
22 + if (vc4_state->assigned_channel == VC4_HVS_CHANNEL_DISABLED)
23 + return;
24 +
25 if (debug_dump_regs) {
26 DRM_INFO("CRTC %d HVS before:\n", drm_crtc_index(crtc));
27 vc4_hvs_dump_state(dev);