drm_driver_c..._mode_format(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_driver_color_mode_format β€” Kernel API Manual ✨

okay so bestie, we're talking about drm_driver_color_mode_format today and honestly? she's giving humble little helper that does exactly one thing and does it well. πŸŽ€


🌸 NAME 🌸

drm_driver_color_mode_format β€” compute a DRM 4CC code from a color mode ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

uint32_t drm_driver_color_mode_format (struct drm_device *dev , unsigned
int color_mode );

πŸ’– ARGUMENTS πŸ’–

  • dev β€” the DRM device, bestie. your main character. πŸ‘‘
  • color_mode β€” the command-line color mode. yes, that one. 🫢

🧚 DESCRIPTION 🧚

So what she does is: she computes a DRM 4CC pixel format code for the given color mode, and she does it using drm_driver_color_mode. no cap. πŸ”₯

The color mode is in the format used and the kernel command line β€” it packs the number of bits per pixel and the color depth into a single value. one value! iconic behavior honestly. πŸ’…

She's useful in fbdev emulation code, because that code deals in exactly those values. iykyk. 🌈

🚨 real talk though: this helper does not consider YUV or other complicated formats. nope, not her era. that means only legacy formats are supported (fmt->depth is a legacy field, fr fr), but also β€” the framebuffer emulation can only deal with such formats anyway, specifically RGB/BGA formats. so like... it works out?? πŸ’€πŸŒΈ

⭐ SEE ALSO ⭐

go read the whole friend group, they're all in the same kernel file ./drivers/gpu/drm/drm_fourcc.c:


and that's the whole page, bestie!! 🫢 it lives in ./drivers/gpu/drm, dated October 2026, and it's literally called drm_driver_c..._mode_format(9) because the title got truncated in the header and we're just rolling with it. slay. πŸ’œβœ¨

πŸ“¦ where this page comes from