drm_rect_rotate_inv(9)
β¨ drm_rect_rotate_inv β¨
okay so bestie, this one lives in the Kernel API Manual and it's literally the undo button for drm_rect_rotate. No cap.
πΈ NAME πΈ
drm_rect_rotate_inv β inverse rotate the rectangle. that's it, that's the whole vibe. it un-rotates. π
π SYNOPSIS π
void drm_rect_rotate_inv (struct drm_rect *r , int width , int height ,
unsigned int rotation );
π¦ ARGUMENTS π¦
rβ the rectangle that's getting rotated (well, un-rotated, but you knew that π)widthβ how wide the coordinate space isheightβ how tall the coordinate space isrotationβ the transformation whose inverse is gonna be applied. note: you pass the samerotationyou used going forward, not the flipped one β more on that below π
π DESCRIPTION π
So basically: apply the inverse of rotation to the coordinates of rectangle r. that's the whole job. iconic, honestly.
width and height, when combined with rotation, define where the new origin lands. like, that's the math they're doing together. π§
Now here's the cute part. width correcsponds to the horizontal axis and height to the vertical axis of the original untransformed coordinate space β yes, that's the manpage's own spelling and we are keeping it, typo is canon, we don't edit the queen π. The upshot of that ordering is you never have to flip them when you're doing a rotation and its inverse. so if you do this:
drm_rect_rotate(r, width, height, rotation);
drm_rect_rotate_inv(r, width, height, rotation);
you will always get back the original rectangle. literally always. round trip slay. π₯
fr fr, same argument order both ways β don't go swappin'widthandheightthinking you're being clever, you're just gonna have a bad time π
β SEE ALSO β
Kernel file ./drivers/gpu/drm/drm_rect.c β go read the source, it's giving main character energy:
drm_rect_intersect(9)drm_rect_clip_scaled(9)drm_rect_calc_hscale(9)drm_rect_calc_vscale(9)drm_rect_debug_print(9)drm_rect_rotate(9)β the forward one, the one you're inverting π«Ά
π mwah, that's the whole page! this lil masterpiece comes to you from ./drivers/gpu/drm, dated October 2026 β take care of her, she's iconic. πβ¨π
π¦ 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