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
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.
11 Fix this by clearing hdmi_monitor only when the hpd check
12 indicated no connection or if reading the edid failed.
14 Signed-off-by: Matthias Reichl <hias@horus.com>
16 drivers/gpu/drm/vc4/vc4_hdmi.c | 5 ++++-
17 1 file changed, 4 insertions(+), 1 deletion(-)
19 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
20 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
21 @@ -243,7 +243,6 @@ vc4_hdmi_connector_detect(struct drm_con
25 - vc4_hdmi->encoder.hdmi_monitor = false;
27 if (connector->status != connector_status_connected) {
28 struct edid *edid = drm_get_edid(connector, vc4_hdmi->ddc);
29 @@ -252,6 +251,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);
34 + vc4_hdmi->encoder.hdmi_monitor = false;
38 @@ -261,6 +262,8 @@ vc4_hdmi_connector_detect(struct drm_con
39 return connector_status_connected;
42 + vc4_hdmi->encoder.hdmi_monitor = false;
44 cec_phys_addr_invalidate(vc4_hdmi->cec_adap);
45 pm_runtime_put(&vc4_hdmi->pdev->dev);
46 mutex_unlock(&vc4_hdmi->mutex);