From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Gil Dekel <gildekel@chromium.org>
Cc: intel-gfx@lists.freedesktop.org, seanpaul@chromium.org,
dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v4 1/6] drm/i915/dp_link_training: Add a final failing state to link training fallback
Date: Fri, 1 Sep 2023 14:57:09 -0400 [thread overview]
Message-ID: <ZPI0BX6KyIIKMaKP@intel.com> (raw)
In-Reply-To: <20230824205335.500163-2-gildekel@chromium.org>
On Thu, Aug 24, 2023 at 04:50:16PM -0400, Gil Dekel wrote:
> Instead of silently giving up when all link-training fallback values are
> exhausted, this patch modifies the fallback's failure branch to reduces
> both max_link_lane_count and max_link_rate to zero (0) and continues to
> emit uevents until userspace stops attempting to modeset.
>
> By doing so, we ensure the failing connector, which is in
> link-status=Bad, has all its modes pruned (due to effectively having a
> bandwidth of 0Gbps).
>
> It is then the userspace's responsibility to ignore connectors with no
> modes, even if they are marked as connected.
>
> Signed-off-by: Gil Dekel <gildekel@chromium.org>
> ---
> drivers/gpu/drm/i915/display/intel_dp.c | 18 ++++++++++++++++--
> 1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 7067ee3a4bd3..2152ddbab557 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -276,8 +276,12 @@ static int intel_dp_common_len_rate_limit(const struct intel_dp *intel_dp,
>
> static int intel_dp_common_rate(struct intel_dp *intel_dp, int index)
> {
> + /* This occurs when max link rate drops to 0 via link training fallback*/
> + if (index < 0)
> + return 0;
I'm not comfortable with handling negative input as normal here
and no warning or msg.
Maybe I'm missing the cases in which this will get to negative and
it would be acceptable? In this case probably better to improve the
commit message.
> +
> if (drm_WARN_ON(&dp_to_i915(intel_dp)->drm,
> - index < 0 || index >= intel_dp->num_common_rates))
> + index >= intel_dp->num_common_rates))
> return 162000;
>
> return intel_dp->common_rates[index];
> @@ -318,6 +322,9 @@ static int intel_dp_max_common_lane_count(struct intel_dp *intel_dp)
> int intel_dp_max_lane_count(struct intel_dp *intel_dp)
> {
> switch (intel_dp->max_link_lane_count) {
> + /* This occurs when max link lane count drops to 0 via link training fallback*/
> + case 0:
> + return 0;
> case 1:
> case 2:
> case 4:
> @@ -672,7 +679,14 @@ int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
> intel_dp->max_link_lane_count = lane_count >> 1;
> } else {
> drm_err(&i915->drm, "Link Training Unsuccessful\n");
> - return -1;
> + /*
> + * Ensure all of the connector's modes are pruned in the next
> + * probe by effectively reducing its bandwidth to 0 so userspace
> + * can ignore it within the next modeset attempt.
> + */
> + intel_dp->max_link_rate = 0;
> + intel_dp->max_link_lane_count = 0;
> + return 0;
> }
>
> return 0;
> --
> Gil Dekel, Software Engineer, Google / ChromeOS Display and Graphics
next prev parent reply other threads:[~2023-09-01 18:57 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-24 20:50 [Intel-gfx] [PATCH v4 0/6] drm/i915/dp_link_training: Define a final failure state when link training fails Gil Dekel
2023-08-24 20:50 ` Gil Dekel
2023-08-24 20:50 ` [Intel-gfx] [PATCH v4 1/6] drm/i915/dp_link_training: Add a final failing state to link training fallback Gil Dekel
2023-08-24 20:50 ` Gil Dekel
2023-09-01 18:57 ` Rodrigo Vivi [this message]
2023-09-01 22:51 ` [Intel-gfx] " Gil Dekel
2023-08-24 20:50 ` [Intel-gfx] [PATCH v4 2/6] drm/i915/dp_link_training: Add a final failing state to link training fallback for MST Gil Dekel
2023-08-24 20:50 ` Gil Dekel
2023-08-24 20:50 ` [Intel-gfx] [PATCH v4 3/6] drm/dp_mst: Add drm_dp_set_mst_topology_link_status() Gil Dekel
2023-08-24 20:50 ` Gil Dekel
2023-08-30 21:32 ` [Intel-gfx] " Lyude Paul
2023-08-30 21:32 ` Lyude Paul
2023-08-24 20:50 ` [Intel-gfx] [PATCH v4 4/6] drm/i915: Move DP modeset_retry_work into intel_dp Gil Dekel
2023-08-24 20:50 ` Gil Dekel
2023-08-24 20:50 ` [Intel-gfx] [PATCH v4 5/6] drm/i915/dp_link_training: Set all downstream MST ports to BAD before retrying Gil Dekel
2023-08-24 20:50 ` Gil Dekel
2023-09-01 18:55 ` [Intel-gfx] " Rodrigo Vivi
2023-09-01 21:13 ` Gil Dekel
2023-09-01 23:24 ` Gil Dekel
2023-08-24 20:50 ` [Intel-gfx] [PATCH v4 6/6] drm/i915/dp_link_training: Emit a link-status=Bad uevent with trigger property Gil Dekel
2023-08-24 20:50 ` Gil Dekel
2023-09-01 23:22 ` [Intel-gfx] " Manasi Navare
2023-09-01 23:22 ` Manasi Navare
2023-08-24 22:10 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dp_link_training: Define a final failure state when link training fails (rev2) Patchwork
2023-08-24 22:10 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-08-24 22:29 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-08-30 21:41 ` [Intel-gfx] [PATCH v4 0/6] drm/i915/dp_link_training: Define a final failure state when link training fails Lyude Paul
2023-08-30 21:41 ` Lyude Paul
2023-09-01 18:38 ` [Intel-gfx] " Rodrigo Vivi
2023-09-01 19:05 ` Rodrigo Vivi
2023-09-01 19:25 ` Gil Dekel
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=ZPI0BX6KyIIKMaKP@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gildekel@chromium.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=seanpaul@chromium.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.