From mboxrd@z Thu Jan 1 00:00:00 1970 From: ville.syrjala@linux.intel.com Subject: [PATCH] drm/i915: Unbreak check_digital_port_conflicts() Date: Mon, 7 Dec 2015 23:13:20 +0200 Message-ID: <1449522800-25281-1-git-send-email-ville.syrjala@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Sender: stable-owner@vger.kernel.org To: intel-gfx@lists.freedesktop.org Cc: stable@vger.kernel.org, Ander Conselvan de Oliveira List-Id: intel-gfx@lists.freedesktop.org =46rom: Ville Syrj=C3=A4l=C3=A4 Atomic changes broke check_digital_port_conflicts(). It needs to look at the global situation instead of just trying to find a conflict within the current atomic state. This bug made my HSW explode spectacularly after I had split the DDI encoders into separate DP and HDMI encoders. With the fix, things seem much more solid. I hope holding the connection_mutex is enough protection that we can actually walk the connectors even if they're not part of the current atomic state... Cc: stable@vger.kernel.org Cc: Ander Conselvan de Oliveira =46ixes: 5448a00d3f06 ("drm/i915: Don't use staged config in check_digi= tal_port_conflicts()") Signed-off-by: Ville Syrj=C3=A4l=C3=A4 --- drivers/gpu/drm/i915/intel_display.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i91= 5/intel_display.c index 1c6d56c84b9d..c902964ceca0 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -12253,18 +12253,23 @@ static void intel_dump_pipe_config(struct int= el_crtc *crtc, =20 static bool check_digital_port_conflicts(struct drm_atomic_state *stat= e) { - struct intel_encoder *encoder; + struct drm_device *dev =3D state->dev; struct drm_connector *connector; - struct drm_connector_state *connector_state; unsigned int used_ports =3D 0; - int i; =20 /* * Walk the connector list instead of the encoder * list to detect the problem on ddi platforms * where there's just one encoder per digital port. */ - for_each_connector_in_state(state, connector, connector_state, i) { + drm_for_each_connector(connector, dev) { + struct drm_connector_state *connector_state; + struct intel_encoder *encoder; + + connector_state =3D drm_atomic_get_existing_connector_state(state, c= onnector); + if (!connector_state) + connector_state =3D connector->state; + if (!connector_state->best_encoder) continue; =20 --=20 2.4.10