comparison 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
comparison
equal deleted inserted replaced
1:111d4bbce605 2:bac8ed8d6eb9
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <fcntl.h>
4 #include <sys/ioctl.h>
5
6 #include "linux/fb.h"
7
8 int main(int argc, char *argv[]) {
9
10 int fd = open("/dev/fb0", O_RDWR);
11 if (fd < 0) {
12 perror("");
13 exit(EXIT_FAILURE);
14 }
15
16 struct fb_fix_screeninfo sif;
17 if (ioctl(fd, FBIOGET_VSCREENINFO, &sif) < 0) {
18 perror("");
19 exit(EXIT_FAILURE);
20 }
21
22 printf("id %s\n", sif.id);
23 printf("type %d, aux %d\n", sif.type, sif.type_aux);
24 printf("visual %d\n", sif.visual);
25 printf("accel %d\n", sif.accel);
26 printf("line length %d\n", sif.line_length);
27
28 struct fb_var_screeninfo siv;
29 if (ioctl(fd, FBIOGET_VSCREENINFO, &siv) < 0) {
30 perror("");
31 exit(EXIT_FAILURE);
32 }
33
34 printf("res x %d y %d\n", siv.xres, siv.yres);
35 printf("bpp %d\n", siv.bits_per_pixel);
36
37 exit(EXIT_SUCCESS);
38 }

Repositories maintained by Peter Meerwald, pmeerw@pmeerw.net.