drm_fb_memcpy(9)
π 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 withindst; can beNULLif scanlines are stored next to each other. so like, if your rows are all snuggled up together, you can just passNULLand 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:
drm_format_conv_state_init(9)drm_format_conv_state_copy(9)drm_format_conv_state_reserve(9)drm_format_conv_state_release(9)drm_fb_clip_offset(9)drm_fb_swab(9)drm_fb_xrgb8888_to_rgb332(9)drm_fb_xrgb8888_to_rgb565(9)drm_fb_xrgb8888_to_rgb565be(9)drm_fb_xrgb8888_to_xrgb1555(9)drm_fb_xrgb8888_to_argb1555(9)drm_fb_xrgb8888_to_rgba5551(9)drm_fb_xrgb8888_to_rgb888(9)drm_fb_xrgb8888_to_bgr888(9)drm_fb_xrgb8888_to_argb8888(9)drm_fb_xrgb8888_to_abgr8888(9)drm_fb_xrgb8888_to_xbgr8888(9)drm_fb_xrgb8888_to_bgrx8888(9)drm_fb_xrgb8888_to_xrgb2101010(9)drm_fb_xrgb8888_to_argb2101010(9)drm_fb_xrgb8888_to_gray8(9)drm_fb_argb8888_to_argb4444(9)drm_fb_xrgb8888_to_mono(9)drm_fb_xrgb8888_to_gray2(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms