drm_driver_legacy_fb_format(9)
π drm_driver_legacy_fb_format(9) π
okay so bestie, this page is straight out of the Kernel API Manual and it's literally about turning legacy vibes into a fourcc code. stay with me π
β¨ NAME β¨
drm_driver_legacy_fb_format β compute drm fourcc code from legacy description
πΈ SYNOPSIS πΈ
uint32_t drm_driver_legacy_fb_format (struct drm_device *dev , uint32_t bpp , uint32_t depth );
π¦ ARGUMENTS π¦
devβ DRM devicebppβ bits per pixelsdepthβ bit depth per pixel
π DESCRIPTION π
So what it does is compute a drm fourcc pixel format code for whatever bpp/depth values you hand it. No cap.
But here's the tea: unlike drm_mode_legacy_fb_format, this one actually looks at the driver's mode_config. And depending on the drm_mode_config.quirk_addfb_prefer_host_byte_order flag, it returns either little endian byte order or host byte order framebuffer formats. iconic behavior tbh π«Ά
π SEE ALSO π
Kernel file ./drivers/gpu/drm/drm_fourcc.c, drm_mode_legacy_fb_format(9), drm_driver_color_mode_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 π shoutout to the source ./drivers/gpu/drm, version/date October 2026, and drm_driver_legacy_fb_format(9) itself β we ate and left no crumbs ππ
π¦ 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