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:
INVALIDnever declares: it means “no explicit modifier”, and passing it withDRM_MODE_FB_MODIFIERSis ill-formed.LINEARdeclares only when the driver tookDRM_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.