Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] drm/msm/dp: msm_dp_mst_select_bpp() ignores active link payloads --
commit 3977050b668a1f08d8d9b23f6fc76eaf2a03455a Author: Yongxing Mou <[email protected]> drm/msm/dp: select MST stream bpp during atomic check This commit selects the MST stream bpp during atomic check by trying 30, 24, and 18 bpp against the port PBN and link time slots, storing the result in a connector state subclass for commit. > diff --git a/drivers/gpu/drm/msm/dp/dp_mst_drm.c > b/drivers/gpu/drm/msm/dp/dp_mst_drm.c > index 2b96e003225d5..a452b3d2ba228 100644 > --- a/drivers/gpu/drm/msm/dp/dp_mst_drm.c > +++ b/drivers/gpu/drm/msm/dp/dp_mst_drm.c [ ... ] > @@ -142,6 +189,42 @@ static int msm_dp_mst_connector_atomic_check(struct > drm_connector *connector, > return drm_dp_atomic_release_time_slots(state, &mst->mst_mgr, > mst_conn->mst_port); > } > > +static int msm_dp_mst_select_bpp(struct drm_atomic_commit *state, > + struct msm_dp_mst *mst, > + const struct drm_dp_mst_topology_state > *mst_state, > + struct drm_dp_mst_port *port, > + const struct drm_display_mode *mode, > + u32 max_bpp, u32 *bpp) > +{ > + static const u32 bpps[] = { 30, 24, 18 }; > + unsigned int i; > + > + for (i = 0; i < ARRAY_SIZE(bpps); i++) { > + int pbn, slots; > + > + if (bpps[i] > max_bpp) > + continue; > + > + pbn = drm_dp_calc_pbn_mode(mode->clock, bpps[i] << 4); > + if (pbn > port->full_pbn) > + continue; > + > + slots = drm_dp_atomic_find_time_slots(state, &mst->mst_mgr, > port, pbn); > + if (slots < 0) > + return slots; > + > + if (slots <= mst_state->total_avail_slots) { > + drm_dbg_kms(mst->msm_dp->drm_dev, > + "[MST] bpp=%u pbn=%d slots=%d\n", > + bpps[i], pbn, slots); > + *bpp = bpps[i]; > + return 0; > + } > + } > + > + return -ENOSPC; > +} [Severity: Medium] Does comparing slots against mst_state->total_avail_slots account for time slots already used by other active streams on the link? drm_dp_atomic_find_time_slots() returns only the slots required for this port, while mst_state->total_avail_slots is the fixed 63-slot capacity of the entire link and is not decremented as payloads are added to mst_state->payloads. When another stream is already active on the link, msm_dp_mst_select_bpp() will pick 30 or 24 bpp as long as this stream alone fits in 63 slots, even if the remaining unallocated slots only have room for 24 or 18 bpp, causing drm_dp_mst_atomic_check() to fail the modeset with -ENOSPC instead of stepping down to a lower bpp. -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=28
