From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com ([134.134.136.20]:25902 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751481AbbLVM36 convert rfc822-to-8bit (ORCPT ); Tue, 22 Dec 2015 07:29:58 -0500 From: Jani Nikula To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org Cc: stable@vger.kernel.org, Ander Conselvan de Oliveira Subject: Re: [PATCH v2] drm/i915: Unbreak check_digital_port_conflicts() In-Reply-To: <1449764551-12466-1-git-send-email-ville.syrjala@linux.intel.com> References: <1449522800-25281-1-git-send-email-ville.syrjala@linux.intel.com> <1449764551-12466-1-git-send-email-ville.syrjala@linux.intel.com> Date: Tue, 22 Dec 2015 14:29:55 +0200 Message-ID: <87egee64zg.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: stable-owner@vger.kernel.org List-ID: On Thu, 10 Dec 2015, ville.syrjala@linux.intel.com wrote: > From: Ville Syrjälä > > 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... > > v2: Regenerate the patch so that it actually applies (Jani) > > Cc: stable@vger.kernel.org > Cc: Ander Conselvan de Oliveira > Fixes: 5448a00d3f06 ("drm/i915: Don't use staged config in check_digital_port_conflicts()") > Signed-off-by: Ville Syrjälä > Reviewed-by: Daniel Vetter Pushed to drm-intel-next-queued, thanks for the patch and review. BR, Jani. > --- > drivers/gpu/drm/i915/intel_display.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > index 930661de11ff..10974424bdfa 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -12260,18 +12260,22 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc, > static bool check_digital_port_conflicts(struct drm_atomic_state *state) > { > struct drm_device *dev = state->dev; > - struct intel_encoder *encoder; > struct drm_connector *connector; > - struct drm_connector_state *connector_state; > unsigned int used_ports = 0; > - int i; > > /* > * 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 = drm_atomic_get_existing_connector_state(state, connector); > + if (!connector_state) > + connector_state = connector->state; > + > if (!connector_state->best_encoder) > continue; -- Jani Nikula, Intel Open Source Technology Center