aboutsummaryrefslogtreecommitdiffstats
path: root/drmtools.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2017-04-24 10:48:14 +0200
committerGerd Hoffmann <kraxel@redhat.com>2017-04-24 10:48:14 +0200
commita45855472178e478c4cca77458542f1beec666dd (patch)
treefd6d24671edc9a796a2e19990d04e1bc434f2ebb /drmtools.c
parent7e510e53fe4c715d1a3630910136bfded41fbfbd (diff)
downloaddrminfo-a45855472178e478c4cca77458542f1beec666dd.tar.gz
more list format tweaks
Diffstat (limited to 'drmtools.c')
-rw-r--r--drmtools.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/drmtools.c b/drmtools.c
index b09bab8..8442e44 100644
--- a/drmtools.c
+++ b/drmtools.c
@@ -513,13 +513,29 @@ done:
}
void drm_print_format(FILE *fp, const struct fbformat *fmt,
- const char *pre, const char *post)
+ int indent, bool libs)
{
- fprintf(fp, "%s%-8s: [%2d:0] %-14s %-11s %-24s%s\n",
- pre,
+ fprintf(fp, "%*s%-8s: [%2d:0] %-14s %-11s %-16s",
+ indent, "",
fmt->name, fmt->bpp - 1, fmt->fields, fmt->bits,
fmt->fourcc
- ? "fourcc (addfb2), le"
- : "legacy (addfb), cpu " LE_BE("(le)", "(be)"),
- post);
+ ? "fourcc le"
+ : "legacy cpu " LE_BE("(le)", "(be)"));
+ if (libs) {
+ fprintf(fp, " %s",
+ (fmt->cairo == CAIRO_FORMAT_INVALID) ? "" : "cairo");
+ }
+ fprintf(fp, "\n");
+}
+
+void drm_print_format_hdr(FILE *fp, int indent, bool libs)
+{
+ fprintf(fp, "%*s%-8s: %-6s %-14s %-11s %-16s",
+ indent, "",
+ "name", "bpp", "fields", "bits",
+ "type endian");
+ if (libs) {
+ fprintf(fp, " libs");
+ }
+ fprintf(fp, "\n");
}