aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2015-08-27 07:13:31 -0400
committerJani Nikula <jani.nikula@intel.com>2015-09-08 09:16:50 -0400
commite85376cbd23299e4d40bace0cb5ab867b270fdbd (patch)
tree8d171cd1a671c290e2b7f22162048fd6ef37ac02 /drivers/gpu/drm
parent4e3d1e26c2b2c40ebff69f2825fa862bfcf082d1 (diff)
drm/i915: Fix broken mst get_hw_state.
connector->encoder is initialized as NULL. Fix this by setting it in during pre enable. MST connectors are not read out during initial hw readout, and have no fixed encoder mappings. So it's harmless to return false when the connector has never been assigned to an encoder. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c8
-rw-r--r--drivers/gpu/drm/i915/intel_dp_mst.c7
2 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index ca9278be49f7..8cc9264f7809 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6305,7 +6305,7 @@ static void intel_connector_check_state(struct intel_connector *connector)
6305 connector->base.name); 6305 connector->base.name);
6306 6306
6307 if (connector->get_hw_state(connector)) { 6307 if (connector->get_hw_state(connector)) {
6308 struct drm_encoder *encoder = &connector->encoder->base; 6308 struct intel_encoder *encoder = connector->encoder;
6309 struct drm_connector_state *conn_state = connector->base.state; 6309 struct drm_connector_state *conn_state = connector->base.state;
6310 6310
6311 I915_STATE_WARN(!crtc, 6311 I915_STATE_WARN(!crtc,
@@ -6317,13 +6317,13 @@ static void intel_connector_check_state(struct intel_connector *connector)
6317 I915_STATE_WARN(!crtc->state->active, 6317 I915_STATE_WARN(!crtc->state->active,
6318 "connector is active, but attached crtc isn't\n"); 6318 "connector is active, but attached crtc isn't\n");
6319 6319
6320 if (!encoder) 6320 if (!encoder || encoder->type == INTEL_OUTPUT_DP_MST)
6321 return; 6321 return;
6322 6322
6323 I915_STATE_WARN(conn_state->best_encoder != encoder, 6323 I915_STATE_WARN(conn_state->best_encoder != &encoder->base,
6324 "atomic encoder doesn't match attached encoder\n"); 6324 "atomic encoder doesn't match attached encoder\n");
6325 6325
6326 I915_STATE_WARN(conn_state->crtc != encoder->crtc, 6326 I915_STATE_WARN(conn_state->crtc != encoder->base.crtc,
6327 "attached encoder crtc differs from connector crtc\n"); 6327 "attached encoder crtc differs from connector crtc\n");
6328 } else { 6328 } else {
6329 I915_STATE_WARN(crtc && crtc->state->active, 6329 I915_STATE_WARN(crtc && crtc->state->active,
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 983553cf8b74..3e4be5a3becd 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -173,6 +173,11 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder)
173 return; 173 return;
174 } 174 }
175 175
176 /* MST encoders are bound to a crtc, not to a connector,
177 * force the mapping here for get_hw_state.
178 */
179 found->encoder = encoder;
180
176 DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links); 181 DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links);
177 intel_mst->port = found->port; 182 intel_mst->port = found->port;
178 183
@@ -400,7 +405,7 @@ static const struct drm_encoder_funcs intel_dp_mst_enc_funcs = {
400 405
401static bool intel_dp_mst_get_hw_state(struct intel_connector *connector) 406static bool intel_dp_mst_get_hw_state(struct intel_connector *connector)
402{ 407{
403 if (connector->encoder) { 408 if (connector->encoder && connector->base.state->crtc) {
404 enum pipe pipe; 409 enum pipe pipe;
405 if (!connector->encoder->get_hw_state(connector->encoder, &pipe)) 410 if (!connector->encoder->get_hw_state(connector->encoder, &pipe))
406 return false; 411 return false;