drm_fb_xrgb8888_to_bgrx8888(9)
πΈ drm_fb_xrgb8888_to_bgrx8888 β Kernel API Manual β¨
Hey bestie, welcome to the drm_fb_xrgb8888_to_bgrx8888(9) page π
this is the DRM format-helper that takes your pixels from XRGB8888 and serves them up as BGRX8888, no cap. It lives in the Kernel API Manual, it's giving "quiet little helper, extremely important job," and we're gonna go through it together π«Ά
π NAME π
drm_fb_xrgb8888_to_bgrx8888 β ok so this one converts XRGB8888 to a BGRX8888 clip buffer. That's literally the whole thing, iconic.
β¨ SYNOPSIS β¨
void drm_fb_xrgb8888_to_bgrx8888 (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 );
π ARGUMENTS π
dstβ the array of BGRX8888 destination buffers. This is where the glow-up happens π¦dst_pitchβ array of numbers of bytes between the start of two consecutive scanlines withindst. Can beNULLif scanlines are stored right next to each other (snuggled up, bestie π₯Ί).srcβ array of XRGB8888 source buffer. The original, the blueprint, the before-photo.fbβ the DRM framebuffer. Main character energy, obviously πclipβ clip rectangle area to copy. This is the boundary, the rules, the "stay in your lane but make it fashion" πstateβ transform and conversion state. The vibes-and-math holder.
π DESCRIPTION π
So, what does this do? It copies parts of a framebuffer to display memory and converts the color format during the process. Like, it's multitasking β copying and converting, and honestly? Obsessed π
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 β index matching, plane matching, everything lined up in its correct spot β¨ fr fr no chaos allowed.
Heads up bestie π¨ this function does not apply clipping on dst β meaning the destination sits at the top-left corner. It's not gonna scoot itself over for you. That's your job.
Drivers can use this function for BGRX8888 devices that don't support XRGB8888 natively. So if your hardware is out here being picky about pixel order, this helper's got you π«Ά
π¦ SEE ALSO π¦
Kernel file ./drivers/gpu/drm/drm_format_helper.c β the whole ecosystem lives here π§
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_argb8888(9)drm_fb_xrgb8888_to_abgr8888(9)drm_fb_xrgb8888_to_xbgr8888(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)
A whole format-conversion friend group, and every single one of them ate π₯
That's the page bestie! π Sourced from ./drivers/gpu/drm, dated October 2026, and filed under drm_fb_xrgb8888_to_bgrx8888(9) β go forth and convert those pixels β¨ππ
π¦ 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