public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: ville.syrjala@linux.intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 10/10] drm/i915: Leave FDI running after failed link training on LPT-H
Date: Fri, 4 Dec 2015 11:09:11 +0100	[thread overview]
Message-ID: <20151204100910.GL10243@phenom.ffwll.local> (raw)
In-Reply-To: <1448975321-20192-11-git-send-email-ville.syrjala@linux.intel.com>

On Tue, Dec 01, 2015 at 03:08:41PM +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Currently we disable some parts of FDI setup after a failed link
> training. But despite that we continue with the modeset as if everything
> is fine. This results in tons of noise from the state checker, and
> it means we're not following the proper modeset sequence for the rest of
> crtc enabling, nor for crtc disabling.
> 
> Ideally we should abort the modeset and follow the proper disable
> suquenced to shut off everything we enabled so far, but that would
> require a big rework of the modeset code. So instead just leave FDI
> up and running in its untrained state, and log an error. This is
> what we do on older platforms too.

No, ideally we should light the pipe up and tell userspace through some
uevent that something bad has happened. Especially with async commits
failing to light up the pipe looks to userspace like the kernel just
randomly disabled it. And that usually results in random crashes when the
next flip or vblank wait fails and everything comes crashing down. And
even if we wouldn't -EINVAL these userspace would still have a problem
since the flip or vblank it wants to wait for simply never happens and
then it's just stalled.

We've had tons of problems with this in the past, and therefore removed
all the in-kernel sources for shutting down a pipe. E.g. DP re-training
also forces the pipe to on again, even if it fails.

Yup dp mst is an exception and I need to fix it eventually.

