From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Manasi Navare <manasi.d.navare@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v6] drm/i915/dp: Validate cached link rate and lane count before retraining
Date: Wed, 12 Apr 2017 17:00:16 +0300 [thread overview]
Message-ID: <20170412140016.GR30290@intel.com> (raw)
In-Reply-To: <1491512412-30016-1-git-send-email-manasi.d.navare@intel.com>
On Thu, Apr 06, 2017 at 02:00:12PM -0700, Manasi Navare wrote:
> Currently intel_dp_check_link_status() tries to retrain the link if
> Clock recovery or Channel EQ for any of the lanes indicated by
> intel_dp->lane_count is not set. However these values cached in intel_dp
> structure can be stale if link training has failed for these values
> during previous modeset. Or these values can get stale since we have
> now re read the DPCD registers or it can be 0 in case of connected boot
> case.
>
> This patch validates these values against the max link rate and max lane
> count values.
>
> This is absolutely required incase the common_rates or max lane count
> are now different due to link fallback.
>
> v2:
> * Include the FIXME commnet inside the function (Ville Syrjala)
> * Remove the redundant parenthesis (Ville Syrjala)
>
> v3 by Jani:
> * rebase on the DP refactoring series
> * rename intel_dp_link_params_is_valid to intel_dp_link_params_valid
> * minor stylistic changes
>
> v4:
> * Compare the link rate against max link rate not the
> common_rates since common_rates does not account for the
> lowered fallback link rate value. (Ville Syrjala)
>
> v5:
> * Fixed a warning for unused variable (Manasi)
>
> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/intel_dp.c | 26 +++++++++++++++++++++++---
> 1 file changed, 23 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 3c5c80d..36485be 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -322,6 +322,24 @@ static int intel_dp_common_len_rate_limit(struct intel_dp *intel_dp,
> return 0;
> }
>
> +static bool intel_dp_link_params_valid(struct intel_dp *intel_dp)
> +{
> + /*
> + * FIXME: we need to synchronize the current link parameters with
> + * hardware readout. Currently fast link training doesn't work on
> + * boot-up.
> + */
> + if (intel_dp->link_rate == 0 ||
> + intel_dp->link_rate > intel_dp->max_link_rate)
> + return false;
> +
> + if (intel_dp->lane_count == 0 ||
> + intel_dp->lane_count > intel_dp_max_lane_count(intel_dp))
> + return false;
> +
> + return true;
> +}
This lgtm
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> +
> int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
> int link_rate, uint8_t lane_count)
> {
> @@ -4253,9 +4271,11 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
> if (!to_intel_crtc(intel_encoder->base.crtc)->active)
> return;
>
> - /* FIXME: we need to synchronize this sort of stuff with hardware
> - * readout. Currently fast link training doesn't work on boot-up. */
> - if (!intel_dp->lane_count)
> + /*
> + * Validate the cached values of intel_dp->link_rate and
> + * intel_dp->lane_count before attempting to retrain.
> + */
> + if (!intel_dp_link_params_valid(intel_dp))
> return;
>
> /* Retrain if Channel EQ or CR not ok */
> --
> 2.1.4
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-04-12 14:00 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-06 13:44 [PATCH v4 00/11] drm/i915/dp: rest of refactoring, link rate fallback Jani Nikula
2017-04-06 13:44 ` [PATCH v4 01/11] drm/i915/dp: use the sink rates array for max sink rates Jani Nikula
2017-04-06 14:24 ` Ville Syrjälä
2017-04-06 13:44 ` [PATCH v4 02/11] drm/i915/dp: cache common rates with " Jani Nikula
2017-04-06 13:44 ` [PATCH v4 03/11] drm/i915/dp: do not limit rate seek when not needed Jani Nikula
2017-04-06 13:44 ` [PATCH v4 04/11] drm/i915/dp: don't call the link parameters sink parameters Jani Nikula
2017-04-06 13:44 ` [PATCH v4 05/11] drm/i915/dp: add functions for max common link rate and lane count Jani Nikula
2017-04-06 13:44 ` [PATCH v4 06/11] drm/i915/mst: use max link not sink " Jani Nikula
2017-04-06 13:44 ` [PATCH v4 07/11] drm/i915/dp: localize link rate index variable more Jani Nikula
2017-04-06 13:44 ` [PATCH v4 08/11] drm/i915/dp: use readb and writeb calls for single byte DPCD access Jani Nikula
2017-04-06 13:44 ` [PATCH v4 09/11] drm/i915/dp: read sink count to a temporary variable first Jani Nikula
2017-04-06 14:25 ` Ville Syrjälä
2017-04-11 14:19 ` Jani Nikula
2017-04-11 15:44 ` Navare, Manasi D
2017-04-06 13:44 ` [PATCH v4 10/11] drm/i915/dp: Validate cached link rate and lane count before retraining Jani Nikula
2017-04-06 14:31 ` Ville Syrjälä
2017-04-06 18:29 ` Manasi Navare
2017-04-06 20:43 ` [PATCH v5] " Manasi Navare
2017-04-06 21:00 ` [PATCH v6] " Manasi Navare
2017-04-12 14:00 ` Ville Syrjälä [this message]
2017-04-12 14:13 ` Jani Nikula
2017-04-12 16:50 ` Navare, Manasi D
2017-04-06 13:44 ` [PATCH v4 11/11] drm/i915: Implement Link Rate fallback on Link training failure Jani Nikula
2017-04-13 17:25 ` Manasi Navare
2017-04-13 19:16 ` Jani Nikula
2017-04-06 14:35 ` ✓ Fi.CI.BAT: success for drm/i915/dp: rest of refactoring, link rate fallback Patchwork
2017-04-06 20:42 ` ✗ Fi.CI.BAT: failure for drm/i915/dp: rest of refactoring, link rate fallback (rev2) Patchwork
2017-04-06 21:54 ` ✓ Fi.CI.BAT: success for drm/i915/dp: rest of refactoring, link rate fallback (rev3) Patchwork
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=20170412140016.GR30290@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=manasi.d.navare@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