diff options
Diffstat (limited to 'fbset.c')
-rw-r--r-- | fbset.c | 94 |
1 files changed, 48 insertions, 46 deletions
@@ -36,53 +36,55 @@ | |||
36 | #define DEFAULTFBDEV "/dev/fb0" | 36 | #define DEFAULTFBDEV "/dev/fb0" |
37 | #define DEFAULTFBMODE "/etc/fb.modes" | 37 | #define DEFAULTFBMODE "/etc/fb.modes" |
38 | 38 | ||
39 | #define OPT_CHANGE 1 | 39 | static const int OPT_CHANGE = (1 << 0); |
40 | #define OPT_INFO (1 << 1) | 40 | static const int OPT_INFO = (1 << 1); |
41 | #define OPT_READMODE (1 << 2) | 41 | static const int OPT_READMODE = (1 << 2); |
42 | 42 | ||
43 | #define CMD_HELP 0 | 43 | enum { |
44 | #define CMD_FB 1 | 44 | CMD_HELP = 0, |
45 | #define CMD_DB 2 | 45 | CMD_FB = 1, |
46 | #define CMD_GEOMETRY 3 | 46 | CMD_DB = 2, |
47 | #define CMD_TIMING 4 | 47 | CMD_GEOMETRY = 3, |
48 | #define CMD_ACCEL 5 | 48 | CMD_TIMING = 4, |
49 | #define CMD_HSYNC 6 | 49 | CMD_ACCEL = 5, |
50 | #define CMD_VSYNC 7 | 50 | CMD_HSYNC = 6, |
51 | #define CMD_LACED 8 | 51 | CMD_VSYNC = 7, |
52 | #define CMD_DOUBLE 9 | 52 | CMD_LACED = 8, |
53 | /* #define CMD_XCOMPAT 10 */ | 53 | CMD_DOUBLE = 9, |
54 | #define CMD_ALL 11 | 54 | /* CMD_XCOMPAT = 10, */ |
55 | #define CMD_INFO 12 | 55 | CMD_ALL = 11, |
56 | #define CMD_CHANGE 13 | 56 | CMD_INFO = 12, |
57 | CMD_CHANGE = 13, | ||
57 | 58 | ||
58 | #ifdef BB_FEATURE_FBSET_FANCY | 59 | #ifdef BB_FEATURE_FBSET_FANCY |
59 | #define CMD_XRES 100 | 60 | CMD_XRES = 100, |
60 | #define CMD_YRES 101 | 61 | CMD_YRES = 101, |
61 | #define CMD_VXRES 102 | 62 | CMD_VXRES = 102, |
62 | #define CMD_VYRES 103 | 63 | CMD_VYRES = 103, |
63 | #define CMD_DEPTH 104 | 64 | CMD_DEPTH = 104, |
64 | #define CMD_MATCH 105 | 65 | CMD_MATCH = 105, |
65 | #define CMD_PIXCLOCK 106 | 66 | CMD_PIXCLOCK = 106, |
66 | #define CMD_LEFT 107 | 67 | CMD_LEFT = 107, |
67 | #define CMD_RIGHT 108 | 68 | CMD_RIGHT = 108, |
68 | #define CMD_UPPER 109 | 69 | CMD_UPPER = 109, |
69 | #define CMD_LOWER 110 | 70 | CMD_LOWER = 110, |
70 | #define CMD_HSLEN 111 | 71 | CMD_HSLEN = 111, |
71 | #define CMD_VSLEN 112 | 72 | CMD_VSLEN = 112, |
72 | #define CMD_CSYNC 113 | 73 | CMD_CSYNC = 113, |
73 | #define CMD_GSYNC 114 | 74 | CMD_GSYNC = 114, |
74 | #define CMD_EXTSYNC 115 | 75 | CMD_EXTSYNC = 115, |
75 | #define CMD_BCAST 116 | 76 | CMD_BCAST = 116, |
76 | #define CMD_RGBA 117 | 77 | CMD_RGBA = 117, |
77 | #define CMD_STEP 118 | 78 | CMD_STEP = 118, |
78 | #define CMD_MOVE 119 | 79 | CMD_MOVE = 119, |
79 | #endif | 80 | #endif |
81 | }; | ||
80 | 82 | ||
81 | static unsigned int g_options = 0; | 83 | static unsigned int g_options = 0; |
82 | 84 | ||
83 | /* Stuff stolen from the kernel's fb.h */ | 85 | /* Stuff stolen from the kernel's fb.h */ |
84 | #define FBIOGET_VSCREENINFO 0x4600 | 86 | static const int FBIOGET_VSCREENINFO = 0x4600; |
85 | #define FBIOPUT_VSCREENINFO 0x4601 | 87 | static const int FBIOPUT_VSCREENINFO = 0x4601; |
86 | #define __u32 unsigned int | 88 | #define __u32 unsigned int |
87 | struct fb_bitfield { | 89 | struct fb_bitfield { |
88 | __u32 offset; /* beginning of bitfield */ | 90 | __u32 offset; /* beginning of bitfield */ |
@@ -180,12 +182,12 @@ struct cmdoptions_t { | |||
180 | 182 | ||
181 | #ifdef BB_FEATURE_FBSET_READMODE | 183 | #ifdef BB_FEATURE_FBSET_READMODE |
182 | /* taken from linux/fb.h */ | 184 | /* taken from linux/fb.h */ |
183 | #define FB_VMODE_INTERLACED 1 /* interlaced */ | 185 | static const int FB_VMODE_INTERLACED = 1; /* interlaced */ |
184 | #define FB_VMODE_DOUBLE 2 /* double scan */ | 186 | static const int FB_VMODE_DOUBLE = 2; /* double scan */ |
185 | #define FB_SYNC_HOR_HIGH_ACT 1 /* horizontal sync high active */ | 187 | static const int FB_SYNC_HOR_HIGH_ACT = 1; /* horizontal sync high active */ |
186 | #define FB_SYNC_VERT_HIGH_ACT 2 /* vertical sync high active */ | 188 | static const int FB_SYNC_VERT_HIGH_ACT = 2; /* vertical sync high active */ |
187 | #define FB_SYNC_EXT 4 /* external sync */ | 189 | static const int FB_SYNC_EXT = 4; /* external sync */ |
188 | #define FB_SYNC_COMP_HIGH_ACT 8 /* composite sync high active */ | 190 | static const int FB_SYNC_COMP_HIGH_ACT = 8; /* composite sync high active */ |
189 | #endif | 191 | #endif |
190 | static int readmode(struct fb_var_screeninfo *base, const char *fn, | 192 | static int readmode(struct fb_var_screeninfo *base, const char *fn, |
191 | const char *mode) | 193 | const char *mode) |