STRUCT DRM_MODE_RECT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct drm_mode_rect(9) ✨

okay so bestie, welcome to the struct drm_mode_rect page from the Kernel API Manual πŸ’– β€” yes it's a manual page, yes it's about a rectangle, and no, it's not boring, because this little guy is doing main character energy work in the DRM subsystem. Let's get into it πŸŽ€


🌸 NAME 🌸

struct drm_mode_rect β€” a two dimensional rectangle, fr fr πŸŸͺ


✨ SYNOPSIS ✨

struct drm_mode_rect {
    __s32 x1;
    __s32 y1;
    __s32 x2;
    __s32 y2;
 };

like, that's the whole thing. four __s32s. iconic minimalism πŸ’…


πŸ¦‹ Members πŸ¦‹

  • x1 β€” the horizontal starting coordinate, and it's inclusive β€” so yes, this one counts 🫢
  • y1 β€” the vertical starting coordinate, also inclusive πŸ’œ
  • x2 β€” the horizontal ending coordinate, but this one is exclusive β€” she's not included, boundaries babe 😭
  • y2 β€” the vertical ending coordinate, also exclusive β€” same deal, not counted πŸ™ˆ
ngl the inclusive/exclusive thing is the kind of detail that will bite you if you forget it, so like… don't forget it πŸ’€

πŸŽ€ Description πŸŽ€

So the drm subsystem uses struct drm_rect to manage rectangular areas internally, and this struct, struct drm_mode_rect, is how they export it to user-space 🌈✨

Currently it's used by the drm_mode_atomic blob property FB_DAMAGE_CLIPS. That's it, that's the tea πŸ“


πŸ‘‘ SEE ALSO πŸ‘‘

okay this list is long, so buckle up bestie β€” literally every one of these is coming with us, no skips πŸ’–

like… go read them, iykyk πŸ˜€πŸ“š


and that's the whole page, bestie! this one lives in ./include/uapi/drm and the version/date on the tin is October 2026 β€” so yeah, future vibes only πŸ¦‹βœ¨ go forth and draw your inclusive-inclusive-exclusive-exclusive rectangles, periodt πŸ’…πŸ«Ά

πŸ“¦ where this page comes from