1 From 72bfb10c9393688d00e4e0b00d416e23c2753318 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Fri, 17 Feb 2023 15:07:29 +0100
4 Subject: [PATCH] drm/vc4: hvs: Use switch statement to simplify
7 Since we'll support BCM2712 soon, let's move the logic to enable and
8 disable the end-of-frame interrupts to a switch to extend it more
11 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
13 drivers/gpu/drm/vc4/vc4_hvs.c | 42 ++++++++++++++++++++++++++---------
14 1 file changed, 32 insertions(+), 10 deletions(-)
16 --- a/drivers/gpu/drm/vc4/vc4_hvs.c
17 +++ b/drivers/gpu/drm/vc4/vc4_hvs.c
18 @@ -416,24 +416,46 @@ static void vc4_hvs_irq_enable_eof(const
21 struct vc4_dev *vc4 = hvs->vc4;
22 - u32 irq_mask = vc4->gen == VC4_GEN_5 ?
23 - SCALER5_DISPCTRL_DSPEIEOF(channel) :
24 - SCALER_DISPCTRL_DSPEIEOF(channel);
26 - HVS_WRITE(SCALER_DISPCTRL,
27 - HVS_READ(SCALER_DISPCTRL) | irq_mask);
30 + HVS_WRITE(SCALER_DISPCTRL,
31 + HVS_READ(SCALER_DISPCTRL) |
32 + SCALER_DISPCTRL_DSPEIEOF(channel));
36 + HVS_WRITE(SCALER_DISPCTRL,
37 + HVS_READ(SCALER_DISPCTRL) |
38 + SCALER5_DISPCTRL_DSPEIEOF(channel));
46 static void vc4_hvs_irq_clear_eof(const struct vc4_hvs *hvs,
49 struct vc4_dev *vc4 = hvs->vc4;
50 - u32 irq_mask = vc4->gen == VC4_GEN_5 ?
51 - SCALER5_DISPCTRL_DSPEIEOF(channel) :
52 - SCALER_DISPCTRL_DSPEIEOF(channel);
54 - HVS_WRITE(SCALER_DISPCTRL,
55 - HVS_READ(SCALER_DISPCTRL) & ~irq_mask);
58 + HVS_WRITE(SCALER_DISPCTRL,
59 + HVS_READ(SCALER_DISPCTRL) &
60 + ~SCALER_DISPCTRL_DSPEIEOF(channel));
64 + HVS_WRITE(SCALER_DISPCTRL,
65 + HVS_READ(SCALER_DISPCTRL) &
66 + ~SCALER5_DISPCTRL_DSPEIEOF(channel));
74 static struct vc4_hvs_dlist_allocation *