drm_fb_memcpy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_fb_memcpy β€” like, the kernel API manual page for it, bestie

okay so this is drm_fb_memcpy(9) from the Kernel API Manual, and honestly? she's a baddie whose whole personality is moving pixels around πŸ’–


✨ NAME ✨

drm_fb_memcpy β€” Copy clip buffer. that's it, that's the whole vibe πŸŽ€


✨ SYNOPSIS ✨

void drm_fb_memcpy (struct iosys_map *dst , const unsigned int
       *dst_pitch , const struct iosys_map *src , const struct drm_framebuffer
       *fb , const struct drm_rect *clip );

no cap, that's the exact signature, don't come for me 🫢


✨ ARGUMENTS ✨

  • dst β€” Array of destination buffers. yes bestie, an array, we'll get to that πŸ¦‹
  • dst_pitch β€” Array of numbers of bytes between the start of two consecutive scanlines within dst; can be NULL if scanlines are stored next to each other. so like, if your rows are all snuggled up together, you can just pass NULL and she'll figure it out ✨
  • src β€” Array of source buffers πŸ’œ
  • fb β€” DRM framebuffer. the main character of this whole operation πŸ‘‘
  • clip β€” Clip rectangle area to copy. the little window of vibes you're actually grabbing 🌸

✨ DESCRIPTION ✨

so what does she do? this function copies parts of a framebuffer to display memory. simple as that, and yet so iconic πŸ”₯

the formats must match. destination and framebuffer formats have to line up β€” no conversion takes place. like, zero. none. she is not doing a glow-up on your pixels, she is just moving them. if you were hoping for a format change, wrong function, bestie 😭

the parameters dst, dst_pitch and src refer to arrays. each array must have at least as many entries as there are planes in fb's format. each entry stores the value for the format's respective color plane at the same index β€” so entry 0 of dst pairs with plane 0, entry 1 with plane 1, and so on. matching fit, iykyk πŸ’…

⚠️ also important: this function does not apply clipping on dst (i.e. the destination is at the top-left corner). so the clip rectangle does its thing on the source side, but the destination just starts at the very top-left. no offset, no drama. don't expect her to nudge it πŸ™ˆ

✨ SEE ALSO ✨

Kernel file ./drivers/gpu/drm/drm_format_helper.c β€” that's where she lives, go say hi 🏠

and the whole friend group, fr fr:

like, that's the whole group chat, every single one of them, no skips 🧚


and that's the page!! sourced from ./drivers/gpu/drm, version dated October 2026 β€” mwah, kiss kiss, go copy some buffers responsibly πŸ’‹πŸŒˆ

πŸ“¦ where this page comes from