drm_fb_xrgb8888_to_rgb332(9)
π drm_fb_xrgb8888_to_rgb332(9) β like, the Kernel API Manual, bestie β¨
Okay so picture this: it's giving kernel graphics era, and this little icon is literally the whole drm_fb_xrgb8888_to_rgb332 moment from the Kernel API Manual. It's a function, it converts colours, and it's about to eat. π
πΈ NAME πΈ
drm_fb_xrgb8888_to_rgb332 β the glow-up that turns XRGB8888 into an RGB332 clip buffer π
β¨ SYNOPSIS β¨
void drm_fb_xrgb8888_to_rgb332 (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 );
No cap, that's the whole signature. Six parameters, zero notes. π«Ά
π¦ ARGUMENTS π¦
Like, let's meet the cast. Main character energy only:
dstβ an array of RGB332 destination buffers. This is where the converted pixels are gonna land, slay.dst_pitchβ an array of numbers of bytes between the start of two consecutive scanlines withindst; can beNULLif scanlines are stored next to each other. So like, optional spacing, iykyk.srcβ an array of XRGB8888 source buffers. The original, the blueprint, the before picture πfbβ the DRM framebuffer. Yes bestie, that one.clipβ the clip rectangle area to copy. Boundaries are self-care, periodt.stateβ transform and conversion state. It's carrying the whole vibe check through the conversion π
π DESCRIPTION π
So what does this thing even do? It copies parts of a framebuffer to display memory and converts the colour format during the process. Two jobs, one function, highkey iconic. π₯
Important: destination and framebuffer formats must match. Fr fr, no mixing.
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 colour plane at the same index. That's the whole assignment, bestie β everything lines up by position. β¨
β οΈ Heads up: this function does not apply clipping on dst β i.e. the destination is at the top-left corner. No fancy offsetting, it just goes straight there. π
Drivers can use this function for RGB332 devices that don't support XRGB8888 natively. So if your hardware is out here living that RGB332 life and can't handle XRGB8888, this is literally your girl. π
π SEE ALSO π
Kernel file: ./drivers/gpu/drm/drm_format_helper.c
And the whole friend group β go say hi, they're all iconic:
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_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)
π that's the whole page, bestie π
This masterpiece lives in ./drivers/gpu/drm, stamped October 2026, and it's signed off from drm_fb_xrgb8888_to_rgb332(9) with love. Go convert something cute today. π¦πΈπ
π¦ 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