Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Xiao Lu" <xiaolu.xie@intel.com>
Cc: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 1/2] drm/i915/dp: fix PBN in ALLOCATE_PAYLOAD request to use actual video bandwidth
Date: Tue, 22 Sep 2026 09:35:28 +0000	[thread overview]
Message-ID: <20260922093529.4F5F71F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260922092647.2263962-2-xiaolu.xie@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/i915/dp: Timeslot accounting mismatch and WARN_ON due to unaligned slots
--

commit 42ac7363ce1083ef4680462acc3e4eec1ddf8e96
Author: Xiao Lu <xiaolu.xie@intel.com>
Subject: drm/i915/dp: fix PBN in ALLOCATE_PAYLOAD request to use actual video bandwidth

This commit modifies intel_dp_mtp_tu_compute_config() to separate the actual
video bandwidth (raw_pbn) from the aligned PBN used for hardware TU
programming. It passes raw_pbn to drm_dp_atomic_find_time_slots() so that the
MST core allocates payload bandwidth reflecting true stream requirements rather
than incorporating link-rate-specific TU granularity.

> diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> index 0c362784afe4a..31e846aadcf6c 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
[ ... ]
> @@ -397,7 +398,21 @@ int intel_dp_mtp_tu_compute_config(struct intel_dp *intel_dp,
>  
>  			slots = drm_dp_atomic_find_time_slots(state, &intel_dp->mst.mgr,
>  							      connector->mst.port,
> -							      dfixed_trunc(pbn));
> +							      raw_pbn);

[Severity: High]
Does this cause a timeslot accounting mismatch and a kernel warning?

By passing raw_pbn to drm_dp_atomic_find_time_slots() in
intel_dp_mtp_tu_compute_config(), the function calculates and returns an
unaligned VCPI timeslot allocation. However, the Intel TX hardware requires
timeslots to be aligned (e.g., to a 4-slot boundary for a 1-lane link).

Because the returned slots is unaligned, it diverges from the hardware-aligned
dp_m_n.tu. This leads to two issues:

1. The boundary check immediately following this call:

    if (slots > mst_state->total_avail_slots)
        slots = -EINVAL;

incorrectly uses the unaligned slots value rather than checking the final
aligned remote_tu that is actually programmed into the hardware. This might
bypass the availability check for streams that exceed link capacity when
aligned.

2. The assertion further down in the function:

    drm_WARN_ON(display->drm, slots != crtc_state->dp_m_n.tu);

will falsely and reliably trigger a kernel stack trace on any successful
modeset where alignment padding was applied (like on a 1-lane or 2-lane link
where 4 / lane_count alignment changes the raw TU count).

Additionally, this mismatch between the downstream branch device's DPCD
payload table (receiving the unaligned VCPI slot count) and the Intel TX
(transmitting the padded TU count) violates Bspec synchronization requirements
and risks payload corruption.

> +
> +			drm_dbg_kms(display->drm,
> +				    "MST TU %s pipe %c: clock=%d lanes=%d bpp=%d link_bpp=%d fec=%d\n",
> +				    connector->base.name,
> +				    pipe_name(to_intel_crtc(crtc_state->uapi.crtc)->pipe),
> +				    crtc_state->port_clock, crtc_state->lane_count,
> +				    fxp_q4_to_int(bpp_x16), fxp_q4_to_int(link_bpp_x16),
> +				    crtc_state->fec_enable);
> +			drm_dbg_kms(display->drm,
> +				    "MST TU %s: overhead=%d raw_pbn=%d pbn=%d pbn_div=%d tu=%d slots=%d full_pbn=%d\n",
> +				    connector->base.name,
> +				    remote_bw_overhead, raw_pbn,
> +				    dfixed_trunc(pbn), dfixed_trunc(mst_state->pbn_div),
> +				    remote_tu, slots, connector->mst.port->full_pbn);
>  
>  			/* TODO: Check this already in drm_dp_atomic_find_time_slots(). */
>  			if (slots > mst_state->total_avail_slots)

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260922092647.2263962-1-xiaolu.xie@intel.com?part=1

  reply	other threads:[~2026-09-22  9:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22  9:26 [PATCH v2 0/2] drm/dp/mst: fix MST payload PBN accounting Xiao Lu
2026-09-22  9:26 ` [PATCH v2 1/2] drm/i915/dp: fix PBN in ALLOCATE_PAYLOAD request to use actual video bandwidth Xiao Lu
2026-09-22  9:35   ` sashiko-bot [this message]
2026-09-22  9:26 ` [PATCH v2 2/2] drm/dp_mst: Track allocated_pbn from ALLOCATE_PAYLOAD down-reply Xiao Lu
2026-09-22  9:41   ` sashiko-bot
2026-09-22  9:35 ` [PATCH v2 0/2] drm/dp/mst: fix MST payload PBN accounting Jani Nikula
2026-09-22 12:30 ` ✓ i915.CI.BAT: success for " Patchwork
2026-09-22 23:22 ` ✗ i915.CI.Full: failure " Patchwork
2026-09-24  9:43 ` [PATCH v3 0/2] drm/i915/dp: Fix MST " Xiao Lu
2026-09-24  9:43   ` [PATCH v3 1/2] drm/i915/dp: fix PBN in ALLOCATE_PAYLOAD request to use actual video bandwidth Xiao Lu
2026-09-24  9:51     ` sashiko-bot
2026-09-24  9:43   ` [PATCH v3 2/2] drm/dp_mst: Track allocated_pbn from ALLOCATE_PAYLOAD down-reply Xiao Lu
2026-09-24  9:57     ` sashiko-bot

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=20260922093529.4F5F71F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=xiaolu.xie@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