]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/dp_mst: Check BW limit on the local MST link early
authorImre Deak <imre.deak@intel.com>
Fri, 9 May 2025 18:03:32 +0000 (21:03 +0300)
committerImre Deak <imre.deak@intel.com>
Mon, 12 May 2025 12:22:48 +0000 (15:22 +0300)
Check the BW requirement of a selected compressed bpp against the total
MST link BW early. This didn't cause a problem, since all the BW limits
within the MST topology are checked during the later MST topology BW
check. However it doesn't make sense to defer the total link BW check,
since for resolving a BW limit issue due to this later also (a) requires
selecting a pipe to reduce its bpp, ending up reducing the bpp for
another pipe, which is not ideal (b) requires recomputing the state for
all CRTC/stream's in the topology which may slow down the commit
considerably (especially when using fractional bpps).

Based on the above, check a stream bpp's BW requirement against the MST
link's total BW early.

Ideally drm_dp_atomic_find_time_slots() should check internally the
corresponding PBN/TU slot BW against the total link BW, returning an
error if the check fails, however that change would also affect other
drivers, so leaving this for a follow-up.

v2: Rephrase description of pipe selection/bpp reduction in commit
    message. (Ankit)

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250509180340.554867-6-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_dp_mst.c

index 4345107aa3e81fbf51fb325ad50ea615cdef3dde..ff88888e4b293fd2b08517536f10812129e9edfe 100644 (file)
@@ -390,6 +390,10 @@ 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));
+
+                       /* TODO: Check this already in drm_dp_atomic_find_time_slots(). */
+                       if (slots > mst_state->total_avail_slots)
+                               slots = -EINVAL;
                } else {
                        /* Same as above for remote_tu */
                        crtc_state->dp_m_n.tu = ALIGN(crtc_state->dp_m_n.tu,