1 From b6b9915ad0b9c70c3b7edc45dfca2fdcfd4ba5cb Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 11 Aug 2022 13:59:34 +0100
4 Subject: [PATCH] drm/vc4: Set AXI panic modes for the HVS
6 The HVS can change AXI request mode based on how full the COB
8 Until now the vc4 driver has been relying on the firmware to
9 have set these to sensible values.
11 With HVS channel 2 now being used for live video, change the
12 panic mode for all channels to be explicitly set by the driver,
13 and the same for all channels.
15 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
17 drivers/gpu/drm/vc4/vc4_hvs.c | 11 +++++++++++
18 1 file changed, 11 insertions(+)
20 --- a/drivers/gpu/drm/vc4/vc4_hvs.c
21 +++ b/drivers/gpu/drm/vc4/vc4_hvs.c
22 @@ -1149,6 +1149,17 @@ static int vc4_hvs_bind(struct device *d
23 dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC1);
24 dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC2);
26 + /* Set AXI panic mode.
27 + * VC4 panics when < 2 lines in FIFO.
28 + * VC5 panics when less than 1 line in the FIFO.
30 + dispctrl &= ~(SCALER_DISPCTRL_PANIC0_MASK |
31 + SCALER_DISPCTRL_PANIC1_MASK |
32 + SCALER_DISPCTRL_PANIC2_MASK);
33 + dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC0);
34 + dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC1);
35 + dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC2);
37 HVS_WRITE(SCALER_DISPCTRL, dispctrl);
39 /* Recompute Composite Output Buffer (COB) allocations for the displays