Commit 77f06c86 authored by Ander Conselvan de Oliveira's avatar Ander Conselvan de Oliveira Committed by Daniel Vetter

drm/i915: Don't depend on encoder->new_crtc in intel_hdmi_compute_config

Move towards atomic by using the legacy modeset's drm_atomic_state
instead.
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 84556d58
...@@ -951,19 +951,30 @@ intel_hdmi_mode_valid(struct drm_connector *connector, ...@@ -951,19 +951,30 @@ intel_hdmi_mode_valid(struct drm_connector *connector,
return MODE_OK; return MODE_OK;
} }
static bool hdmi_12bpc_possible(struct intel_crtc *crtc) static bool hdmi_12bpc_possible(struct intel_crtc_state *crtc_state)
{ {
struct drm_device *dev = crtc->base.dev; struct drm_device *dev = crtc_state->base.crtc->dev;
struct drm_atomic_state *state;
struct intel_encoder *encoder; struct intel_encoder *encoder;
struct drm_connector_state *connector_state;
int count = 0, count_hdmi = 0; int count = 0, count_hdmi = 0;
int i;
if (HAS_GMCH_DISPLAY(dev)) if (HAS_GMCH_DISPLAY(dev))
return false; return false;
for_each_intel_encoder(dev, encoder) { state = crtc_state->base.state;
if (encoder->new_crtc != crtc)
for (i = 0; i < state->num_connector; i++) {
if (!state->connectors[i])
continue; continue;
connector_state = state->connector_states[i];
if (connector_state->crtc != crtc_state->base.crtc)
continue;
encoder = to_intel_encoder(connector_state->best_encoder);
count_hdmi += encoder->type == INTEL_OUTPUT_HDMI; count_hdmi += encoder->type == INTEL_OUTPUT_HDMI;
count++; count++;
} }
...@@ -1020,7 +1031,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder, ...@@ -1020,7 +1031,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
*/ */
if (pipe_config->pipe_bpp > 8*3 && pipe_config->has_hdmi_sink && if (pipe_config->pipe_bpp > 8*3 && pipe_config->has_hdmi_sink &&
clock_12bpc <= portclock_limit && clock_12bpc <= portclock_limit &&
hdmi_12bpc_possible(encoder->new_crtc)) { hdmi_12bpc_possible(pipe_config)) {
DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n"); DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n");
desired_bpp = 12*3; desired_bpp = 12*3;
......
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