xf86drm: Add a human readable representation for format modifiers
commit67e911977fbe1f444045f59028c149a04ba29566
authorMarius Vlad <marius.vlad@collabora.com>
Mon, 1 Feb 2021 11:23:20 +0000 (1 13:23 +0200)
committerDaniel Stone <daniels@collabora.com>
Tue, 22 Jun 2021 11:16:04 +0000 (22 11:16 +0000)
tree2860b6a815e93c49977fa35ea9186501d2e6b9df
parentf287d1990b859602b0cbe50f0b903343c3b67d1a
xf86drm: Add a human readable representation for format modifiers

Introduces two new methods to retrieve a human readable representation of a
format modifier:

drmGetFormatModifierName() - returns a format modifier as a string,
from a token modifier
drmGetFormatModifierVendor() - returns the vendor as a string, from a
token modifier

and the fourcc_mod_get_vendor macro that returns the vendor.

New format modifiers added in drm_fourcc.h uapi kernel header should be
sync'ed up with libdrm and should include a human readable
representation for that format modifier, in order to display it
correctly as a string.

That happens with the help of a python script that reads up drm_fourcc
header file and outputs a static table comprised of token modifiers
alongside a vendor table (Suggested-by Simon Ser <contact@emersion.fr>).

The reason for doing it in libdrm is to have a unified place instead of each
user of libdrm having a way to keep track of the format modifiers.

With this patch, modetest has also been modified to make use of it.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
.gitlab-ci.yml
.gitlab-ci/debian-install.sh
core-symbols.txt
gen_table_fourcc.py [new file with mode: 0644]
meson.build
tests/modetest/modetest.c
xf86drm.c
xf86drm.h