aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_dp_mst_topology.c
diff options
context:
space:
mode:
authorLyude Paul <lyude@redhat.com>2019-02-01 19:20:02 -0500
committerLyude Paul <lyude@redhat.com>2019-02-05 18:09:00 -0500
commita3d15c4b0ecd169c77dfdf659b2ff2e502179d19 (patch)
tree2768332a7e28cfe287320b77ef711b82c83feec6 /drivers/gpu/drm/drm_dp_mst_topology.c
parent3a8844c298522fa22df4bdd863011e5b639a4e84 (diff)
drm/dp_mst: Remove port validation in drm_dp_atomic_find_vcpi_slots()
Since we now have an easy way of refcounting drm_dp_mst_port structs and safely accessing their contents, there isn't any good reason to keep validating ports here. It doesn't prevent us from performing modesets on branch devices that have been removed either, and we already disallow enabling new displays on unregistered connectors in update_connector_routing() in drm_atomic_check_modeset(). All it does is cause us to have to make weird special exceptions in our atomic modesetting code. So, get rid of it entirely. Signed-off-by: Lyude Paul <lyude@redhat.com> Fixes: eceae1472467 ("drm/dp_mst: Start tracking per-port VCPI allocations") Reviewed-by: Daniel Vetter <daniel@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20190202002023.29665-3-lyude@redhat.com
Diffstat (limited to 'drivers/gpu/drm/drm_dp_mst_topology.c')
-rw-r--r--drivers/gpu/drm/drm_dp_mst_topology.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index db0fdc513b9c..dc7ac0c60547 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -3117,10 +3117,6 @@ int drm_dp_atomic_find_vcpi_slots(struct drm_atomic_state *state,
3117 if (IS_ERR(topology_state)) 3117 if (IS_ERR(topology_state))
3118 return PTR_ERR(topology_state); 3118 return PTR_ERR(topology_state);
3119 3119
3120 port = drm_dp_mst_topology_get_port_validated(mgr, port);
3121 if (port == NULL)
3122 return -EINVAL;
3123
3124 /* Find the current allocation for this port, if any */ 3120 /* Find the current allocation for this port, if any */
3125 list_for_each_entry(pos, &topology_state->vcpis, next) { 3121 list_for_each_entry(pos, &topology_state->vcpis, next) {
3126 if (pos->port == port) { 3122 if (pos->port == port) {
@@ -3153,10 +3149,8 @@ int drm_dp_atomic_find_vcpi_slots(struct drm_atomic_state *state,
3153 /* Add the new allocation to the state */ 3149 /* Add the new allocation to the state */
3154 if (!vcpi) { 3150 if (!vcpi) {
3155 vcpi = kzalloc(sizeof(*vcpi), GFP_KERNEL); 3151 vcpi = kzalloc(sizeof(*vcpi), GFP_KERNEL);
3156 if (!vcpi) { 3152 if (!vcpi)
3157 ret = -ENOMEM; 3153 return -ENOMEM;
3158 goto out;
3159 }
3160 3154
3161 drm_dp_mst_get_port_malloc(port); 3155 drm_dp_mst_get_port_malloc(port);
3162 vcpi->port = port; 3156 vcpi->port = port;
@@ -3165,8 +3159,6 @@ int drm_dp_atomic_find_vcpi_slots(struct drm_atomic_state *state,
3165 vcpi->vcpi = req_slots; 3159 vcpi->vcpi = req_slots;
3166 3160
3167 ret = req_slots; 3161 ret = req_slots;
3168out:
3169 drm_dp_mst_topology_put_port(port);
3170 return ret; 3162 return ret;
3171} 3163}
3172EXPORT_SYMBOL(drm_dp_atomic_find_vcpi_slots); 3164EXPORT_SYMBOL(drm_dp_atomic_find_vcpi_slots);