drm_rect_calc_vscale(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 πŸ’œ

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