tests/modetest: use drmGetFormatName()
authorSimon Ser <contact@emersion.fr>
Sun, 21 Aug 2022 12:18:28 +0000 (14:18 +0200)
committerSimon Ser <contact@emersion.fr>
Wed, 31 Aug 2022 06:40:49 +0000 (06:40 +0000)
Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Marius Vlad <marius.vlad@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
tests/modetest/modetest.c

index 8ff6c80..42e2d1f 100644 (file)
@@ -187,11 +187,9 @@ static bit_name_fn(mode_flag)
 
 static void dump_fourcc(uint32_t fourcc)
 {
-       printf(" %c%c%c%c",
-               fourcc,
-               fourcc >> 8,
-               fourcc >> 16,
-               fourcc >> 24);
+       char *name = drmGetFormatName(fourcc);
+       printf(" %s", name);
+       free(name);
 }
 
 static void dump_encoders(struct device *dev)