apply_svp1_workaround(9)
π 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_nextforaccess_direction == 0svp1_start_line = svp0_start_line_next - svp0_height_nextforaccess_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: π«Ά
in_circular_range(9)calculate_start_line_and_height_from_swath(9)get_swath_deadlines(9)calculate_swath_deadline_dst(9)is_dst_in_next_frame(9)is_end_swath_in_next_frame(9)is_svp_dst_in_next_frame(9)calculate_swath_idx_from_dst(9)populate_svp_params(9)populate_start_index_num_swaths_helper(9)calculate_start_index_num_swaths(9)calculate_hubp_start_end_lines(9)get_prefetch_end_line(9)get_effective_vblank_start(9)
β 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms