Dmabuf modifier 0 (== DRM_FORMAT_MOD_LINEAR) handled wrong in several places
It's somewhat unfortunate, but the modifier 0
is actually a valid value and very common: DRM_FORMAT_MOD_LINEAR
(while at the same time also meaning DRM_FORMAT_INVALID
and DRM_FORMAT_MOD_NONE
). Probably it's even the most commonly used modifier apart from DRM_FORMAT_MOD_INVALID
(which, again somewhat counter-intuitively, usually means "implicit") and it's currently always used by libcamera. Right now there are several places such as spa_format_video_raw_build()
and spa_libcamera_enum_format()
that handle this wrong.
It's quite annoying, but there doesn't seem to a exist a usable placeholder value in drm_fourcc.h
and an extra field is likely required :(