drm_fb_xrgb8888_to_rgb888(9)
π drm_fb_xrgb8888_to_rgb888 β like, the Kernel API Manual page you didn't know you needed
okay so bestie, welcome to the glow-up zone: this is drm_fb_xrgb8888_to_rgb888(9), and it is literally the function that takes your fancy-pants XRGB8888 pixels and serves them as RGB888. iconic behavior. let's get into it π
β¨ NAME β¨
drm_fb_xrgb8888_to_rgb888 β convert XRGB8888 to RGB888 clip buffer. that's the whole vibe. no cap. π
πΈ SYNOPSIS πΈ
void drm_fb_xrgb8888_to_rgb888 (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 );
like, look at her. six parameters, zero notes. she's booked and busy π«Ά
π¦ ARGUMENTS π¦
dstβ array of RGB888 destination buffers. the place the pixels are going, basically their new apartment π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 if your rows are all cozy and adjacent, you can just passNULLand skip the math, ngl that's a servesrcβ array of XRGB8888 source buffers. the originals, the main characters before the makeover β¨fbβ DRM framebuffer. the framebuffer in question, your honor πclipβ clip rectangle area to copy. this is the lil window of pixels we're actually touching, keep your hands inside the ride π’stateβ transform and conversion state. the bookkeeping bestie that remembers what happened during the transform π
π₯ DESCRIPTION π₯
okay so what she does: this function copies parts of a framebuffer to display memory and converts the color format during the process. two jobs, one function, she's multitasking and honestly? obsessed.
β οΈ note it: destination and framebuffer formats must match. that's the rule, fr fr, don't come crying to me if you fudge it
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. and each entry stores the value for the format's respective color plane at the same index. so like, index 0 talks to index 0, index 1 talks to index 1 β everybody finds their match, it's giving soulmate energy π₯°
also important, and I need you to hear this: this function does not apply clipping on dst (i.e. the destination is at the top-left corner). she just drops it in the corner and walks away. no offset, no drama, top-left periodt π
and the actual use case: drivers can use this function for RGB888 devices that don't natively support XRGB8888. so if your hardware is like "XRGB8888? never heard of her" β that's literally why this exists. you're so welcome π
π SEE ALSO π
the whole friend group, and yes you will be meeting 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_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, that's the page, bestie. you're gonna go convert some pixels and you're gonna slay doing it π β¨
<x-purple>mwah π β signed off from ./drivers/gpu/drm, dated October 2026, living under the Kernel API Manual banner, and this diva's name is drm_fb_xrgb8888_to_rgb888(9). periodt. π</x-purple>
π¦ 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