diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-05-30 09:53:43 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2018-09-03 09:13:29 -0400 |
commit | f006325cdc8008b015b47d830bce072adf40f313 (patch) | |
tree | 1ed76c5e17d433f6c3f02ff1814d05eb950649eb /drivers/gpu/drm/omapdrm/omap_connector.c | |
parent | 18412b667c96d1a5210f33191e128866a72cea07 (diff) |
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 { | |||
34 | bool hdmi_mode; | 34 | bool hdmi_mode; |
35 | }; | 35 | }; |
36 | 36 | ||
37 | static void omap_connector_hpd_notify(struct drm_connector *connector, | ||
38 | struct omap_dss_device *src, | ||
39 | enum drm_connector_status status) | ||
40 | { | ||
41 | if (status == connector_status_disconnected) { | ||
42 | /* | ||
43 | * If the source is an HDMI encoder, notify it of disconnection. | ||
44 | * This is required to let the HDMI encoder reset any internal | ||
45 | * state related to connection status, such as the CEC address. | ||
46 | */ | ||
47 | if (src && src->type == OMAP_DISPLAY_TYPE_HDMI && | ||
48 | src->ops->hdmi.lost_hotplug) | ||
49 | src->ops->hdmi.lost_hotplug(src); | ||
50 | } | ||
51 | } | ||
52 | |||
37 | static void omap_connector_hpd_cb(void *cb_data, | 53 | static void omap_connector_hpd_cb(void *cb_data, |
38 | enum drm_connector_status status) | 54 | enum drm_connector_status status) |
39 | { | 55 | { |
@@ -47,8 +63,12 @@ static void omap_connector_hpd_cb(void *cb_data, | |||
47 | connector->status = status; | 63 | connector->status = status; |
48 | mutex_unlock(&dev->mode_config.mutex); | 64 | mutex_unlock(&dev->mode_config.mutex); |
49 | 65 | ||
50 | if (old_status != status) | 66 | if (old_status == status) |
51 | drm_kms_helper_hotplug_event(dev); | 67 | return; |
68 | |||
69 | omap_connector_hpd_notify(connector, omap_connector->hpd, status); | ||
70 | |||
71 | drm_kms_helper_hotplug_event(dev); | ||
52 | } | 72 | } |
53 | 73 | ||
54 | void omap_connector_enable_hpd(struct drm_connector *connector) | 74 | void omap_connector_enable_hpd(struct drm_connector *connector) |
@@ -103,10 +123,11 @@ static enum drm_connector_status omap_connector_detect( | |||
103 | OMAP_DSS_DEVICE_OP_DETECT); | 123 | OMAP_DSS_DEVICE_OP_DETECT); |
104 | 124 | ||
105 | if (dssdev) { | 125 | if (dssdev) { |
106 | if (dssdev->ops->detect(dssdev)) | 126 | status = dssdev->ops->detect(dssdev) |
107 | status = connector_status_connected; | 127 | ? connector_status_connected |
108 | else | 128 | : connector_status_disconnected; |
109 | status = connector_status_disconnected; | 129 | |
130 | omap_connector_hpd_notify(connector, dssdev->src, status); | ||
110 | } else { | 131 | } else { |
111 | switch (omap_connector->dssdev->type) { | 132 | switch (omap_connector->dssdev->type) { |
112 | case OMAP_DISPLAY_TYPE_DPI: | 133 | case OMAP_DISPLAY_TYPE_DPI: |