drm_fb_xrgb8888_to_rgba5551(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 within dst. can be NULL if 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:

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