drm_mode_duplicate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_mode_duplicate β€” allocate and duplicate an existing mode

okay bestie, welcome to the drm_mode_duplicate(9) page from the Kernel API Manual β€” yes it's a real kernel manpage, no I'm not kidding, and yes it's kinda iconic πŸŽ€


✨ SYNOPSIS ✨

struct drm_display_mode * drm_mode_duplicate (struct drm_device *dev ,
const struct drm_display_mode *mode );

like, that's the whole function signature, she's not complicated πŸ’–


🌸 ARGUMENTS 🌸

  • dev β€” the drm_device you're allocating the duplicated mode for 🫢 that's her home now
  • mode β€” the mode you wanna duplicate. the og. the blueprint. the mother mode πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically: allocate a new mode, copy the existing mode into it, and return a pointer to it. that's it. that's the whole vibe πŸ’…

it's used to create new instances of established modes β€” think of it like cloning your fave outfit so you can wear it twice, except it's a struct drm_display_mode and nobody's gonna compliment you at a party for it 😭

ngl she's lowkey just memcpy with extra steps and a cute name, but she slays and we respect her ✨

⭐ RETURN ⭐

pointer to the duplicated mode on success πŸ’– NULL on error πŸ’€ (so like, always check. main character energy means checking your return values, periodt)


🌈 SEE ALSO 🌈

the kernel file lives at ./drivers/gpu/drm/drm_modes.c β€” that's the source, bestie, go read it if you're feeling brave 🧚

and here's the whole friend group, the entire mode-management squad, no cap πŸ‘‘:


ok that's the whole page, you ate that, go duplicate some modes responsibly πŸ“πŸ’œ

mwah πŸ’‹ this gem dropped from the Kernel API Manual, source path ./drivers/gpu/drm, dated October 2026 β€” see you in the next manpage, bestie πŸŽ€βœ¨

πŸ“¦ where this page comes from