1 From ce3b4ee2f7d315dadd56ba19587b58339e5d6185 Mon Sep 17 00:00:00 2001
2 From: Dom Cobley <popcornmix@gmail.com>
3 Date: Tue, 10 Nov 2020 20:04:08 +0000
4 Subject: [PATCH] vc4: Clear unused infoframe packet RAM registers
6 Using a hdmi analyser the bytes in packet ram
7 registers beyond the length were visible in the
8 infoframes and it flagged the checksum as invalid.
10 Zeroing unused words of packet RAM avoids this
12 Signed-off-by: Dom Cobley <popcornmix@gmail.com>
14 drivers/gpu/drm/vc4/vc4_hdmi.c | 11 ++++++++++-
15 1 file changed, 10 insertions(+), 1 deletion(-)
17 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
18 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
19 @@ -436,9 +436,11 @@ static void vc4_hdmi_write_infoframe(str
20 const struct vc4_hdmi_register *ram_packet_start =
21 &vc4_hdmi->variant->registers[HDMI_RAM_PACKET_START];
22 u32 packet_reg = ram_packet_start->offset + VC4_HDMI_PACKET_STRIDE * packet_id;
23 + u32 packet_reg_next = ram_packet_start->offset +
24 + VC4_HDMI_PACKET_STRIDE * (packet_id + 1);
25 void __iomem *base = __vc4_hdmi_get_field_base(vc4_hdmi,
26 ram_packet_start->reg);
27 - uint8_t buffer[VC4_HDMI_PACKET_STRIDE];
28 + uint8_t buffer[VC4_HDMI_PACKET_STRIDE] = {};
32 @@ -474,6 +476,13 @@ static void vc4_hdmi_write_infoframe(str
37 + * clear remainder of packet ram as it's included in the
38 + * infoframe and triggers a checksum error on hdmi analyser
40 + for (; packet_reg < packet_reg_next; packet_reg += 4)
41 + writel(0, base + packet_reg);
43 HDMI_WRITE(HDMI_RAM_PACKET_CONFIG,
44 HDMI_READ(HDMI_RAM_PACKET_CONFIG) | BIT(packet_id));