Cheers, Daniel
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 24 +++++++++++++++---------
>  1 file changed, 15 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index 76ce7c2960b6..b312a47a0654 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -675,15 +675,16 @@ void hsw_fdi_link_train(struct drm_crtc *crtc)
>  		temp = I915_READ(DP_TP_STATUS(PORT_E));
>  		if (temp & DP_TP_STATUS_AUTOTRAIN_DONE) {
>  			DRM_DEBUG_KMS("FDI link training done on step %d\n", i);
> +			break;
> +		}
>  
> -			/* Enable normal pixel sending for FDI */
> -			I915_WRITE(DP_TP_CTL(PORT_E),
> -				   DP_TP_CTL_FDI_AUTOTRAIN |
> -				   DP_TP_CTL_LINK_TRAIN_NORMAL |
> -				   DP_TP_CTL_ENHANCED_FRAME_ENABLE |
> -				   DP_TP_CTL_ENABLE);
> -
> -			return;
> +		/*
> +		 * Leave things enabled even if we failed to train FDI.
> +		 * Results in less fireworks from the state checker.
> +		 */
> +		if (i == ARRAY_SIZE(hsw_ddi_translations_fdi) * 2 - 1) {
> +			DRM_ERROR("FDI link training failed!\n");
> +			break;
>  		}
>  
>  		temp = I915_READ(DDI_BUF_CTL(PORT_E));
> @@ -712,7 +713,12 @@ void hsw_fdi_link_train(struct drm_crtc *crtc)
>  		POSTING_READ(FDI_RX_MISC(PIPE_A));
>  	}
>  
> -	DRM_ERROR("FDI link training failed!\n");
> +	/* Enable normal pixel sending for FDI */
> +	I915_WRITE(DP_TP_CTL(PORT_E),
> +		   DP_TP_CTL_FDI_AUTOTRAIN |
> +		   DP_TP_CTL_LINK_TRAIN_NORMAL |
> +		   DP_TP_CTL_ENHANCED_FRAME_ENABLE |
> +		   DP_TP_CTL_ENABLE);
>  }
>  
>  void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder)
> -- 
> 2.4.10
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2015-12-04 10:09 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01 13:08 [PATCH 00/10] HSW/BDW PCH modeset fixes and stuff ville.syrjala
2015-12-01 13:08 ` [PATCH 01/10] drm/i915: Don't register the CRT connector when it's fused off ville.syrjala
2015-12-01 19:05   ` Paulo Zanoni
2015-12-01 19:18     ` Ville Syrjälä
2015-12-01 21:28   ` [PATCH v2 01/10] drm/i915: Don't register the CRT connector when it's fused off on LPT-H ville.syrjala
2015-12-01 13:08 ` [PATCH 02/10] drm/i915: Don't register CRT connectro when DDI E can't be used ville.syrjala
2015-12-01 19:13   ` Paulo Zanoni
2015-12-01 21:29   ` [PATCH v2 02/10] drm/i915: Don't register CRT connector " ville.syrjala
2015-12-01 13:08 ` [PATCH 03/10] drm/i915: Check VBT for CRT port presence on HSW/BDW ville.syrjala
2015-12-01 13:41   ` Chris Wilson
2015-12-01 13:57     ` Ville Syrjälä
2015-12-01 14:06       ` Chris Wilson
2015-12-01 14:19         ` Ville Syrjälä
2015-12-01 16:07   ` [PATCH v2 " ville.syrjala
2015-12-01 18:15     ` Ville Syrjälä
2015-12-01 19:28     ` Paulo Zanoni
2015-12-01 19:40       ` Ville Syrjälä
2015-12-01 21:31     ` [PATCH v3 " ville.syrjala
2015-12-01 13:08 ` [PATCH 04/10] drm/i915: Add "missing" break to haswell_get_ddi_pll() ville.syrjala
2015-12-01 19:34   ` Paulo Zanoni
2015-12-01 19:45     ` Ville Syrjälä
2015-12-01 21:32   ` [PATCH v2 " ville.syrjala
2015-12-02  9:29     ` Ville Syrjälä
2015-12-01 13:08 ` [PATCH 05/10] drm/i915: Disable CLKOUT_DP bending on LPT/WPT as needed ville.syrjala
2015-12-02 13:35   ` Paulo Zanoni
2015-12-03 10:03     ` Ville Syrjälä
2015-12-03 11:16       ` Paulo Zanoni
2015-12-04 20:19   ` [PATCH v2 " ville.syrjala
2015-12-07 16:54     ` Paulo Zanoni
2015-12-01 13:08 ` [PATCH 06/10] drm/i915: Round to closest when computing the VGA dotclock for LPT-H ville.syrjala
2015-12-02 13:45   ` Paulo Zanoni
2015-12-04 20:20   ` [PATCH v2 " ville.syrjala
2015-12-01 13:08 ` [PATCH 07/10] drm/i915: Disable FDI after the CRT port on LPT-H ville.syrjala
2015-12-02 14:01   ` Paulo Zanoni
2015-12-03 10:14     ` Ville Syrjälä
2015-12-04 20:20   ` [PATCH v2 " ville.syrjala
2015-12-07 17:51     ` Paulo Zanoni
2015-12-07 18:57       ` Ville Syrjälä
2015-12-08 14:04         ` Ville Syrjälä
2015-12-08 14:05     ` [PATCH] " ville.syrjala
2015-12-01 13:08 ` [PATCH 08/10] drm/i915: Refactor LPT-H VGA dotclock disabling ville.syrjala
2015-12-02 16:56   ` Paulo Zanoni
2015-12-03 10:15     ` Ville Syrjälä
2015-12-04 20:21   ` [PATCH v2 " ville.syrjala
2015-12-01 13:08 ` [PATCH 09/10] drm/i915: Disable LPT-H VGA dotclock during crtc disable ville.syrjala
2015-12-02 17:02   ` Paulo Zanoni
2015-12-03 10:29     ` Ville Syrjälä
2015-12-04 20:22   ` [PATCH v2 " ville.syrjala
2015-12-01 13:08 ` [PATCH 10/10] drm/i915: Leave FDI running after failed link training on LPT-H ville.syrjala
2015-12-02 17:16   ` Paulo Zanoni
2015-12-03 10:30     ` Ville Syrjälä
2015-12-04 10:09   ` Daniel Vetter [this message]
2015-12-04 11:59     ` Ville Syrjälä
2015-12-04 20:22   ` [PATCH v2 " ville.syrjala
2015-12-08 14:32 ` [PATCH 00/10] HSW/BDW PCH modeset fixes and stuff Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151204100910.GL10243@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox