drm_fb_xrgb8888_to_rgba5551(9)
π drm_fb_xrgb8888_to_rgba5551(9) β like, the whole entire manual, bestie
okay so this is a page from the Kernel API Manual and it's about one (1) very specific little function that flips your XRGB8888 pixels into RGBA5551 pixels. she's niche, she's essential, she's serving format-conversion realness. let's get into it β¨
πΈ NAME πΈ
drm_fb_xrgb8888_to_rgba5551 β converts XRGB8888 into an RGBA5551 clip buffer. that's it, that's the whole vibe. π
π SYNOPSIS π
void drm_fb_xrgb8888_to_rgba5551 (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 );
look at all those parameters, she's high-maintenance but worth it π«Ά
β¨ ARGUMENTS β¨
dstβ an array of RGBA5551 destination buffers. plural. an array. don't come at her with just one buffer, ok?dst_pitchβ an array of numbers of bytes between the start of two consecutive scanlines withindst. can beNULLif the scanlines are stored right next to each other (snuggled up, love that for them).srcβ an array of XRGB8888 source buffers. this is where the pixels come from, the origin story.fbβ the DRM framebuffer. the main character, honestly. πclipβ the clip rectangle area to copy. it's giving "boundaries".stateβ the transform and conversion state. keep her around, she's holding the vibes together.
π¦ DESCRIPTION π¦
so what does she do. this function copies parts of a framebuffer to display memory and converts the color format during the process. two jobs, zero complaints. multitasking queen. π
the parameters dst, dst_pitch and src refer to arrays. and here's the rule, bestie, write it down: 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. same index, same energy, no shortcuts. 1:1 matching, periodt.
β οΈ heads up: this function does not apply clipping on dst β meaning the destination sits at the top-left corner. no centering, no vibes-based positioning, just top-left. iykyk.
drivers can use this function for RGBA5551 devices that don't support XRGB8888 natively. it sets an opaque alpha channel as part of the conversion β so like, fully opaque, no transparency games, she's solid. π
π₯ SEE ALSO π₯
the kernel file, in all her glory:
./drivers/gpu/drm/drm_format_helper.c
and now the extended friend group β every single one of them, no cap:
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_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, the whole conversion cinematic universe. π
okay that's the page!! π this masterpiece lives in ./drivers/gpu/drm and it's dated October 2026 β screenshot it, frame it, put it on your fridge. mwah πβ¨ππ§ββοΈ
π¦ 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