Mercurial > hg > Game > Cerium
annotate old/framebuffer/fb_info.c @ 1251:6da91e7cbffb draft
improve create From COLLADA
author | Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 11 Nov 2011 18:17:26 +0900 |
parents | 8fe33c0c2b8f |
children |
rev | line source |
---|---|
977
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 // fbinfo.c |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 // |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 // Copyright (c) 2006, Mike Acton <macton@cellperformance.com> |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 // |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 // documentation files (the "Software"), to deal in the Software without restriction, including without |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 // limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 // the Software, and to permit persons to whom the Software is furnished to do so, subject to the following |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 // conditions: |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 // |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 // The above copyright notice and this permission notice shall be included in all copies or substantial |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 // portions of the Software. |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 // |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 // EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 // AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 // OR OTHER DEALINGS IN THE SOFTWARE. |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 #include <stdio.h> |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 #include <fcntl.h> |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 #include <unistd.h> |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 #include <stdint.h> |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 #include <sys/ioctl.h> |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 #include <linux/fb.h> |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 #include <asm/ps3fb.h> |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 int |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 main( void ) |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 const int fb_file = open( "/dev/fb0", O_RDWR ); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 const int open_fb_error = (fb_file >> ((sizeof(int)*8)-1)); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34 if ( open_fb_error < 0 ) |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 printf("Could not open /dev/fb0. Check permissions\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37 return (-1); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 struct fb_vblank vblank; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41 |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 int get_vblank_error = ioctl(fb_file, FBIOGET_VBLANK, (unsigned long)&vblank); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43 |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 if ( get_vblank_error == -1 ) |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
45 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
46 printf("Warning: FBIOGET_VBLANK Failed\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
47 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
48 else |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
49 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
50 printf("FBIOGET_VBLANK:\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
51 printf(" flags:\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
52 printf(" FB_VBLANK_VBLANKING : %s\n",(vblank.flags&FB_VBLANK_VBLANKING) ?"TRUE":"FALSE"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
53 printf(" FB_VBLANK_HBLANKING : %s\n",(vblank.flags&FB_VBLANK_HBLANKING) ?"TRUE":"FALSE"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
54 printf(" FB_VBLANK_HAVE_VBLANK : %s\n",(vblank.flags&FB_VBLANK_HAVE_VBLANK)?"TRUE":"FALSE"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
55 printf(" FB_VBLANK_HAVE_HBLANK : %s\n",(vblank.flags&FB_VBLANK_HAVE_HBLANK)?"TRUE":"FALSE"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
56 printf(" FB_VBLANK_HAVE_COUNT : %s\n",(vblank.flags&FB_VBLANK_HAVE_COUNT) ?"TRUE":"FALSE"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
57 printf(" FB_VBLANK_HAVE_VCOUNT : %s\n",(vblank.flags&FB_VBLANK_HAVE_VCOUNT)?"TRUE":"FALSE"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
58 printf(" FB_VBLANK_HAVE_HCOUNT : %s\n",(vblank.flags&FB_VBLANK_HAVE_HCOUNT)?"TRUE":"FALSE"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
59 printf(" FB_VBLANK_VSYNCING : %s\n",(vblank.flags&FB_VBLANK_VSYNCING) ?"TRUE":"FALSE"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
60 printf(" FB_VBLANK_HAVE_VSYNC : %s\n",(vblank.flags&FB_VBLANK_HAVE_VSYNC) ?"TRUE":"FALSE"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
61 printf(" count : %d\n", vblank.count ); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
62 printf(" vcount : %d\n", vblank.vcount ); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
63 printf(" hcount : %d\n", vblank.hcount ); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
64 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
65 printf("-------------------------------------\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
66 |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67 struct fb_fix_screeninfo fscreeninfo; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
68 |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69 int get_fscreeninfo_error = ioctl(fb_file, FBIOGET_FSCREENINFO, (unsigned long)&fscreeninfo); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
70 |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
71 if ( get_fscreeninfo_error == -1 ) |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
72 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
73 printf("Warning: FBIOGET_FSCREENINFO Failed\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
74 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
75 else |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
76 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
77 printf("FBIOGET_FSCREENINFO:\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
78 printf(" id : \"" "%c%c%c%c" "%c%c%c%c" "%c%c%c%c" "%c%c%c%c" "\"\n", |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
79 fscreeninfo.id[0], fscreeninfo.id[1], fscreeninfo.id[2], fscreeninfo.id[3], |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
80 fscreeninfo.id[4], fscreeninfo.id[5], fscreeninfo.id[6], fscreeninfo.id[7], |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
81 fscreeninfo.id[8], fscreeninfo.id[9], fscreeninfo.id[10], fscreeninfo.id[11], |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
82 fscreeninfo.id[12], fscreeninfo.id[13], fscreeninfo.id[14], fscreeninfo.id[15] ); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
83 if ( sizeof(unsigned long) == 4 ) |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
84 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
85 printf(" smem_start : 0x%08x\n", (unsigned int)fscreeninfo.smem_start); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
86 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
87 else if ( sizeof(unsigned long) == 8 ) |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
89 union UL64 { uint32_t u32[2]; uint64_t u64; } smem_start = {.u64=fscreeninfo.smem_start}; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
90 printf(" smem_start : 0x%08x_%08x\n",smem_start.u32[1],smem_start.u32[0]); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
91 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
92 else |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
93 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
94 printf("WTF! sizeof(unsigned long) = %d\n",sizeof(unsigned long)); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
95 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
96 printf(" smem_len : %u\n", fscreeninfo.smem_len); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
97 printf(" type : "); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
98 switch (fscreeninfo.type) |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
99 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
100 case FB_TYPE_PACKED_PIXELS: printf("FB_TYPE_PACKED_PIXELS (0)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
101 case FB_TYPE_PLANES: printf("FB_TYPE_PLANES (1)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
102 case FB_TYPE_INTERLEAVED_PLANES: printf("FB_TYPE_INTERLEAVED_PLANES (2)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
103 case FB_TYPE_TEXT: printf("FB_TYPE_TEXT (3)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
104 case FB_TYPE_VGA_PLANES: printf("FB_TYPE_VGA_PLANES (4)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
105 default: printf("UNKNOWN (See /usr/include/linux/fb.h)\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
106 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
107 printf(" type_aux : "); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
108 if ( fscreeninfo.type == FB_TYPE_TEXT ) |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
109 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
110 switch (fscreeninfo.type_aux) |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
111 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
112 case FB_AUX_TEXT_MDA: printf("FB_AUX_TEXT_MDA (0)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
113 case FB_AUX_TEXT_CGA: printf("FB_AUX_TEXT_CGA (1)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
114 case FB_AUX_TEXT_S3_MMIO: printf("FB_AUX_TEXT_S3_MMIO (2)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
115 case FB_AUX_TEXT_MGA_STEP16: printf("FB_AUX_TEXT_MGA_STEP16 (3)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
116 case FB_AUX_TEXT_MGA_STEP8: printf("FB_AUX_TEXT_MGA_STEP8 (4)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
117 default: printf("UNKNOWN (See /usr/include/linux/fb.h)\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
118 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
119 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
120 else if ( fscreeninfo.type == FB_TYPE_INTERLEAVED_PLANES ) |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
121 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
122 switch (fscreeninfo.type_aux) |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
123 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
124 case FB_AUX_VGA_PLANES_VGA4: printf("FB_AUX_VGA_PLANES_VGA4 (0)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
125 case FB_AUX_VGA_PLANES_CFB4: printf("FB_AUX_VGA_PLANES_CFB4 (1)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
126 case FB_AUX_VGA_PLANES_CFB8: printf("FB_AUX_VGA_PLANES_CFB8 (2)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
127 default: printf("UNKNOWN (See /usr/include/linux/fb.h)\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
128 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
129 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
130 else |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
131 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
132 printf("N/A\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
133 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
134 |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
135 printf(" visual : "); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
136 switch (fscreeninfo.visual) |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
137 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
138 case FB_VISUAL_MONO01: printf("FB_VISUAL_MONO01 (0)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
139 case FB_VISUAL_MONO10: printf("FB_VISUAL_MONO10 (1)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
140 case FB_VISUAL_TRUECOLOR: printf("FB_VISUAL_TRUECOLOR (2)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
141 case FB_VISUAL_PSEUDOCOLOR: printf("FB_VISUAL_PSEUDOCOLOR (3)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
142 case FB_VISUAL_DIRECTCOLOR: printf("FB_VISUAL_DIRECTCOLOR (4)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
143 case FB_VISUAL_STATIC_PSEUDOCOLOR: printf("FB_VISUAL_STATIC_PSEUDOCOLOR (5)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
144 default: printf("UNKNOWN (See /usr/include/linux/fb.h)\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
145 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
146 |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
147 printf(" xpanstep : %u\n", fscreeninfo.xpanstep); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
148 printf(" ypanstep : %u\n", fscreeninfo.ypanstep); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
149 printf(" ywrapstep : %u\n", fscreeninfo.ywrapstep); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
150 printf(" line_length : %u\n", fscreeninfo.line_length); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
151 if ( sizeof(unsigned long) == 4 ) |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
152 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
153 printf(" mmio_start : 0x%08x\n", (unsigned int)fscreeninfo.mmio_start); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
154 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
155 else if ( sizeof(unsigned long) == 8 ) |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
156 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
157 union UL64 { uint32_t u32[2]; uint64_t u64; } mmio_start = {.u64=fscreeninfo.mmio_start}; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
158 printf(" mmio_start : 0x%08x_%08x\n",mmio_start.u32[1],mmio_start.u32[0]); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
159 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
160 else |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
161 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
162 printf("WTF! sizeof(unsigned long) = %d\n",sizeof(unsigned long)); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
163 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
164 printf(" mmio_len : %u\n", fscreeninfo.mmio_len); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
165 printf(" accel : "); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
166 switch (fscreeninfo.accel) |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
167 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
168 case FB_ACCEL_NONE: printf("FB_ACCEL_NONE (0)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
169 case FB_ACCEL_ATARIBLITT: printf("FB_ACCEL_ATARIBLITT (1)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
170 case FB_ACCEL_AMIGABLITT: printf("FB_ACCEL_AMIGABLITT (2)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
171 case FB_ACCEL_S3_TRIO64: printf("FB_ACCEL_S3_TRIO64 (3)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
172 case FB_ACCEL_NCR_77C32BLT: printf("FB_ACCEL_NCR_77C32BLT (4)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
173 case FB_ACCEL_S3_VIRGE: printf("FB_ACCEL_S3_VIRGE (5)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
174 case FB_ACCEL_ATI_MACH64GX: printf("FB_ACCEL_ATI_MACH64GX (6)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
175 case FB_ACCEL_DEC_TGA: printf("FB_ACCEL_DEC_TGA (7)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
176 case FB_ACCEL_ATI_MACH64CT: printf("FB_ACCEL_ATI_MACH64CT (8)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
177 case FB_ACCEL_ATI_MACH64VT: printf("FB_ACCEL_ATI_MACH64VT (9)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
178 case FB_ACCEL_ATI_MACH64GT: printf("FB_ACCEL_ATI_MACH64GT (10)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
179 case FB_ACCEL_SUN_CREATOR: printf("FB_ACCEL_SUN_CREATOR (11)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
180 case FB_ACCEL_SUN_CGSIX: printf("FB_ACCEL_SUN_CGSIX (12)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
181 case FB_ACCEL_SUN_LEO: printf("FB_ACCEL_SUN_LEO (13)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
182 case FB_ACCEL_IMS_TWINTURBO: printf("FB_ACCEL_IMS_TWINTURBO (14)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
183 case FB_ACCEL_3DLABS_PERMEDIA2: printf("FB_ACCEL_3DLABS_PERMEDIA2 (15)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
184 case FB_ACCEL_MATROX_MGA2064W: printf("FB_ACCEL_MATROX_MGA2064W (16)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
185 case FB_ACCEL_MATROX_MGA1064SG: printf("FB_ACCEL_MATROX_MGA1064SG (17)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
186 case FB_ACCEL_MATROX_MGA2164W: printf("FB_ACCEL_MATROX_MGA2164W (18)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
187 case FB_ACCEL_MATROX_MGA2164W_AGP: printf("FB_ACCEL_MATROX_MGA2164W_AGP (19)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
188 case FB_ACCEL_MATROX_MGAG100: printf("FB_ACCEL_MATROX_MGAG100 (20)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
189 case FB_ACCEL_MATROX_MGAG200: printf("FB_ACCEL_MATROX_MGAG200 (21)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
190 case FB_ACCEL_SUN_CG14: printf("FB_ACCEL_SUN_CG14 (22)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
191 case FB_ACCEL_SUN_BWTWO: printf("FB_ACCEL_SUN_BWTWO (23)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
192 case FB_ACCEL_SUN_CGTHREE: printf("FB_ACCEL_SUN_CGTHREE (24)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
193 case FB_ACCEL_SUN_TCX: printf("FB_ACCEL_SUN_TCX (25)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
194 case FB_ACCEL_MATROX_MGAG400: printf("FB_ACCEL_MATROX_MGAG400 (26)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
195 case FB_ACCEL_NV3: printf("FB_ACCEL_NV3 (27)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
196 case FB_ACCEL_NV4: printf("FB_ACCEL_NV4 (28)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
197 case FB_ACCEL_NV5: printf("FB_ACCEL_NV5 (29)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
198 case FB_ACCEL_CT_6555x: printf("FB_ACCEL_CT_6555x (30)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
199 case FB_ACCEL_3DFX_BANSHEE: printf("FB_ACCEL_3DFX_BANSHEE (31)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
200 case FB_ACCEL_ATI_RAGE128: printf("FB_ACCEL_ATI_RAGE128 (32)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
201 case FB_ACCEL_IGS_CYBER2000: printf("FB_ACCEL_IGS_CYBER2000 (33)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
202 case FB_ACCEL_IGS_CYBER2010: printf("FB_ACCEL_IGS_CYBER2010 (34)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
203 case FB_ACCEL_IGS_CYBER5000: printf("FB_ACCEL_IGS_CYBER5000 (35)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
204 case FB_ACCEL_SIS_GLAMOUR: printf("FB_ACCEL_SIS_GLAMOUR (36)\n"); break; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
205 default: printf("UNKNOWN (See /usr/include/linux/fb.h)\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
206 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
207 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
208 printf("-------------------------------------\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
209 |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
210 struct ps3fb_ioctl_res res; |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
211 |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
212 int ps3_screeninfo_error = ioctl(fb_file, PS3FB_IOCTL_SCREENINFO, (unsigned long)&res); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
213 |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
214 if ( ps3_screeninfo_error == -1 ) |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
215 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
216 printf("Warning: PS3FB_IOCTL_SCREENINFO Failed\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
217 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
218 else |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
219 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
220 printf("PS3FB_IOCTL_SCREENINFO:\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
221 printf(" xres : %u\n",res.xres); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
222 printf(" yres : %u\n",res.yres); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
223 printf(" xoff : %u\n",res.xoff); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
224 printf(" yoff : %u\n",res.yoff); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
225 printf(" num_frames : %u\n",res.num_frames); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
226 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
227 printf("-------------------------------------\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
228 |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
229 int close_fb_error = close( fb_file ); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
230 |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
231 if ( close_fb_error == -1 ) |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
232 { |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
233 printf("Warning: Could not close file handle used for /dev/fb0\n"); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
234 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
235 |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
236 return (0); |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
237 } |
8fe33c0c2b8f
add frame buffer utitilties
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
238 |