| | 1 | = 2009-02-01 = |
| | 2 | |
| | 3 | == BUGFIX: jfbterm (5) == |
| | 4 | |
| | 5 | * (續 [wiki:jazz/08-11-15 08-11-15@GMT-6 BUGFIX: jfbterm (1)]) |
| | 6 | * (續 [wiki:jazz/08-11-16 08-11-16@GMT-6 BUGFIX: jfbterm (2)]) |
| | 7 | * (續 [wiki:jazz/08-11-17 08-11-17@GMT-6 BUGFIX: jfbterm (3)]) |
| | 8 | * (續 [wiki:jazz/09-01-14 09-01-14@GMT+8 BUGFIX: jfbterm (4)]) |
| | 9 | |
| | 10 | {{{ |
| | 11 | #!C |
| | 12 | #include <unistd.h> |
| | 13 | #include <stdio.h> |
| | 14 | #include <fcntl.h> |
| | 15 | #include <linux/fb.h> // include frame buffer header files |
| | 16 | #include <sys/ioctl.h> |
| | 17 | |
| | 18 | int main(void) |
| | 19 | { |
| | 20 | int fbfd = 0 ; // frame buffer file description |
| | 21 | |
| | 22 | /* Get device independent unchangeable information about a frame buffer |
| | 23 | * device and a specific video mode by FBIOGET_FSCREENINFO ioctl. */ |
| | 24 | struct fb_fix_screeninfo finfo; |
| | 25 | |
| | 26 | fbfd = open( "/dev/fb0" , O_RDWR ); |
| | 27 | if ( !fbfd ) |
| | 28 | { |
| | 29 | printf( "Error: cannot open framebuffer device.\n" ); |
| | 30 | exit(1); |
| | 31 | } |
| | 32 | printf("The framebuffer device was opened successfully.\n"); |
| | 33 | |
| | 34 | /* Get fixed screen information */ |
| | 35 | if ( ioctl ( fbfd , FBIOGET_FSCREENINFO , &finfo ) ) |
| | 36 | { |
| | 37 | printf("Error reading fixed screen information.\n"); |
| | 38 | exit(2); |
| | 39 | } else { |
| | 40 | printf("Succesfully Read the Fixed Screen Information\n"); |
| | 41 | } |
| | 42 | |
| | 43 | printf("fb_fix_screeninfo.smem_len = %d\n", finfo.smem_len); |
| | 44 | printf("fb_fix_screeninfo.mmio_len = %d\n", finfo.mmio_len); |
| | 45 | } |
| | 46 | }}} |