drm_fb_xrgb8888_to_bgr888(9)
π drm_fb_xrgb8888_to_bgr888(9) β the Kernel API Manual glow-up π
okay bestie, so this page lives in the Kernel API Manual (section 9, dry land for kernel functions) and it's literally about drm_fb_xrgb8888_to_bgr888 β one tiny function doing the color-format glow-up from XRGB8888 to BGR888 on your clip buffer. it's giving "backstage wardrobe change but for pixels" β¨
πΈ NAME πΈ
drm_fb_xrgb8888_to_bgr888 β Convert XRGB8888 to BGR888 clip buffer π
no cap, that's the whole vibe: pixel format makeover, clip buffer edition.
β¨ SYNOPSIS β¨
void drm_fb_xrgb8888_to_bgr888 (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 );
six params, zero drama (okay maybe a little drama, it's a void function so nothing comes back, she just does the work and leaves π
).
π«Ά ARGUMENTS π«Ά
dstβ Array of BGR888 destination buffers. this is where the glow-up lands, bestie π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, the gap between rows β and if there's no gap, just passNULLand breathe πΈsrcβ Array of XRGB8888 source buffers. the before picture πfbβ DRM framebuffer. the main character of this whole operation πclipβ Clip rectangle area to copy. only this lil window gets copied, periodt βοΈstateβ Transform and conversion state. the behind-the-scenes lore π¦
π DESCRIPTION π
so what she actually does: this function copies parts of a framebuffer to display memory and converts the color format during the process. like a two-in-one, highkey efficient, we love to see it π₯
Destination and framebuffer formats must match. not "should", must β this is not a drill π¨
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 like, keep your arrays long enough for every plane, and keep the indices lined up β same index, same plane, no mixing π§
β οΈ heads up bestie: this function does not apply clipping ondst(i.e. the destination is at the top-left corner). so the clipping already happened conceptually βdststarts at the top-left corner and she just writes. don't expect extra clipping magic on the destination side, okay? π
Drivers can use this function for BGR888 devices that don't natively support XRGB8888. literally built for the devices that can't speak XRGB8888 natively β she translates, she slays π
π SEE ALSO π
the whole friend group, fr fr β you're gonna want to know all of them:
- Kernel file
./drivers/gpu/drm/drm_format_helper.c 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_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)
and that's the page, bestie π«Ά this one ships out of ./drivers/gpu/drm, dated October 2026, and it's the Kernel API Manual's own drm_fb_xrgb8888_to_bgr888(9) β go convert something iconic π
β¨
π¦ 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