drm_rect_calc_vscale(9)
π drm_rect_calc_vscale(9) β like, the vertical scale girlie β¨
okay so bestie, this one lives in the Kernel API Manual and it's literally the vertical-scaling cousin of drm_rect_calc_hscale(9). she's giving "i do one thing and i do it well" energy and honestly? respect. π
πΈ NAME πΈ
drm_rect_calc_vscale β calculate the vertical scaling factor π
β¨ SYNOPSIS β¨
int drm_rect_calc_vscale (const struct drm_rect *src , const struct
drm_rect *dst , int min_vscale , int max_vscale );
π«Ά ARGUMENTS π«Ά
srcβ the source window rectangle, aka where you're coming from π¦dstβ the destination window rectangle, aka where you're going to β¨min_vscaleβ the minimum allowed vertical scaling factor (the floor, the boundary, the "bestie no further" line) πmax_vscaleβ the maximum allowed vertical scaling factor (the ceiling, the "okay that's enough" line) π₯
π DESCRIPTION π
so the way this works is it calculates the vertical scaling factor as (src height) / (dst height). simple. iconic. no cap. π
and then there's the rounding rules, which like β pay attention, this is the main character part:
- if the scale is below
1 << 16, it rounds down π - if the scale is above
1 << 16, it rounds up β¬οΈ
the reason is highkey clever: this will calculate the scale with the most pessimistic limit calculation. she's not being dramatic, she's being safe fr fr. π§
β RETURN β
returns the vertical scaling factor, or the errno of out of limits. so like, if you went outside the min_vscale/max_vscale bounds, you get an error code instead of a number. vibe check failed, respectfully. π
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/drm_rect.c drm_rect_intersect(9)drm_rect_clip_scaled(9)drm_rect_calc_hscale(9)drm_rect_debug_print(9)drm_rect_rotate(9)drm_rect_rotate_inv(9)
go read the whole friend group, they're all slay π«Ά
mwah π that's the whole page bestie β brought to you from the fine folks at ./drivers/gpu/drm, dated October 2026, and yeah they really did put the manpage title in the footer too (drm_rect_calc_vscale(9)), which is giving "i said what i said" energy. periodt. π
β¨
π¦ 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