[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240908132823.3308029-8-jonas@kwiboo.se>
Date: Sun, 8 Sep 2024 13:28:09 +0000
From: Jonas Karlman <jonas@...boo.se>
To: Andrzej Hajda <andrzej.hajda@...el.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
Robert Foss <rfoss@...nel.org>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...il.com>
Cc: Christian Hewitt <christianshewitt@...il.com>,
Diederik de Haas <didi.debian@...ow.org>,
Christopher Obbard <chris.obbard@...labora.com>,
dri-devel@...ts.freedesktop.org,
linux-rockchip@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 07/10] drm: bridge: dw_hdmi: Invalidate CEC phys addr from connector detect
Wait until the connector detect ops is called to invalidate CEC phys
addr instead of doing it directly from the irq handler.
Reviewed-by: Neil Armstrong <neil.armstrong@...aro.org>
Signed-off-by: Jonas Karlman <jonas@...boo.se>
---
v2: Collect r-b tag
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 6a94376a3da3..8ec97babd334 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -2454,7 +2454,17 @@ dw_hdmi_connector_detect(struct drm_connector *connector, bool force)
{
struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi,
connector);
- return dw_hdmi_detect(hdmi);
+ enum drm_connector_status status;
+
+ status = dw_hdmi_detect(hdmi);
+
+ if (status == connector_status_disconnected) {
+ mutex_lock(&hdmi->cec_notifier_mutex);
+ cec_notifier_phys_addr_invalidate(hdmi->cec_notifier);
+ mutex_unlock(&hdmi->cec_notifier_mutex);
+ }
+
+ return status;
}
static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
@@ -3065,12 +3075,6 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id)
phy_stat & HDMI_PHY_HPD,
phy_stat & HDMI_PHY_RX_SENSE);
- if ((phy_stat & (HDMI_PHY_RX_SENSE | HDMI_PHY_HPD)) == 0) {
- mutex_lock(&hdmi->cec_notifier_mutex);
- cec_notifier_phys_addr_invalidate(hdmi->cec_notifier);
- mutex_unlock(&hdmi->cec_notifier_mutex);
- }
-
if ((intr_stat & HDMI_IH_PHY_STAT0_HPD) &&
(phy_stat & HDMI_PHY_HPD))
status = connector_status_connected;
--
2.46.0
Powered by blists - more mailing lists