aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>2018-10-30 14:28:49 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-11-07 18:20:49 -0500
commit8be17ac95f8451b51f636622d8d4b8674334f468 (patch)
tree311b08d5d4e7b896687e98e113643e98300c0478
parent108110a3ffa3483d743f3bff93917ba64dc8edd0 (diff)
drm/amd/display: Cleanup MST non-atomic code workaround
[why] It is not correct to touch aconnector within atomic_check. [How] It was added as workaround before, and no longer needed. Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c15
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c34
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h1
3 files changed, 4 insertions, 46 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index d3f5cb1795bf..c1262f62cd9f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2703,18 +2703,11 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
2703 drm_connector = &aconnector->base; 2703 drm_connector = &aconnector->base;
2704 2704
2705 if (!aconnector->dc_sink) { 2705 if (!aconnector->dc_sink) {
2706 /* 2706 if (!aconnector->mst_port) {
2707 * Create dc_sink when necessary to MST 2707 sink = create_fake_sink(aconnector);
2708 * Don't apply fake_sink to MST 2708 if (!sink)
2709 */ 2709 return stream;
2710 if (aconnector->mst_port) {
2711 dm_dp_mst_dc_sink_create(drm_connector);
2712 return stream;
2713 } 2710 }
2714
2715 sink = create_fake_sink(aconnector);
2716 if (!sink)
2717 return stream;
2718 } else { 2711 } else {
2719 sink = aconnector->dc_sink; 2712 sink = aconnector->dc_sink;
2720 } 2713 }
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index 03601d717fed..03e98967d6c2 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -205,40 +205,6 @@ static const struct drm_connector_funcs dm_dp_mst_connector_funcs = {
205 .atomic_get_property = amdgpu_dm_connector_atomic_get_property 205 .atomic_get_property = amdgpu_dm_connector_atomic_get_property
206}; 206};
207 207
208void dm_dp_mst_dc_sink_create(struct drm_connector *connector)
209{
210 struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
211 struct dc_sink *dc_sink;
212 struct dc_sink_init_data init_params = {
213 .link = aconnector->dc_link,
214 .sink_signal = SIGNAL_TYPE_DISPLAY_PORT_MST };
215
216 /* FIXME none of this is safe. we shouldn't touch aconnector here in
217 * atomic_check
218 */
219
220 /*
221 * TODO: Need to further figure out why ddc.algo is NULL while MST port exists
222 */
223 if (!aconnector->port || !aconnector->port->aux.ddc.algo)
224 return;
225
226 ASSERT(aconnector->edid);
227
228 dc_sink = dc_link_add_remote_sink(
229 aconnector->dc_link,
230 (uint8_t *)aconnector->edid,
231 (aconnector->edid->extensions + 1) * EDID_LENGTH,
232 &init_params);
233
234 dc_sink->priv = aconnector;
235 aconnector->dc_sink = dc_sink;
236
237 if (aconnector->dc_sink)
238 amdgpu_dm_update_freesync_caps(
239 connector, aconnector->edid);
240}
241
242static int dm_dp_mst_get_modes(struct drm_connector *connector) 208static int dm_dp_mst_get_modes(struct drm_connector *connector)
243{ 209{
244 struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector); 210 struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h
index 8cf51da26657..2da851b40042 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.h
@@ -31,6 +31,5 @@ struct amdgpu_dm_connector;
31 31
32void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm, 32void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm,
33 struct amdgpu_dm_connector *aconnector); 33 struct amdgpu_dm_connector *aconnector);
34void dm_dp_mst_dc_sink_create(struct drm_connector *connector);
35 34
36#endif 35#endif