drm_rect_intersect(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ drm_rect_intersect(9) ✨

okay so bestie, this is a page from the Kernel API Manual and it's literally just about squishing two rectangles together to see where they overlap πŸ’… like venn diagram energy but for the kernel, no cap


🌸 NAME 🌸

drm_rect_intersect β€” intersect two rectangles 🫢


πŸŽ€ SYNOPSIS πŸŽ€

bool drm_rect_intersect (struct drm_rect *r1 , const struct drm_rect *r2
);

πŸ’– ARGUMENTS πŸ’–

  • r1 β€” first rectangle, she's the main character here fr fr (and she's about to get rewritten, spoiler)
  • r2 β€” second rectangle, the const one, she stays exactly as she is 🌸

πŸ¦‹ DESCRIPTION πŸ¦‹

So the whole vibe is: calculate the intersection of rectangles r1 and r2. That's it. That's the tea β˜•

The way that r1 gets overwritten with the intersection β€” like, not me just casually replacing your rectangle with the overlap, but that is literally the whole function, iykyk πŸ’€


πŸ”₯ RETURN πŸ”₯

true if rectangle r1 is still visible after the operation, false otherwise.

so like... if there's still something there to look at, she says true πŸ‘‘ if the rectangles missed each other entirely and r1 got absolutely ate by the intersection, she says false 😭 vibe check failed, nothing left to see


⭐ SEE ALSO ⭐

kernel file ./drivers/gpu/drm/drm_rect.c β€” like, the actual file, go read it bestie 🧚


πŸ’œ bestie this is genuinely iconic: the rectangles intersect, r1 becomes the overlap, and if r1 is still visible you get true back. that's the entire personality. periodt.

and that's a wrap on the page from ./drivers/gpu/drm, dated October 2026, signed drm_rect_intersect(9) β€” slay, go intersect some rectangles πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from