calculate_st...t_from_swath(9)
π calculate_st...t_from_swath(9) β Kernel API Manual β¨
okay so bestie, welcome to the group chat for calculate_st...t_from_swath(9) β that's the Kernel API manual, and yes the title is literally truncated like that, it's giving "my name got cut off in the GC nickname" energy π. Anyway. Sit down, hydrate, let's get into it.
πΈ NAME πΈ
calculate_start_line_and_height_from_swath β okay so this icon takes the output from calculate_hubp_start_end_lines and calculates hardware programming values. Which values? SVP0/1_START_LINE and SVP0/1_HEIGHT. That's the whole vibe, periodt.
β¨ SYNOPSIS β¨
void calculate_start_line_and_height_from_swath (uint32_t
svp0_start_sw_idx_curr , uint32_t svp0_num_swaths_curr , uint32_t
svp0_start_sw_idx_next , uint32_t svp0_num_swaths_next , uint32_t
svp1_start_sw_idx_curr , uint32_t svp1_num_swaths_curr , uint32_t
svp1_start_sw_idx_next , uint32_t svp1_num_swaths_next , uint16_t
rec_start_dst , uint16_t svp0_start_dst , uint32_t svp0_frame_count ,
uint32_t program_go_line , uint32_t program_go_frame_count , uint16_t
viewport_start , uint16_t viewport_size , uint8_t access_direction ,
uint16_t vstartup , uint16_t swath_height , uint16_t *svp0_start_line ,
uint16_t *svp0_height , uint16_t *svp0_height_next , uint16_t
*svp1_start_line , uint16_t *svp1_height , uint16_t *svp1_height_next );
it's a void function, she returns nothing, she simply does π
. twenty-four parameters. twenty-four. not me counting them twice to make sure π«Ά.
π ARGUMENTS π
okay so here's the part where the manpage simply Did Not Do The Reading π. Every single one of these says -- undescribed -- in the original, and I'm not about to make stuff up, so I'm passing that message along verbatim, bestie. no cap.
svp0_start_sw_idx_currβ-- undescribed --svp0_num_swaths_currβ-- undescribed --svp0_start_sw_idx_nextβ-- undescribed --svp0_num_swaths_nextβ-- undescribed --svp1_start_sw_idx_currβ-- undescribed --svp1_num_swaths_currβ-- undescribed --svp1_start_sw_idx_nextβ-- undescribed --svp1_num_swaths_nextβ-- undescribed --rec_start_dstβ-- undescribed --svp0_start_dstβ-- undescribed --svp0_frame_countβ-- undescribed --program_go_lineβ-- undescribed --program_go_frame_countβ-- undescribed --viewport_startβ-- undescribed --viewport_sizeβ-- undescribed --access_directionβ-- undescribed --vstartupβ-- undescribed --swath_heightβ-- undescribed --svp0_start_lineβ-- undescribed --svp0_heightβ-- undescribed --svp0_height_nextβ-- undescribed --svp1_start_lineβ-- undescribed --svp1_heightβ-- undescribed --svp1_height_nextβ-- undescribed --
like, the way that literally all twenty-four of them are just sitting there undescribed... the manpage said "figure it out" and dipped ππ. (the types are in the synopsis though, so at least we know which ones are uint32_t, which are uint16_t, which is the lone uint8_t access_direction, and which six are uint16_t * out-pointers. slay for that, at least π)
π¦ DESCRIPTION π¦
okay so the actual tea β: this function takes the output from calculate_hubp_start_end_lines and calculates the values for START_LINE and HEIGHT β and those are the values that get used to program directly into hardware. direct. into. hardware. main character energy fr fr π₯.
and then the original drops this absolute wall of asterisks, which I am preserving in its full chaotic glory because it's iconic and I refuse to edit it:
***********************************************************************************************************
that's it. that's the description. she's mysterious, she's got a star divider, she ate β¨
π SEE ALSO π
first up, the kernel file itself β located at:
./drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_standalone_libraries/alternate_pstate_shared_lib.c
and the whole friend group, in the original order, no cap:
in_circular_range(9)apply_svp1_workaround(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)
go read all of them, bestie, they're all in the same little dml2 friend group π«Ά
heads up: this page came from the source path ./drivers/gpu/drm/amd/display/... (yes, truncated just like the title β the manpage generator was in a hurry okay π) and it's dated October 2026. that's the whole footer, and I'm folding it in here instead of copy-pasting the line, as promised π
and that's the page!! π calculate_st...t_from_swath(9) out. twenty-four arguments, zero descriptions, one star divider, infinite swag. 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