aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_dp_mst.c
diff options
context:
space:
mode:
authorPandiyan, Dhinakaran <dhinakaran.pandiyan@intel.com>2017-03-16 03:10:26 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-03-22 16:47:44 -0400
commit1e797f556c616a42f1e039b1ff1d3c58f61b6104 (patch)
treeea9ece0eeb34cfd1a0392faa0b5b680fa8c7df1c /drivers/gpu/drm/i915/intel_dp_mst.c
parentfeb2c3bc331576ed4e0bf9608966351b1bb9b622 (diff)
drm/dp: Split drm_dp_mst_allocate_vcpi
drm_dp_mst_allocate_vcpi() apart from setting up the vcpi structure, also finds if there are enough slots available. This check is a duplicate of that implemented in drm_dp_mst_find_vcpi_slots(). Let's move this check out and reuse the existing drm_dp_mst_find_vcpi_slots() function to check if there are enough vcpi slots before allocating them. This brings the check to one place. Additionally drivers that will use MST state tracking for atomic modesets can use the atomic version of find_vcpi_slots() and reuse drm_dp_mst_allocate_vcpi() Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1489648231-30700-4-git-send-email-dhinakaran.pandiyan@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp_mst.c')
-rw-r--r--drivers/gpu/drm/i915/intel_dp_mst.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 38e3ca2f6f18..f51574f7f160 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -147,7 +147,6 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
147 to_intel_connector(conn_state->connector); 147 to_intel_connector(conn_state->connector);
148 int ret; 148 int ret;
149 uint32_t temp; 149 uint32_t temp;
150 int slots;
151 150
152 /* MST encoders are bound to a crtc, not to a connector, 151 /* MST encoders are bound to a crtc, not to a connector,
153 * force the mapping here for get_hw_state. 152 * force the mapping here for get_hw_state.
@@ -177,7 +176,8 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
177 176
178 ret = drm_dp_mst_allocate_vcpi(&intel_dp->mst_mgr, 177 ret = drm_dp_mst_allocate_vcpi(&intel_dp->mst_mgr,
179 connector->port, 178 connector->port,
180 pipe_config->pbn, &slots); 179 pipe_config->pbn,
180 pipe_config->dp_m_n.tu);
181 if (ret == false) { 181 if (ret == false) {
182 DRM_ERROR("failed to allocate vcpi\n"); 182 DRM_ERROR("failed to allocate vcpi\n");
183 return; 183 return;