Commit 3165c074 authored by Ander Conselvan de Oliveira's avatar Ander Conselvan de Oliveira Committed by Daniel Vetter

drm/i915: Use atomic state in intel_ddi_crtc_get_new_encoder()

Instead of using connector->new_encoder, get the same information from
the pipe_config, thus making the function ready for the atomic
conversion.
Signed-off-by: default avatarAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 77f06c86
...@@ -492,18 +492,24 @@ intel_ddi_get_crtc_encoder(struct drm_crtc *crtc) ...@@ -492,18 +492,24 @@ intel_ddi_get_crtc_encoder(struct drm_crtc *crtc)
} }
static struct intel_encoder * static struct intel_encoder *
intel_ddi_get_crtc_new_encoder(struct intel_crtc *crtc) intel_ddi_get_crtc_new_encoder(struct intel_crtc_state *crtc_state)
{ {
struct drm_device *dev = crtc->base.dev; struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc);
struct intel_encoder *intel_encoder, *ret = NULL; struct intel_encoder *ret = NULL;
struct drm_atomic_state *state;
int num_encoders = 0; int num_encoders = 0;
int i;
for_each_intel_encoder(dev, intel_encoder) { state = crtc_state->base.state;
if (intel_encoder->new_crtc == crtc) {
ret = intel_encoder; for (i = 0; i < state->num_connector; i++) {
if (!state->connectors[i] ||
state->connector_states[i]->crtc != crtc_state->base.crtc)
continue;
ret = to_intel_encoder(state->connector_states[i]->best_encoder);
num_encoders++; num_encoders++;
} }
}
WARN(num_encoders != 1, "%d encoders on crtc for pipe %c\n", num_encoders, WARN(num_encoders != 1, "%d encoders on crtc for pipe %c\n", num_encoders,
pipe_name(crtc->pipe)); pipe_name(crtc->pipe));
...@@ -1216,7 +1222,7 @@ bool intel_ddi_pll_select(struct intel_crtc *intel_crtc, ...@@ -1216,7 +1222,7 @@ bool intel_ddi_pll_select(struct intel_crtc *intel_crtc,
{ {
struct drm_device *dev = intel_crtc->base.dev; struct drm_device *dev = intel_crtc->base.dev;
struct intel_encoder *intel_encoder = struct intel_encoder *intel_encoder =
intel_ddi_get_crtc_new_encoder(intel_crtc); intel_ddi_get_crtc_new_encoder(crtc_state);
int clock = crtc_state->port_clock; int clock = crtc_state->port_clock;
if (IS_SKYLAKE(dev)) if (IS_SKYLAKE(dev))
......
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