drm_fb_xrgb8888_to_argb8888(9)
π drm_fb_xrgb8888_to_argb8888(9) β the Kernel API Manual, bestie edition π
okay so this is a page from the Kernel API Manual and honestly? it's giving "niche but iconic." it's all about one little function that does a glow-up on your pixels. let's get into it β¨
πΈ NAME πΈ
drm_fb_xrgb8888_to_argb8888 β converts XRGB8888 to ARGB8888 in a clip buffer. that's the whole vibe. no cap.
π¦ SYNOPSIS π¦
void drm_fb_xrgb8888_to_argb8888 (struct iosys_map *dst , const unsigned
int *dst_pitch , const struct iosys_map *src , const struct
drm_framebuffer *fb , const struct drm_rect *clip , struct
drm_format_conv_state *state );
literally just read it, it's right there π
π ARGUMENTS π
dstβ an array of ARGB8888 destination buffers. yes bestie, plural, it's an array.dst_pitchβ an array of numbers of bytes between the start of two consecutive scanlines withindst. this one can beNULLif the scanlines are stored next to each other (they're snuggle buddies, it's fine).srcβ an array of XRGB8888 source buffer. the original, the blueprint, the main character.fbβ the DRM framebuffer. hi king πclipβ the clip rectangle area to copy. basically "this part only, thank you."stateβ transform and conversion state. it holds the lore.
β¨ DESCRIPTION β¨
so what does this function actually do? it copies parts of a framebuffer over to display memory, and converts the color format while it's at it. multitasking icon behavior, honestly π₯
the parameters dst, dst_pitch and src refer to arrays. and here's the rule: each array must have at least as many entries as there are planes in fb's format. every entry stores the value for the format's respective color plane at the same index. matching indexes, matching energies, we love to see it π«Ά
β οΈ heads up: this function does not apply clipping on dst β meaning the destination sits at the top-left corner. top-left only. periodt.
drivers can use this function for ARGB8888 devices that don't support XRGB8888 natively. and as part of the conversion, it sets an opaque alpha channel β so nothing's see-through, everything's fully there. slay π
π SEE ALSO π
the kernel file that lives here: ./drivers/gpu/drm/drm_format_helper.c
and the whole friend group (squad goals, 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_memcpy(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_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)
and that's the whole page, bestie π this little beauty lives over at ./drivers/gpu/drm, dated October 2026, and it goes by drm_fb_xrgb8888_to_argb8888(9). go forth and convert those pixels 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