aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>2015-03-20 10:18:08 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-03-26 12:49:52 -0400
commit0b9018793939970aad49e4e0ed21f0fd0db74e4a (patch)
tree9847655f9d393046a8ba7285915cc8b20326014b /drivers/gpu/drm/i915
parent944b0c76575753da5a332aab0a1d8c6df65a076b (diff)
drm/i915: Don't use encoder->new_crtc in intel_modeset_pipe_config()
Move towards atomic by using the legacy modeset's drm_atomic_state instead. v2: Move call to drm_atomic_add_affected_connectors() to intel_modeset_compute_config(). (Daniel) Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> [danvet: Resurrect the ret local variable which I've dropped from an earlier patch and which is now needed.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index c0fa9df51008..afceb5836af7 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -10538,8 +10538,11 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
10538{ 10538{
10539 struct drm_device *dev = crtc->dev; 10539 struct drm_device *dev = crtc->dev;
10540 struct intel_encoder *encoder; 10540 struct intel_encoder *encoder;
10541 struct intel_connector *connector;
10542 struct drm_connector_state *connector_state;
10541 struct intel_crtc_state *pipe_config; 10543 struct intel_crtc_state *pipe_config;
10542 int plane_bpp, ret = -EINVAL; 10544 int plane_bpp, ret = -EINVAL;
10545 int i;
10543 bool retry = true; 10546 bool retry = true;
10544 10547
10545 if (!check_encoder_cloning(to_intel_crtc(crtc))) { 10548 if (!check_encoder_cloning(to_intel_crtc(crtc))) {
@@ -10613,11 +10616,17 @@ encoder_retry:
10613 * adjust it according to limitations or connector properties, and also 10616 * adjust it according to limitations or connector properties, and also
10614 * a chance to reject the mode entirely. 10617 * a chance to reject the mode entirely.
10615 */ 10618 */
10616 for_each_intel_encoder(dev, encoder) { 10619 for (i = 0; i < state->num_connector; i++) {
10620 connector = to_intel_connector(state->connectors[i]);
10621 if (!connector)
10622 continue;
10617 10623
10618 if (&encoder->new_crtc->base != crtc) 10624 connector_state = state->connector_states[i];
10625 if (connector_state->crtc != crtc)
10619 continue; 10626 continue;
10620 10627
10628 encoder = to_intel_encoder(connector_state->best_encoder);
10629
10621 if (!(encoder->compute_config(encoder, pipe_config))) { 10630 if (!(encoder->compute_config(encoder, pipe_config))) {
10622 DRM_DEBUG_KMS("Encoder config failure\n"); 10631 DRM_DEBUG_KMS("Encoder config failure\n");
10623 goto fail; 10632 goto fail;
@@ -11339,6 +11348,11 @@ intel_modeset_compute_config(struct drm_crtc *crtc,
11339 struct drm_device *dev = crtc->dev; 11348 struct drm_device *dev = crtc->dev;
11340 struct intel_crtc_state *pipe_config = NULL; 11349 struct intel_crtc_state *pipe_config = NULL;
11341 struct intel_crtc *intel_crtc; 11350 struct intel_crtc *intel_crtc;
11351 int ret = 0;
11352
11353 ret = drm_atomic_add_affected_connectors(state, crtc);
11354 if (ret)
11355 return ERR_PTR(ret);
11342 11356
11343 intel_modeset_affected_pipes(crtc, modeset_pipes, 11357 intel_modeset_affected_pipes(crtc, modeset_pipes,
11344 prepare_pipes, disable_pipes); 11358 prepare_pipes, disable_pipes);