Mercurial > hg > minimon
diff fbt.c @ 2:bac8ed8d6eb9
add jpeg coding and test stuff
author | Peter Meerwald <pmeerw@pmeerw.net> |
---|---|
date | Sun, 08 May 2011 18:22:22 +0200 |
parents | |
children | e8957085fe8a |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fbt.c Sun May 08 18:22:22 2011 +0200 @@ -0,0 +1,38 @@ +#include <stdlib.h> +#include <stdio.h> +#include <fcntl.h> +#include <sys/ioctl.h> + +#include "linux/fb.h" + +int main(int argc, char *argv[]) { + + int fd = open("/dev/fb0", O_RDWR); + if (fd < 0) { + perror(""); + exit(EXIT_FAILURE); + } + + struct fb_fix_screeninfo sif; + if (ioctl(fd, FBIOGET_VSCREENINFO, &sif) < 0) { + perror(""); + exit(EXIT_FAILURE); + } + + printf("id %s\n", sif.id); + printf("type %d, aux %d\n", sif.type, sif.type_aux); + printf("visual %d\n", sif.visual); + printf("accel %d\n", sif.accel); + printf("line length %d\n", sif.line_length); + + struct fb_var_screeninfo siv; + if (ioctl(fd, FBIOGET_VSCREENINFO, &siv) < 0) { + perror(""); + exit(EXIT_FAILURE); + } + + printf("res x %d y %d\n", siv.xres, siv.yres); + printf("bpp %d\n", siv.bits_per_pixel); + + exit(EXIT_SUCCESS); +}