How do we want to specify formats?
Created by: jekstrand
There are a few possibilites here. (Thanks to @robclark for the write-up. I'm mostly just moving it to github.):
- fourcc:
- Simple and already used in many places (drm/kms, egl dmabuf extensions, v4l, etc)
- Should be sufficient to describe anything that can be shared between multiple different gbm2_backends (ie. between scanout, gl/vk, camera, vidc, etc)
- Khronos dataformat spec:
- is more expressive than fourcc.. fourcc is not sufficient for describing “advanced” textures (mipmap levels + array and/or 3d, for example)..
- This case is less likely to be involved in cross-device sharing, but could be used in cross-api sharing (ie. interop between $vendor’s gl and vk driver)
- note that the interop case includes sharing between different versions of $vendor’s gl/vk driver (such as different version in a container/chroot) where layout of layers/levels might have changed)?
Straw man suggestions:
- Use fourcc plus additional capabilities/constraints to fill in the gaps for gl/vk interop?
- Use dataformat plus helper lib which can be used by backend to map from
- Use fourcc together with (possibly device-specific) metadata. Types of metadata supported would be handled by constraints