bbe81baa156b30c224f91450cc57e1b4c7f4ebda
[openwrt/openwrt.git] /
1 From a1bf3abe0c1093e81e5dd59b6d3b09b9ebb3a17d Mon Sep 17 00:00:00 2001
2 From: Matthias Reichl <hias@horus.com>
3 Date: Thu, 30 Dec 2021 14:28:37 +0100
4 Subject: [PATCH] drm/vc4: hdmi: Fix HDMI monitor detection in polled
5 mode
6
7 When vc4_hdmi_connector_detect() was called in
8 connector_status_connected state it incorrectly cleared the
9 hdmi_monitor flag, leading to no audio on RPi3.
10
11 Fix this by clearing hdmi_monitor only when the hpd check
12 indicated no connection or if reading the edid failed.
13
14 Signed-off-by: Matthias Reichl <hias@horus.com>
15 ---
16 drivers/gpu/drm/vc4/vc4_hdmi.c | 5 ++++-
17 1 file changed, 4 insertions(+), 1 deletion(-)
18
19 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
20 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
21 @@ -242,7 +242,6 @@ vc4_hdmi_connector_detect(struct drm_con
22 connected = true;
23 }
24
25 - vc4_hdmi->encoder.hdmi_monitor = false;
26 if (connected) {
27 if (connector->status != connector_status_connected) {
28 struct edid *edid = drm_get_edid(connector, vc4_hdmi->ddc);
29 @@ -251,6 +250,8 @@ vc4_hdmi_connector_detect(struct drm_con
30 cec_s_phys_addr_from_edid(vc4_hdmi->cec_adap, edid);
31 vc4_hdmi->encoder.hdmi_monitor = drm_detect_hdmi_monitor(edid);
32 kfree(edid);
33 + } else {
34 + vc4_hdmi->encoder.hdmi_monitor = false;
35 }
36 }
37
38 @@ -260,6 +261,8 @@ vc4_hdmi_connector_detect(struct drm_con
39 return connector_status_connected;
40 }
41
42 + vc4_hdmi->encoder.hdmi_monitor = false;
43 +
44 cec_phys_addr_invalidate(vc4_hdmi->cec_adap);
45 pm_runtime_put(&vc4_hdmi->pdev->dev);
46 mutex_unlock(&vc4_hdmi->mutex);