diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2017-04-24 10:34:57 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2017-04-24 10:34:57 +0200 |
commit | 7e510e53fe4c715d1a3630910136bfded41fbfbd (patch) | |
tree | b4748a55aa4ba7514c185301c8bfc019ff9d499d /drmtools.c | |
parent | 34cd7ded2cf9ffe5ce90f1c15b804bf3bf53dcd5 (diff) | |
download | drminfo-7e510e53fe4c715d1a3630910136bfded41fbfbd.tar.gz |
list format tweaks
Diffstat (limited to 'drmtools.c')
-rw-r--r-- | drmtools.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -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); } |