aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-07-12 23:01:04 +0000
committerEric Andersen <andersen@codepoet.org>2000-07-12 23:01:04 +0000
commit6f96e674b9176cafcc25de2a1d79d6f6d7f0e908 (patch)
treeb984e6e075873b9b6472aafb1e4a705f63b807c4
parentbe84cd4ef66f8956eb4c7ff0542fd1ba823a70e7 (diff)
downloadbusybox-w32-6f96e674b9176cafcc25de2a1d79d6f6d7f0e908.tar.gz
busybox-w32-6f96e674b9176cafcc25de2a1d79d6f6d7f0e908.tar.bz2
busybox-w32-6f96e674b9176cafcc25de2a1d79d6f6d7f0e908.zip
Patch from Jon McClintock <jonm@bluemug.com>
>The attached patch adds the ability to parse the actual mode specifier in >fbset. So now > > fbset -n 640x480-72 > >Will actually work. I don't know if I've reinvented the wheel though... -Erik
-rw-r--r--fbset.c68
-rw-r--r--util-linux/fbset.c68
2 files changed, 134 insertions, 2 deletions
diff --git a/fbset.c b/fbset.c
index 3f36a7011..9fde6a19d 100644
--- a/fbset.c
+++ b/fbset.c
@@ -158,7 +158,73 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
158 continue; /* almost, but not quite */ 158 continue; /* almost, but not quite */
159 while (!feof(f)) { 159 while (!feof(f)) {
160 fgets(buf, sizeof(buf), f); 160 fgets(buf, sizeof(buf), f);
161 if (!strstr(buf, "endmode")) 161
162 if ((p = strstr(buf, "geometry "))) {
163 p += 9;
164
165 sscanf(p, "%d %d %d %d %d",
166 &(base->xres), &(base->yres),
167 &(base->xres_virtual), &(base->yres_virtual),
168 &(base->bits_per_pixel));
169 } else if ((p = strstr(buf, "timings "))) {
170 p += 8;
171
172 sscanf(p, "%d %d %d %d %d %d %d",
173 &(base->pixclock),
174 &(base->left_margin), &(base->right_margin),
175 &(base->upper_margin), &(base->lower_margin),
176 &(base->hsync_len), &(base->vsync_len));
177 } else if ((p = strstr(buf, "laced "))) {
178 p += 6;
179
180 if (strstr(buf, "false")) {
181 base->vmode &= ~FB_VMODE_INTERLACED;
182 } else {
183 base->vmode |= FB_VMODE_INTERLACED;
184 }
185 } else if ((p = strstr(buf, "double "))) {
186 p += 7;
187
188 if (strstr(buf, "false")) {
189 base->vmode &= ~FB_VMODE_DOUBLE;
190 } else {
191 base->vmode |= FB_VMODE_DOUBLE;
192 }
193 } else if ((p = strstr(buf, "vsync "))) {
194 p += 6;
195
196 if (strstr(buf, "low")) {
197 base->sync &= ~FB_SYNC_VERT_HIGH_ACT;
198 } else {
199 base->sync |= FB_SYNC_VERT_HIGH_ACT;
200 }
201 } else if ((p = strstr(buf, "hsync "))) {
202 p += 6;
203
204 if (strstr(buf, "low")) {
205 base->sync &= ~FB_SYNC_HOR_HIGH_ACT;
206 } else {
207 base->sync |= FB_SYNC_HOR_HIGH_ACT;
208 }
209 } else if ((p = strstr(buf, "csync "))) {
210 p += 6;
211
212 if (strstr(buf, "low")) {
213 base->sync &= ~FB_SYNC_COMP_HIGH_ACT;
214 } else {
215 base->sync |= FB_SYNC_COMP_HIGH_ACT;
216 }
217 } else if ((p = strstr(buf, "extsync "))) {
218 p += 8;
219
220 if (strstr(buf, "false")) {
221 base->sync &= ~FB_SYNC_EXT;
222 } else {
223 base->sync |= FB_SYNC_EXT;
224 }
225 }
226
227 if (strstr(buf, "endmode"))
162 return 1; 228 return 1;
163 } 229 }
164 } 230 }
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 3f36a7011..9fde6a19d 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -158,7 +158,73 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
158 continue; /* almost, but not quite */ 158 continue; /* almost, but not quite */
159 while (!feof(f)) { 159 while (!feof(f)) {
160 fgets(buf, sizeof(buf), f); 160 fgets(buf, sizeof(buf), f);
161 if (!strstr(buf, "endmode")) 161
162 if ((p = strstr(buf, "geometry "))) {
163 p += 9;
164
165 sscanf(p, "%d %d %d %d %d",
166 &(base->xres), &(base->yres),
167 &(base->xres_virtual), &(base->yres_virtual),
168 &(base->bits_per_pixel));
169 } else if ((p = strstr(buf, "timings "))) {
170 p += 8;
171
172 sscanf(p, "%d %d %d %d %d %d %d",
173 &(base->pixclock),
174 &(base->left_margin), &(base->right_margin),
175 &(base->upper_margin), &(base->lower_margin),
176 &(base->hsync_len), &(base->vsync_len));
177 } else if ((p = strstr(buf, "laced "))) {
178 p += 6;
179
180 if (strstr(buf, "false")) {
181 base->vmode &= ~FB_VMODE_INTERLACED;
182 } else {
183 base->vmode |= FB_VMODE_INTERLACED;
184 }
185 } else if ((p = strstr(buf, "double "))) {
186 p += 7;
187
188 if (strstr(buf, "false")) {
189 base->vmode &= ~FB_VMODE_DOUBLE;
190 } else {
191 base->vmode |= FB_VMODE_DOUBLE;
192 }
193 } else if ((p = strstr(buf, "vsync "))) {
194 p += 6;
195
196 if (strstr(buf, "low")) {
197 base->sync &= ~FB_SYNC_VERT_HIGH_ACT;
198 } else {
199 base->sync |= FB_SYNC_VERT_HIGH_ACT;
200 }
201 } else if ((p = strstr(buf, "hsync "))) {
202 p += 6;
203
204 if (strstr(buf, "low")) {
205 base->sync &= ~FB_SYNC_HOR_HIGH_ACT;
206 } else {
207 base->sync |= FB_SYNC_HOR_HIGH_ACT;
208 }
209 } else if ((p = strstr(buf, "csync "))) {
210 p += 6;
211
212 if (strstr(buf, "low")) {
213 base->sync &= ~FB_SYNC_COMP_HIGH_ACT;
214 } else {
215 base->sync |= FB_SYNC_COMP_HIGH_ACT;
216 }
217 } else if ((p = strstr(buf, "extsync "))) {
218 p += 8;
219
220 if (strstr(buf, "false")) {
221 base->sync &= ~FB_SYNC_EXT;
222 } else {
223 base->sync |= FB_SYNC_EXT;
224 }
225 }
226
227 if (strstr(buf, "endmode"))
162 return 1; 228 return 1;
163 } 229 }
164 } 230 }