calculate_ub..._dpp_per_svp(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ calculate_ub_copy_size_per_plane_per_dpp_per_svp ✨

okay bestie, buckle up πŸ’… this one lives in the Kernel API Manual and it's a whole mouthful of a function name β€” calculate_ub_copy_size_per_plane_per_dpp_per_svp β€” but like, it's actually just doing math for display copy sizes, iykyk.


πŸŽ€ NAME πŸŽ€

calculate_ub_copy_size_per_plane_per_dpp_per_svp β€” calculates the upper bound copy size in bytes for a given plane and svp_dst_lines, no cap, that's literally the job πŸ’–


✨ SYNOPSIS ✨

unsigned int calculate_ub_copy_size_per_plane_per_dpp_per_svp (const
struct dml2_core_calcs_calculate_alternate_params *p , unsigned int
svp_dst_lines , unsigned int plane_idx , bool chroma );

she takes four things and hands you back an unsigned int, periodt 🌸


πŸ¦‹ ARGUMENTS πŸ¦‹

okay so the manpage is being super mysterious here β€” every single one of these is literally listed as -- undescribed -- in the source. not me side-eyeing the doc writers 😭 anyway:

  • p β€” -- undescribed -- 🫢
  • svp_dst_lines β€” -- undescribed -- 🫢
  • plane_idx β€” -- undescribed -- 🫢
  • chroma β€” -- undescribed -- 🫢
girl help, the documentation said "you'll figure it out" and dipped πŸ’€ we're keeping it 100% honest here: the original gives us nothing more than -- undescribed -- for all four, so that's what you get too.

🌈 DESCRIPTION 🌈

okay so first up, there's a TODO in here, and it's giving "future me problem":

TODO: The check for total copy size versus total alt-channel aperture size can be moved directly into mode support (from optimize / admissibility check layer)

that's it, that's the TODO, bestie, it's an idea someone had and wrote down πŸŽ€


πŸ’œ Note 2 πŸ’œ

now THIS is the part you actually need to know, so listen up πŸ‘‘

This function calculates a loose upper bound for the size required for the copy. Why? Because each SVP aperture needs enough space to hold the worst case copy size (i.e., prefetch + some recout swaths), so we calculate such that any SVP needs to consider the prefetch swaths in the size required.

But β€” and this is the plot twist πŸ”₯ β€” in actuality only one of SVP0 or SVP1 would have prefetch swaths required to be copied, since there cannot be the case where both SVPs overlap with prefetch.

Therefore, the result of this function should not be used to calculate the total copy time required (as it would be too long).

⚠️ fr fr, do NOT use this return value for total copy time. it's a loose upper bound, it's dramatic on purpose, she's an overestimator πŸ’…

okay and then there's just a giant line of asterisks in the original:

*****************************************************************************************************************************

iconic honestly, we respect the divider energy 🌟


πŸ“ SEE ALSO πŸ“

go read those next, bestie, they're the friend group 🫢


πŸ‘‘ sign-off πŸ‘‘

this lil masterpiece comes to you from ./drivers/gpu/drm/amd/display/..., dated October 2026, and it's the calculate_ub..._dpp_per_svp(9) page πŸ’– mwah, go calculate some upper bounds responsibly βœ¨πŸŽ€

πŸ“¦ where this page comes from