populate_sta...waths_helper(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ‘‘ 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:

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