drm/amd/display: Drop reusing drm connector for MST
authorJerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
Tue, 30 Oct 2018 18:37:16 +0000 (14:37 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Nov 2018 15:13:05 +0000 (16:13 +0100)
commitb3db5d74b933a39267004bcb4c6bc619b9c96d3d
tree457a22258128366d60213692be15d8a358d983d2
parenta4da95ea101b2741488c6d84d3ce6e3d0cdffd62
drm/amd/display: Drop reusing drm connector for MST

[ Upstream commit 0e6613e46fed29316f33acf86e1d1568288638b5 ]

[why]
It is not safe to keep existing connector while entire topology
has been removed. Could lead potential impact to uapi.
Entirely unregister all the connectors on the topology,
and use a new set of connectors when the topology is plugged back
on.

[How]
Remove the drm connector entirely each time when the
corresponding MST topology is gone.
When hotunplug a connector (e.g., DP2)
1. Remove connector from userspace.
2. Drop it's reference.
When hotplug back on:
1. Detect new topology, and create new connectors.
2. Notify userspace with sysfs hotplug event.
3. Reprobe new connectors, and reassign CRTC from old (e.g., DP2)
to new (e.g., DP3) connector.

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c