calculate_hu...rt_end_lines(9)
π NAME π
ok so this page is from the Kernel API Manual (the header up top literally says calculate_hu...rt_end_lines(9), it's giving truncated filename energy, we love a mysterious queen π
), and the actual vibe is:
calculate_hubp_start_end_lines β a function that calculates svp parameters given a target p-state line. that's it, that's the whole thing β¨
β¨ SYNOPSIS β¨
void calculate_hubp_start_end_lines (struct
calculate_hubp_start_end_lines_params *p );
like yes bestie it returns void, we're doing side effects today π«Ά
π ARGUMENTS π
pβ so the manual literally just says-- undescribed --for this one π no cap, that's the entire entry. it's astruct calculate_hubp_start_end_lines_params *and that's all we're told. iconic of the docs team tbh.
π¦ DESCRIPTION π¦
okok so here's the tea π: this function calculates the svp parameters (that's the vp0 and vp1 programming, keep up bestie) in terms of swath index and number of swaths, given an otg p-state target.
π¨ real talk: this function should be called per plane. don't be out here calling it once and thinking you're done, it's not that kind of function π
The manual says there are 5 steps. The list below has six items. Not me counting π but like, we're reporting the facts exactly as given, so here's literally everything:
- Calculate
svp0_start_dst_lineandsvp0_end_dst_line. - Calculate
svp1_start_dst_lineandsvp1_end_dst_line - Calculate
svp0_swath_start_idxandsvp0_swath_end_idx - Calculate
svp1_swath_start_idxandsvp1_swath_end_idx - Convert to start swath index and number of swaths (for height)
- Convert swath indices to
START_LINEandHEIGHT
and then, because the source material felt dramatic:
***********************************************************************************************************
(mood. same energy as a group chat "anywayβ")
π SEE ALSO π
ok so the Kernel file this all lives in is:
./drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_standalone_libraries/alternate_pstate_shared_lib.c
and here's the whole friend group, go say hi π:
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)populate_start_index_num_swaths_helper(9)calculate_start_index_num_swaths(9)get_prefetch_end_line(9)get_effective_vblank_start(9)
aaaand that's the page bestie π source is ./drivers/gpu/drm/amd/display/... and it's dated October 2026 β yes, the future, we're ahead of schedule, slay πβ¨
π¦ 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