drm_rect_rotate_inv(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 is
  • height β€” how tall the coordinate space is
  • rotation β€” the transformation whose inverse is gonna be applied. note: you pass the same rotation you 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' width and height thinking 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:


🌈 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