Commit 0b901879 authored by Ander Conselvan de Oliveira's avatar Ander Conselvan de Oliveira Committed by Daniel Vetter

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: default avatarAnder 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: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 944b0c76
...@@ -10538,8 +10538,11 @@ intel_modeset_pipe_config(struct drm_crtc *crtc, ...@@ -10538,8 +10538,11 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct intel_encoder *encoder; struct intel_encoder *encoder;
struct intel_connector *connector;
struct drm_connector_state *connector_state;
struct intel_crtc_state *pipe_config; struct intel_crtc_state *pipe_config;
int plane_bpp, ret = -EINVAL; int plane_bpp, ret = -EINVAL;
int i;
bool retry = true; bool retry = true;
if (!check_encoder_cloning(to_intel_crtc(crtc))) { if (!check_encoder_cloning(to_intel_crtc(crtc))) {
...@@ -10613,11 +10616,17 @@ intel_modeset_pipe_config(struct drm_crtc *crtc, ...@@ -10613,11 +10616,17 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
* adjust it according to limitations or connector properties, and also * adjust it according to limitations or connector properties, and also
* a chance to reject the mode entirely. * a chance to reject the mode entirely.
*/ */
for_each_intel_encoder(dev, encoder) { for (i = 0; i < state->num_connector; i++) {
connector = to_intel_connector(state->connectors[i]);
if (!connector)
continue;
if (&encoder->new_crtc->base != crtc) connector_state = state->connector_states[i];
if (connector_state->crtc != crtc)
continue; continue;
encoder = to_intel_encoder(connector_state->best_encoder);
if (!(encoder->compute_config(encoder, pipe_config))) { if (!(encoder->compute_config(encoder, pipe_config))) {
DRM_DEBUG_KMS("Encoder config failure\n"); DRM_DEBUG_KMS("Encoder config failure\n");
goto fail; goto fail;
...@@ -11339,6 +11348,11 @@ intel_modeset_compute_config(struct drm_crtc *crtc, ...@@ -11339,6 +11348,11 @@ intel_modeset_compute_config(struct drm_crtc *crtc,
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct intel_crtc_state *pipe_config = NULL; struct intel_crtc_state *pipe_config = NULL;
struct intel_crtc *intel_crtc; struct intel_crtc *intel_crtc;
int ret = 0;
ret = drm_atomic_add_affected_connectors(state, crtc);
if (ret)
return ERR_PTR(ret);
intel_modeset_affected_pipes(crtc, modeset_pipes, intel_modeset_affected_pipes(crtc, modeset_pipes,
prepare_pipes, disable_pipes); prepare_pipes, disable_pipes);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment