aboutsummaryrefslogtreecommitdiffstats
path: root/drmtools.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2017-04-24 10:34:57 +0200
committerGerd Hoffmann <kraxel@redhat.com>2017-04-24 10:34:57 +0200
commit7e510e53fe4c715d1a3630910136bfded41fbfbd (patch)
treeb4748a55aa4ba7514c185301c8bfc019ff9d499d /drmtools.c
parent34cd7ded2cf9ffe5ce90f1c15b804bf3bf53dcd5 (diff)
downloaddrminfo-7e510e53fe4c715d1a3630910136bfded41fbfbd.tar.gz
list format tweaks
Diffstat (limited to 'drmtools.c')
-rw-r--r--drmtools.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drmtools.c b/drmtools.c
index d676b63..b09bab8 100644
--- a/drmtools.c
+++ b/drmtools.c
@@ -27,9 +27,9 @@
0 }
#if __BYTE_ORDER == __LITTLE_ENDIAN
-# define LE_BE(_le, _be) (_le)
+# define LE_BE(_le, _be) _le
#elif __BYTE_ORDER == __BIG_ENDIAN
-# define LE_BE(_le, _be) (_be)
+# define LE_BE(_le, _be) _be
#endif
const struct fbformat fmts[] = {
@@ -512,11 +512,14 @@ done:
return result;
}
-void drm_print_format(FILE *fp, const struct fbformat *fmt)
+void drm_print_format(FILE *fp, const struct fbformat *fmt,
+ const char *pre, const char *post)
{
- fprintf(fp, " %-8s: [%2d:0] %-14s %-11s %s\n",
+ fprintf(fp, "%s%-8s: [%2d:0] %-14s %-11s %-24s%s\n",
+ pre,
fmt->name, fmt->bpp - 1, fmt->fields, fmt->bits,
fmt->fourcc
- ? "fourcc (addfb2), little endian"
- : "legacy (addfb), native endian");
+ ? "fourcc (addfb2), le"
+ : "legacy (addfb), cpu " LE_BE("(le)", "(be)"),
+ post);
}