Commit 4f8a65de authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Greg Kroah-Hartman

drm/omap: Notify all devices in the pipeline of output disconnection

[ Upstream commit 27a7e3e1 ]

For HDMI pipelines, when the output gets disconnected the device
handling CEC needs to be notified. Instead of guessing which device that
would be (and sometimes getting it wrong), notify all devices in the
pipeline.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Tested-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent c3bb5b0f
...@@ -36,18 +36,22 @@ struct omap_connector { ...@@ -36,18 +36,22 @@ struct omap_connector {
}; };
static void omap_connector_hpd_notify(struct drm_connector *connector, static void omap_connector_hpd_notify(struct drm_connector *connector,
struct omap_dss_device *src,
enum drm_connector_status status) enum drm_connector_status status)
{ {
if (status == connector_status_disconnected) { struct omap_connector *omap_connector = to_omap_connector(connector);
/* struct omap_dss_device *dssdev;
* If the source is an HDMI encoder, notify it of disconnection.
* This is required to let the HDMI encoder reset any internal if (status != connector_status_disconnected)
* state related to connection status, such as the CEC address. return;
*/
if (src && src->type == OMAP_DISPLAY_TYPE_HDMI && /*
src->ops->hdmi.lost_hotplug) * Notify all devics in the pipeline of disconnection. This is required
src->ops->hdmi.lost_hotplug(src); * to let the HDMI encoders reset their internal state related to
* connection status, such as the CEC address.
*/
for (dssdev = omap_connector->output; dssdev; dssdev = dssdev->next) {
if (dssdev->ops && dssdev->ops->hdmi.lost_hotplug)
dssdev->ops->hdmi.lost_hotplug(dssdev);
} }
} }
...@@ -67,7 +71,7 @@ static void omap_connector_hpd_cb(void *cb_data, ...@@ -67,7 +71,7 @@ static void omap_connector_hpd_cb(void *cb_data,
if (old_status == status) if (old_status == status)
return; return;
omap_connector_hpd_notify(connector, omap_connector->hpd, status); omap_connector_hpd_notify(connector, status);
drm_kms_helper_hotplug_event(dev); drm_kms_helper_hotplug_event(dev);
} }
...@@ -128,7 +132,7 @@ static enum drm_connector_status omap_connector_detect( ...@@ -128,7 +132,7 @@ static enum drm_connector_status omap_connector_detect(
? connector_status_connected ? connector_status_connected
: connector_status_disconnected; : connector_status_disconnected;
omap_connector_hpd_notify(connector, dssdev->src, status); omap_connector_hpd_notify(connector, status);
} else { } else {
switch (omap_connector->display->type) { switch (omap_connector->display->type) {
case OMAP_DISPLAY_TYPE_DPI: case OMAP_DISPLAY_TYPE_DPI:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment