From: sashiko-bot@kernel.org
To: "Lee Shawn C" <shawn.c.lee@intel.com>,
intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 4/4] drm/i915/dp: Use the VBT fast link training link config for eDP
Date: Mon, 16 Nov 2026 14:19:26 +0000 [thread overview]
Message-ID: <sashiko-outbox-217152@kernel.org> (raw)
In-Reply-To: <20261116135904.59365-5-shawn.c.lee@intel.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] drm/i915/dp: missing M/N and BW fallback in
intel_dp_apply_vbt_edp_link_config()
- [High] drm/i915/dp: use_max_params overrides
intel_dp_apply_vbt_edp_link_config()
--
commit 7ebafd17f2c671a09a03aeab471e356e0295de7d
Author: Lee Shawn C <shawn.c.lee@intel.com>
drm/i915/dp: Use the VBT fast link training link config for eDP
This commit restricts eDP link configurations during compute config to the
VBT fast link training rate and lane count when eDP fast link training is
enabled in the VBT and supported by the sink.
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index ef164a7976187..d5829bef801af 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -2824,6 +2824,54 @@ intel_dp_compute_m_n_ratio_limits(struct intel_dp *intel_dp,
> return true;
> }
>
> +static void
> +intel_dp_apply_vbt_edp_link_config(struct intel_dp *intel_dp,
> + struct intel_connector *connector,
> + struct link_config_limits *limits)
> +{
> + struct intel_display *display = to_intel_display(intel_dp);
> + struct intel_dp_link_caps *link_caps = intel_dp->link.caps;
> + struct intel_dp_link_caps_filter vbt_filter = INTEL_DP_LINK_CAPS_FILTER_NONE;
> + struct intel_dp_link_caps_iter iter;
> + struct intel_dp_link_config config;
> + int vbt_rate = connector->panel.vbt.edp.rate;
> + int vbt_lanes = connector->panel.vbt.edp.lanes;
> +
> + if (!intel_dp_is_edp(intel_dp) ||
> + !connector->panel.vbt.edp.fast_link_training ||
> + !drm_dp_fast_training_cap(intel_dp->dpcd) ||
> + (!vbt_rate && !vbt_lanes))
> + return;
> +
> + intel_dp_link_caps_iter_start(&iter, link_caps,
> + intel_dp_link_caps_connector_compute_order(connector),
> + limits->link_config_filter);
> + for_each_dp_link_config(&iter, &config) {
> + if (vbt_rate && config.rate != vbt_rate)
> + continue;
> + if (vbt_lanes && config.lane_count != vbt_lanes)
> + continue;
> +
> + intel_dp_link_caps_filter_add(link_caps, &vbt_filter, &config);
> + }
> + intel_dp_link_caps_iter_end(&iter);
[Severity: High]
Does intersecting against limits->link_config_filter after the
intel_dp->use_max_params check cause VBT fast link training configs to be
ignored whenever use_max_params is true?
intel_edp_init_dpcd() sets intel_dp->use_max_params to true on all eDP < 1.4
panels, and intel_dp_compute_config_limits() narrows
limits->link_config_filter to a single max_config entry before calling
intel_dp_apply_vbt_edp_link_config(). Any VBT rate or lane count lower than
max_config will not match that single-entry filter, leaving
vbt_filter.config_mask zero so the VBT config (and its voltage swing and
pre-emphasis levels in intel_dp_use_vbt_fast_link_levels()) is bypassed.
On eDP >= 1.4 panels, if link training fails on the VBT config,
intel_dp_get_link_train_fallback_values() sets intel_dp->use_max_params =
true and returns without calling intel_dp_link_caps_disable_config(), either
retrying the same failed config if the VBT config was already max_config or
leaving a failed lower VBT config enabled in link_caps for subsequent
fallbacks.
> +
> + if (!vbt_filter.config_mask) {
> + drm_dbg_kms(display->drm,
> + "[CONNECTOR:%d:%s] VBT eDP link config (lanes %d, rate %d) not in allowed link configs, ignoring\n",
> + connector->base.base.id, connector->base.name,
> + vbt_lanes, vbt_rate);
> + return;
> + }
> +
> + drm_dbg_kms(display->drm,
> + "[CONNECTOR:%d:%s] Limiting link configs to VBT eDP lanes %d, rate %d\n",
> + connector->base.base.id, connector->base.name,
> + vbt_lanes, vbt_rate);
> +
> + limits->link_config_filter = vbt_filter;
> +}
> +
> bool
> intel_dp_compute_config_limits(struct intel_dp *intel_dp,
> struct drm_connector_state *conn_state,
> @@ -2940,6 +2988,8 @@ intel_dp_compute_config_limits(struct intel_dp *intel_dp,
> limits->link_config_filter = new_filter;
> }
>
> + intel_dp_apply_vbt_edp_link_config(intel_dp, connector, limits);
> +
> if (!intel_dp_compute_m_n_ratio_limits(intel_dp, conn_state, crtc_state, limits))
> return false;
[Severity: High]
Can restricting limits->link_config_filter to vbt_filter here cause the
modeset to fail instead of falling back when the VBT link config is in
link_caps but cannot support the mode's M/N ratio or required bandwidth?
link_caps contains all common source and sink rates and lane counts (for
example 1.62 Gbps RBR, which is also the 0-value encoding in VBT versions
182..223 in parse_edp_fast_link_params()), so an under-provisioned VBT
config still matches in intel_dp_apply_vbt_edp_link_config() and overwrites
limits->link_config_filter.
If vbt_rate is too low for intel_dp_can_support_m_n(),
intel_dp_compute_m_n_ratio_limits() then sees only vbt_filter and returns
false even when higher rates in link_caps could support the mode. Even when
the M/N check passes, if the VBT config lacks bandwidth for the mode,
intel_dp_compute_link_config_wide() degrades pipe_bpp or returns -EINVAL
without retrying against the unfiltered link_caps, failing the modeset on
non-DSC eDP panels or selecting the VBT link config without a bandwidth
check in dsc_compute_compressed_bpp() on DSC-capable eDP panels:
drivers/gpu/drm/i915/display/intel_dp.c:dsc_compute_compressed_bpp() {
...
if ( intel_dp_is_edp(intel_dp)) {
struct intel_dp_link_config max_link_config;
if (!intel_dp_get_connector_max_link_config(connector, limits, &max_link_config))
return -EINVAL;
pipe_config->port_clock = max_link_config.rate;
pipe_config->lane_count = max_link_config.lane_count;
pipe_config->dsc.compressed_bpp_x16 = max_bpp_x16;
...
}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116135904.59365-1-shawn.c.lee@intel.com?part=4
prev parent reply other threads:[~2026-11-16 14:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 13:59 [PATCH v2 0/4] drm/i915/dp: Use the VBT eDP fast link training params Lee Shawn C
2026-11-16 13:59 ` [PATCH v2 1/4] drm/i915/bios: Split out parsing the " Lee Shawn C
2026-11-16 13:59 ` [PATCH v2 2/4] drm/i915/bios: Parse eDP fast link training params only if enabled Lee Shawn C
2026-11-16 13:59 ` [PATCH v2 3/4] drm/i915/dp: Start eDP link training from VBT fast link train vswing/pre-emphasis levels Lee Shawn C
2026-11-16 13:59 ` [PATCH v2 4/4] drm/i915/dp: Use the VBT fast link training link config for eDP Lee Shawn C
2026-11-16 14:19 ` sashiko-bot [this message]
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=sashiko-outbox-217152@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=shawn.c.lee@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