Skip to main content

framebuffer_modifier

Function framebuffer_modifier 

Source
pub fn framebuffer_modifier(device: &impl Device, modifier: u64) -> Option<u64>
Expand description

The modifier to declare when registering a framebuffer, or None to take the legacy path, which leaves the layout to the driver.

Port of upstream’s addfb2_needs_modifiers (be147be), so every import agrees on it:

  • INVALID never declares: it means “no explicit modifier”, and passing it with DRM_MODE_FB_MODIFIERS is ill-formed.
  • LINEAR declares only when the driver took DRM_CAP_ADDFB2_MODIFIERS. Drivers without it (i.MX LCDIF, tilcdc) reject the flag outright, even for linear – which is exactly their implicit layout, so the legacy path imports the same buffer. Where the cap exists it is declared, because “no modifier” there means the driver’s default, and that is not promised to be linear.
  • Anything else always declares. A driver without the cap cannot scan it out either way, and the kernel says so.