Commit e86e8947 authored by Hans Verkuil's avatar Hans Verkuil

drm/amdgpu: add DisplayPort CEC-Tunneling-over-AUX support

Add DisplayPort CEC-Tunneling-over-AUX support to amdgpu.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/de9586bb-151e-bae9-b8e3-14db107a60df@xs4all.nl
parent 46094b2b
...@@ -896,6 +896,7 @@ amdgpu_dm_update_connector_after_detect(struct amdgpu_dm_connector *aconnector) ...@@ -896,6 +896,7 @@ amdgpu_dm_update_connector_after_detect(struct amdgpu_dm_connector *aconnector)
aconnector->dc_sink = sink; aconnector->dc_sink = sink;
if (sink->dc_edid.length == 0) { if (sink->dc_edid.length == 0) {
aconnector->edid = NULL; aconnector->edid = NULL;
drm_dp_cec_unset_edid(&aconnector->dm_dp_aux.aux);
} else { } else {
aconnector->edid = aconnector->edid =
(struct edid *) sink->dc_edid.raw_edid; (struct edid *) sink->dc_edid.raw_edid;
...@@ -903,10 +904,13 @@ amdgpu_dm_update_connector_after_detect(struct amdgpu_dm_connector *aconnector) ...@@ -903,10 +904,13 @@ amdgpu_dm_update_connector_after_detect(struct amdgpu_dm_connector *aconnector)
drm_connector_update_edid_property(connector, drm_connector_update_edid_property(connector,
aconnector->edid); aconnector->edid);
drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux,
aconnector->edid);
} }
amdgpu_dm_add_sink_to_freesync_module(connector, aconnector->edid); amdgpu_dm_add_sink_to_freesync_module(connector, aconnector->edid);
} else { } else {
drm_dp_cec_unset_edid(&aconnector->dm_dp_aux.aux);
amdgpu_dm_remove_sink_from_freesync_module(connector); amdgpu_dm_remove_sink_from_freesync_module(connector);
drm_connector_update_edid_property(connector, NULL); drm_connector_update_edid_property(connector, NULL);
aconnector->num_modes = 0; aconnector->num_modes = 0;
...@@ -1061,8 +1065,10 @@ static void handle_hpd_rx_irq(void *param) ...@@ -1061,8 +1065,10 @@ static void handle_hpd_rx_irq(void *param)
(dc_link->type == dc_connection_mst_branch)) (dc_link->type == dc_connection_mst_branch))
dm_handle_hpd_rx_irq(aconnector); dm_handle_hpd_rx_irq(aconnector);
if (dc_link->type != dc_connection_mst_branch) if (dc_link->type != dc_connection_mst_branch) {
drm_dp_cec_irq(&aconnector->dm_dp_aux.aux);
mutex_unlock(&aconnector->hpd_lock); mutex_unlock(&aconnector->hpd_lock);
}
} }
static void register_hpd_handlers(struct amdgpu_device *adev) static void register_hpd_handlers(struct amdgpu_device *adev)
...@@ -2731,6 +2737,7 @@ static void amdgpu_dm_connector_destroy(struct drm_connector *connector) ...@@ -2731,6 +2737,7 @@ static void amdgpu_dm_connector_destroy(struct drm_connector *connector)
dm->backlight_dev = NULL; dm->backlight_dev = NULL;
} }
#endif #endif
drm_dp_cec_unregister_connector(&aconnector->dm_dp_aux.aux);
drm_connector_unregister(connector); drm_connector_unregister(connector);
drm_connector_cleanup(connector); drm_connector_cleanup(connector);
kfree(connector); kfree(connector);
......
...@@ -496,6 +496,8 @@ void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm, ...@@ -496,6 +496,8 @@ void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm,
aconnector->dm_dp_aux.ddc_service = aconnector->dc_link->ddc; aconnector->dm_dp_aux.ddc_service = aconnector->dc_link->ddc;
drm_dp_aux_register(&aconnector->dm_dp_aux.aux); drm_dp_aux_register(&aconnector->dm_dp_aux.aux);
drm_dp_cec_register_connector(&aconnector->dm_dp_aux.aux,
aconnector->base.name, dm->adev->dev);
aconnector->mst_mgr.cbs = &dm_mst_cbs; aconnector->mst_mgr.cbs = &dm_mst_cbs;
drm_dp_mst_topology_mgr_init( drm_dp_mst_topology_mgr_init(
&aconnector->mst_mgr, &aconnector->mst_mgr,
......
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