Leverage go-kdfs [1] to automatically generate tables (basic info
for single-plane formats, YUV list, opaque list). This allows us
to drop our manually written tables and check format info in a kdfs
viewer (the kdfs CLI or pixfmtdb) to ensure it's correct.
Add a new gen-pixel-format ninja target to regenerate tables. Tables
are checked in Git instead of being generated at build-time, so
that the kdfs CLI isn't a build-time dependency.
block_width/block_height are now never zero.
[1]: https://gitlab.freedesktop.org/emersion/go-kdf
Move this away from struct wlr_pixel_format_info. The next commit
will generate the pixel_format_info table from kdfs, computing a
compatible opaque format needs to be done separately from
retrieving pixel format metadata (and is not yet supported).
Some opaque pixel formats (nv12, p010) require per-plane bytes_per_block
info. However, it doesn't make sense to store them in
wlr_pixel_format_info, as they will never be useful (currently, this
info is used for shm, which doesn't have a concept of multi-planar
buffers.)
Let's define a separate array and function for determining whether a
pixel format has alpha.
Some formats like sub-sampled YCbCr use a block of bytes to
store the color values for more than one pixel. Update our format
table to be able to handle such formats.
We'll use this function from wlr_shm too.
Add some assertions, use int32_t (since the wire protocol uses that,
and we don't want to use 16-bit integers on exotic systems) and
switch the stride check to be overflow-safe.