drm_driver_c..._mode_format(9)
π 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:
drm_mode_legacy_fb_format(9)drm_driver_legacy_fb_format(9)drm_format_info(9)drm_get_format_info(9)drm_format_info_block_width(9)drm_format_info_block_height(9)drm_format_info_bpp(9)drm_format_info_min_pitch(9)
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
- 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