Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/dp_mst: Don't round up the PBN to whole TUs if not needed
@ 2026-11-16 10:53 Eriksen Xie
  2026-11-16 11:03 ` sashiko-bot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eriksen Xie @ 2026-11-16 10:53 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: jani.nikula, rodrigo.vivi, imre.deak, ville.syrjala, Eriksen Xie

intel_dp_mtp_tu_compute_config() rounds up the stream's PBN to a whole
number of TUs (remote_tu * pbn_div) before passing it to
drm_dp_atomic_find_time_slots(). The MST core uses this PBN both in the
ALLOCATE_PAYLOAD messages and for checking the bandwidth limit of the
path in drm_dp_mst_atomic_check_mstb_bw_limit(), against the
Full_Payload_Bandwidth_Number reported by the branch device.

Rounding up the PBN is needed only if the TU alignment required by the
HW (4 / lane_count) increased the TU count, to make the TU count the MST
core derives from the PBN match the TU count programmed to the HW.
Otherwise the MST core derives the same TU count from the exact PBN as
well.

Rounding up needlessly can make a stream that would fit on the path
exceed its limit. For instance 1920x1080@120 8 bpc needs 1022 PBN, which
fits a port reporting 1024 PBN, but on a 4 lane HBR3 link (60 PBN per
TU) it gets rounded up to 18 TUs = 1080 PBN. The stream then fails the
check and the driver reduces it to 6 bpc (13 TUs).

Round up the PBN to the aligned TU count only if the alignment changed
the TU count, otherwise use the exact PBN.

Tested with a PS8650 MST hub driving three 1920x1080@120 panels on Nova
Lake: the streams now use 24 bpp (18 TUs, 1022 PBN out of the 1024 PBN
limit) instead of 18 bpp.

Signed-off-by: Eriksen Xie <xiaolu.xie@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp_mst.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index 1e6190689e..c8cb328a1d 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -349,7 +349,7 @@ int intel_dp_mtp_tu_compute_config(struct intel_dp *intel_dp,
 
 		if (is_mst) {
 			int remote_bw_overhead;
-			int remote_tu;
+			int remote_tu, aligned_tu;
 			fixed20_12 pbn;
 
 			remote_bw_overhead = intel_dp_mst_bw_overhead(crtc_state,
@@ -381,16 +381,18 @@ int intel_dp_mtp_tu_compute_config(struct intel_dp *intel_dp,
 			 * TODO: remove the alignment restriction for 128b/132b links
 			 * on some platforms, where Bspec allows this.
 			 */
-			remote_tu = ALIGN(remote_tu, 4 / crtc_state->lane_count);
+			aligned_tu = ALIGN(remote_tu, 4 / crtc_state->lane_count);
 
 			/*
-			 * Also align PBNs accordingly, since MST core will derive its
-			 * own copy of TU from the PBN in drm_dp_atomic_find_time_slots().
-			 * The above comment about the difference between the PBN
-			 * allocated for the whole path and the TUs allocated for the
-			 * first branch device's link also applies here.
+			 * MST core derives its own copy of TU from the PBN in
+			 * drm_dp_atomic_find_time_slots(), so round the PBN up to
+			 * the aligned TU only if the alignment changed it. Otherwise
+			 * keep the exact PBN, since rounding it up to whole TUs can
+			 * make it exceed the path's PBN limit.
 			 */
-			pbn.full = remote_tu * mst_state->pbn_div.full;
+			if (aligned_tu != remote_tu)
+				pbn.full = aligned_tu * mst_state->pbn_div.full;
+			remote_tu = aligned_tu;
 
 			drm_WARN_ON(display->drm, remote_tu < crtc_state->dp_m_n.tu);
 			crtc_state->dp_m_n.tu = remote_tu;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-16 13:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 10:53 [PATCH] drm/i915/dp_mst: Don't round up the PBN to whole TUs if not needed Eriksen Xie
2026-11-16 11:03 ` sashiko-bot
2026-11-16 13:26 ` ✓ CI.KUnit: success for " Patchwork
2026-11-16 13:58 ` ✓ Xe.CI.BAT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox