X2RGB10 tested on both Intel Gen9 and AMD Polaris 11. NV12 tested on
Intel Gen9 only - since it has multiple planes, this requires GetFB2.
Also add some comments to split the list up a bit.
The most useful feature here is the ability to automatically extract the
framebuffer format and modifiers. It also makes support for multi-plane
framebuffers possible, though none are added to the format table in this
patch.
This requires libdrm 2.4.101 (from April 2020) to build, so it includes a
configure check to allow compatibility with existing distributions. Even
with libdrm support, it still won't do anything at runtime if you are
running Linux < 5.7 (before June 2020).
All DRM formats are defined in terms of little-endian words, so RGB formats
like XRGB actually have the elements in the opposite order order in memory
to the order they are in the name.
This does not affect YUYV and similar YUV 4:2:2 formats, which are in the
expected order.
DRM_FORMAT_R8 was added in libdrm 2.4.68.
DRM_FORMAT_R16 was added in libdrm 2.4.82.
Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>