diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2017-04-24 13:45:26 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2017-04-24 13:45:26 +0200 |
commit | 40df59fe9e6861849b17ca6867223e0af52916ec (patch) | |
tree | 5cb74785135b14b37ce38e4d09e7a65183aa0cfd | |
parent | 2ae3951ee349dc668ddb325e60d3d49e33dd2045 (diff) | |
download | drminfo-40df59fe9e6861849b17ca6867223e0af52916ec.tar.gz |
split drminfo output
-rw-r--r-- | drminfo.c | 46 | ||||
-rw-r--r-- | drminfo.man | 12 |
2 files changed, 49 insertions, 9 deletions
@@ -166,7 +166,7 @@ static int drm_open(int devnr) return fd; } -static void drm_info_all(int fd) +static void drm_info_misc(int fd) { char *busid; @@ -175,10 +175,6 @@ static void drm_info_all(int fd) fprintf(stdout, "busid: \"%s\"\n", busid); } fprintf(stdout, "\n"); - - drm_info_conns(fd); - drm_info_planes(fd); - drm_info_fmts(fd); } static void list_formats(FILE *fp) @@ -204,7 +200,12 @@ static void usage(FILE *fp) "options:\n" " -h print this\n" " -c <nr> pick card\n" - " -l print all known formats\n" + " -a print all card info\n" + " -m print misc card info (busid)\n" + " -o print supported outputs (crtcs)\n" + " -p print supported planes\n" + " -f print supported formats\n" + " -l list all known formats\n" "\n"); } @@ -212,9 +213,13 @@ int main(int argc, char **argv) { int card = 0; int c, fd; + bool misc = false; + bool conn = false; + bool plane = false; + bool format = false; for (;;) { - c = getopt(argc, argv, "hlc:"); + c = getopt(argc, argv, "hlamopfc:"); if (c == -1) break; switch (c) { @@ -224,6 +229,24 @@ int main(int argc, char **argv) case 'l': list_formats(stdout); exit(0); + case 'a': + misc = true; + conn = true; + plane = true; + format = true; + break; + case 'm': + misc = true; + break; + case 'o': + conn = true; + break; + case 'p': + plane = true; + break; + case 'f': + format = true; + break; case 'h': usage(stdout); exit(0); @@ -234,6 +257,13 @@ int main(int argc, char **argv) } fd = drm_open(card); - drm_info_all(fd); + if (misc) + drm_info_misc(fd); + if (conn) + drm_info_conns(fd); + if (plane) + drm_info_planes(fd); + if (format) + drm_info_fmts(fd); return 0; } diff --git a/drminfo.man b/drminfo.man index 9544d0e..e9e390b 100644 --- a/drminfo.man +++ b/drminfo.man @@ -16,8 +16,18 @@ Print usage info. .BI "-c" "\ nr" Pick card number. .TP +.B -a +Print all card info. +.B -m +Print misc card info (busid). +.B -o +Print supported outputs (crtcs). +.B -p +Print supported planes. +.B -f +Print supported framebuffer formats. .B -l -Print all known framebuffer formats. +List all known framebuffer formats. .BR drminfo supports rgb and packed yuv formats only. .SH "SEE ALSO" |