From ce94df99dba97a671335d350d6bb617f068097cc Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 25 Feb 2019 09:00:49 +0100 Subject: fbinfo, pixman mode, misc --- fbinfo.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 fbinfo.c (limited to 'fbinfo.c') diff --git a/fbinfo.c b/fbinfo.c new file mode 100644 index 0000000..a2b4fb3 --- /dev/null +++ b/fbinfo.c @@ -0,0 +1,65 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include "fbtools.h" + +/* ------------------------------------------------------------------ */ + +static void usage(FILE *fp) +{ + fprintf(fp, + "\n" + "usage: fbtest [ options ]\n" + "\n" + "options:\n" + " -h print this\n" + " -f pick framebuffer\n" + "\n"); +} + +int main(int argc, char **argv) +{ + int framebuffer = 0; + int c; + + for (;;) { + c = getopt(argc, argv, "hf:"); + if (c == -1) + break; + switch (c) { + case 'f': + framebuffer = atoi(optarg); + break; + case 'h': + usage(stdout); + exit(0); + default: + usage(stderr); + exit(1); + } + } + + fb_query(framebuffer); + + fprintf(stderr, "fb%d: %s, %dx%d, %d bpp, r/g/b/a %d/%d/%d/%d\n", + framebuffer, + fb_fix.id, + fb_var.xres, fb_var.yres, + fb_var.bits_per_pixel, + fb_var.red.length, + fb_var.green.length, + fb_var.blue.length, + fb_var.transp.length); + return 0; +} -- cgit