diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-05-30 16:53:43 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2018-09-03 16:13:29 +0300 |
commit | f006325cdc8008b015b47d830bce072adf40f313 (patch) | |
tree | 1ed76c5e17d433f6c3f02ff1814d05eb950649eb /drivers/gpu/drm/omapdrm/omap_connector.c | |
parent | 18412b667c96d1a5210f33191e128866a72cea07 (diff) | |
download | linux-f006325cdc8008b015b47d830bce072adf40f313.tar.gz linux-f006325cdc8008b015b47d830bce072adf40f313.tar.bz2 linux-f006325cdc8008b015b47d830bce072adf40f313.zip |
drm/omap: Move HPD disconnection handling to omap_connector
On HDMI outputs, CEC support requires notification of HPD signal
deassertion. The HPD signal can be handled by various omap_dss_device
instances in the pipeline, and all of them forward HPD events to the
OMAP4 internal HDMI encoder.
Knowledge of the DSS internals need to be removed from the
omap_dss_device instances in order to migrate to drm_bridge. To do so,
move HPD handling for CEC to the omap_connector.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_connector.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_connector.c | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c index e77427d81eb9..344414ef3962 100644 --- a/drivers/gpu/drm/omapdrm/omap_connector.c +++ b/drivers/gpu/drm/omapdrm/omap_connector.c @@ -34,6 +34,22 @@ struct omap_connector { bool hdmi_mode; }; +static void omap_connector_hpd_notify(struct drm_connector *connector, + struct omap_dss_device *src, + enum drm_connector_status status) +{ + if (status == connector_status_disconnected) { + /* + * If the source is an HDMI encoder, notify it of disconnection. + * This is required to let the HDMI encoder reset any internal + * state related to connection status, such as the CEC address. + */ + if (src && src->type == OMAP_DISPLAY_TYPE_HDMI && + src->ops->hdmi.lost_hotplug) + src->ops->hdmi.lost_hotplug(src); + } +} + static void omap_connector_hpd_cb(void *cb_data, enum drm_connector_status status) { @@ -47,8 +63,12 @@ static void omap_connector_hpd_cb(void *cb_data, connector->status = status; mutex_unlock(&dev->mode_config.mutex); - if (old_status != status) - drm_kms_helper_hotplug_event(dev); + if (old_status == status) + return; + + omap_connector_hpd_notify(connector, omap_connector->hpd, status); + + drm_kms_helper_hotplug_event(dev); } void omap_connector_enable_hpd(struct drm_connector *connector) @@ -103,10 +123,11 @@ static enum drm_connector_status omap_connector_detect( OMAP_DSS_DEVICE_OP_DETECT); if (dssdev) { - if (dssdev->ops->detect(dssdev)) - status = connector_status_connected; - else - status = connector_status_disconnected; + status = dssdev->ops->detect(dssdev) + ? connector_status_connected + : connector_status_disconnected; + + omap_connector_hpd_notify(connector, dssdev->src, status); } else { switch (omap_connector->dssdev->type) { case OMAP_DISPLAY_TYPE_DPI: |