7f9df9b0ff979926f00b6e546d7871d5e0bb7948
[openwrt/staging/jow.git] / target / linux / bcm27xx / patches-5.10 / 950-0505-vc4-drm-Avoid-full-hdmi-audio-fifo-writes.patch
1 From d0df79e13ab947367b86d7861e34f85aa6aad020 Mon Sep 17 00:00:00 2001
2 From: Dom Cobley <popcornmix@gmail.com>
3 Date: Sun, 24 Jan 2021 15:44:10 +0000
4 Subject: [PATCH] vc4/drm: Avoid full hdmi audio fifo writes
5
6 We are getting occasional VC4_HD_MAI_CTL_ERRORF in
7 HDMI_MAI_CTL which seem to correspond with audio dropouts.
8
9 Reduce the threshold where we deassert DREQ to avoid the fifo overfilling
10
11 Signed-off-by: Dom Cobley <popcornmix@gmail.com>
12 ---
13 drivers/gpu/drm/vc4/vc4_hdmi.c | 8 ++++----
14 1 file changed, 4 insertions(+), 4 deletions(-)
15
16 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
17 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
18 @@ -1294,10 +1294,10 @@ static int vc4_hdmi_audio_prepare(struct
19
20 /* Set the MAI threshold */
21 HDMI_WRITE(HDMI_MAI_THR,
22 - VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICHIGH) |
23 - VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICLOW) |
24 - VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQHIGH) |
25 - VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQLOW));
26 + VC4_SET_FIELD(0x08, VC4_HD_MAI_THR_PANICHIGH) |
27 + VC4_SET_FIELD(0x08, VC4_HD_MAI_THR_PANICLOW) |
28 + VC4_SET_FIELD(0x06, VC4_HD_MAI_THR_DREQHIGH) |
29 + VC4_SET_FIELD(0x08, VC4_HD_MAI_THR_DREQLOW));
30
31 HDMI_WRITE(HDMI_MAI_CONFIG,
32 VC4_HDMI_MAI_CONFIG_BIT_REVERSE |