apply_svp1_workaround(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… apply_svp1_workaround(9) β€” from the Kernel API Manual, bestie πŸŽ€

okay so bestie, we're in the Kernel API Manual today and this page is called apply_svp1_workaround. no cap, the whole point of it is: apply the workaround required for the scenario where svp0_height_next != 0 && svp1_height_next == 0. that's the vibe. that's the whole assignment. ✨


🌸 SYNOPSIS 🌸

void apply_svp1_workaround (uint32_t svp0_start_sw_idx_next , uint32_t svp0_num_swaths_next , uint32_t svp1_num_swaths_next , uint16_t viewport_start , uint16_t viewport_size , uint16_t swath_height , uint8_t access_direction , uint16_t *svp1_start_line );

like, it's void. it returns nothing. it just does things. main character energy honestly. πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

so here's the part where I have to be real with you: the manpage literally just says -- undescribed -- for every single one of these. I'm not out here inventing lore πŸ’€ β€” so I'm passing the mystery straight to you, no filter:

  • svp0_start_sw_idx_next β€” -- undescribed -- πŸ«₯
  • svp0_num_swaths_next β€” -- undescribed -- πŸ«₯
  • svp1_num_swaths_next β€” -- undescribed -- πŸ«₯
  • viewport_start β€” -- undescribed -- πŸ«₯
  • viewport_size β€” -- undescribed -- πŸ«₯
  • swath_height β€” -- undescribed -- πŸ«₯
  • access_direction β€” -- undescribed -- πŸ«₯
  • svp1_start_line β€” -- undescribed -- πŸ«₯

(note that svp1_start_line is a uint16_t *, so it's a pointer β€” it's the one getting written into, iykyk πŸ‘€. the rest are plain values passed in.)


✨ DESCRIPTION ✨

the workaround requires the following, and I'm quoting the math exactly because this is the whole entire point of the function:

  • svp1_start_line = svp0_start_line_next + svp0_height_next for access_direction == 0
  • svp1_start_line = svp0_start_line_next - svp0_height_next for access_direction == 1

so like… one direction you add, the other direction you subtract. that's it. that's the tea. πŸ“

and then, direct from the DCN IP team β€” this is the part where you do NOT get creative:

From DCN IP team: Do not clamp any value from this calculation, just used the calculated value in svp1_start_line as is

read that again bestie. no clamping. none. zero. you take whatever number falls out of the calculation and you put it in svp1_start_line as is. do not "fix" it, do not "guard" it, do not get cute with it. the IP team said what they said πŸ’…

and here's that giant asterisk banner from the original, preserved in all its chaotic glory because I refuse to edit the source:

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

slay. moving on. 😌


πŸ”₯ SEE ALSO πŸ”₯

Kernel file:

./drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_standalone_libraries/alternate_pstate_shared_lib.c

and the whole friend group: 🫢


⭐ little sign-off moment: this page comes to you from ./drivers/gpu/drm/amd/display/..., dated October 2026. screenshot it, frame it, put it on your wall. mwah. πŸ’–πŸ§šπŸŒˆ
πŸ“¦ where this page comes from