populate_sta...waths_helper(9)
๐ populate_sta...waths_helper(9) โ Kernel API Manual ๐
okay so bestie, buckle up, because we're reading a kernel API page together and it's giving "internal helper that everybody calls and nobody documents." this whole thing lives in the Kernel API Manual (yes, section 9, the grown-up one) and the star of the show is literally called populate_start_index_num_swaths_helper. iconic name, no notes. โจ
๐ธ NAME ๐ธ
populate_start_index_num_swaths_helper โ the helper function that calculates the svp params for the current frame and the next one. two frames, one little helper, main character energy fr fr. ๐ซถ
๐ฆ SYNOPSIS ๐ฆ
void populate_start_index_num_swaths_helper (uint32_t
svp_start_swath_idx , uint32_t svp_end_swath_idx , uint16_t
prefetch_swaths , uint16_t total_swaths , uint32_t
*svp_start_sw_idx_curr , uint32_t *svp_num_swaths_curr , uint32_t
*svp_start_sw_idx_next , uint32_t *svp_num_swaths_next );
it returns void, so no sneaky return value to check. she just does the math and leaves. ๐
๐ ARGUMENTS ๐
okay so this is the part where the docs simply did not do their homework. every single one of these is marked -- undescribed -- in the original. so i'm not gonna sit here and make up lore, because i'm not a liar. all i can tell you is the name and the type from the synopsis, and that the upstream authors left the description slot empty. ๐ญ
svp_start_swath_idxโuint32_t. docs say:-- undescribed --. that's it. that's the whole description. ๐svp_end_swath_idxโuint32_t. also-- undescribed --. the silence is loud.prefetch_swathsโuint16_t.-- undescribed --, bestie.total_swathsโuint16_t.-- undescribed --. i know. i know.svp_start_sw_idx_currโuint32_t *.-- undescribed --. (pointer, so something gets written through it, but the manpage is not about to tell us what ๐)svp_num_swaths_currโuint32_t *.-- undescribed --.svp_start_sw_idx_nextโuint32_t *.-- undescribed --.svp_num_swaths_nextโuint32_t *.-- undescribed --.
genuinely not me gatekeeping, the source just said nothing. the names are lowkey self-explanatory vibes but do not quote me as documentation. โญ
๐ DESCRIPTION ๐
so what does she actually do, since the args are all mystery? here's the tea, straight from the page:
this function calculates the parameters used for a single svp โ and yes, that includes both the curr params and the next params. both. she's doing double duty and she ate. ๐ฅ
she's also the one responsible for splitting up the start and end swath indices between frames when the svp spans a frame boundary. that's the tricky part, the boundary case, the "wait which frame does this belong to" moment, and that's literally her job. ๐ง
and then she calls the helper which calculates parameters per curr / next frame โ so she's a helper that calls another helper. helpers all the way down, no cap. ๐
ngl this is a thin page โ no options, no return value, no exit statuses, no environment variables, no bugs section, no author line, no license block. just the function, eight undescribed args, and the plot. don't go looking for more, it's not in here. ๐
๐ฎ SEE ALSO ๐ฎ
the kernel file that this all lives in:
./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 order the page lists them:
in_circular_range(9)apply_svp1_workaround(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)calculate_start_index_num_swaths(9)calculate_hubp_start_end_lines(9)get_prefetch_end_line(9)get_effective_vblank_start(9)
like, that's a whole group chat right there. ๐ซถ
and that's the page!! ๐ฆ this little rewrite comes to you from the source at ./drivers/gpu/drm/amd/display/... (yes, the original literally truncates the path like that, i'm not hiding anything from you ๐) and it's dated October 2026 โ go read the whole thing again when that date rolls around, 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