1 From 52beca6270b034cce84a738c71d36ffff7088389 Mon Sep 17 00:00:00 2001
2 From: Dom Cobley <popcornmix@gmail.com>
3 Date: Fri, 10 Jul 2020 11:51:16 +0100
4 Subject: [PATCH] drm/vc4: enable HBR MAI format on HBR streams
6 Signed-off-by: Matthias Reichl <hias@horus.com>
8 drivers/gpu/drm/vc4/vc4_hdmi.c | 6 +++++-
9 1 file changed, 5 insertions(+), 1 deletion(-)
11 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
12 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
13 @@ -991,7 +991,11 @@ static int vc4_hdmi_audio_prepare(struct
14 vc4_hdmi_audio_set_mai_clock(vc4_hdmi);
16 mai_sample_rate = sample_rate_to_mai_fmt(vc4_hdmi->audio.samplerate);
17 - mai_audio_format = VC4_HDMI_MAI_FORMAT_PCM;
18 + if (vc4_hdmi->audio.iec_status[0] & IEC958_AES0_NONAUDIO &&
19 + vc4_hdmi->audio.channels == 8)
20 + mai_audio_format = VC4_HDMI_MAI_FORMAT_HBR;
22 + mai_audio_format = VC4_HDMI_MAI_FORMAT_PCM;
23 HDMI_WRITE(HDMI_MAI_FMT,
24 VC4_SET_FIELD(mai_sample_rate, VC4_HDMI_MAI_FORMAT_SAMPLE_RATE) |
25 VC4_SET_FIELD(mai_audio_format, VC4_HDMI_MAI_FORMAT_AUDIO_FORMAT));