summaryrefslogtreecommitdiff
path: root/util-linux/fbset.c
diff options
context:
space:
mode:
authorEric Andersen2000-07-12 23:01:04 +0000
committerEric Andersen2000-07-12 23:01:04 +0000
commit6f96e674b9176cafcc25de2a1d79d6f6d7f0e908 (patch)
treeb984e6e075873b9b6472aafb1e4a705f63b807c4 /util-linux/fbset.c
parentbe84cd4ef66f8956eb4c7ff0542fd1ba823a70e7 (diff)
downloadbusybox-6f96e674b9176cafcc25de2a1d79d6f6d7f0e908.zip
busybox-6f96e674b9176cafcc25de2a1d79d6f6d7f0e908.tar.gz
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
Diffstat (limited to 'util-linux/fbset.c')
-rw-r--r--util-linux/fbset.c68
1 files changed, 67 insertions, 1 deletions
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 3f36a70..9fde6a1 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,
continue; /* almost, but not quite */
while (!feof(f)) {
fgets(buf, sizeof(buf), f);
- if (!strstr(buf, "endmode"))
+
+ if ((p = strstr(buf, "geometry "))) {
+ p += 9;
+
+ sscanf(p, "%d %d %d %d %d",
+ &(base->xres), &(base->yres),
+ &(base->xres_virtual), &(base->yres_virtual),
+ &(base->bits_per_pixel));
+ } else if ((p = strstr(buf, "timings "))) {
+ p += 8;
+
+ sscanf(p, "%d %d %d %d %d %d %d",
+ &(base->pixclock),
+ &(base->left_margin), &(base->right_margin),
+ &(base->upper_margin), &(base->lower_margin),
+ &(base->hsync_len), &(base->vsync_len));
+ } else if ((p = strstr(buf, "laced "))) {
+ p += 6;
+
+ if (strstr(buf, "false")) {
+ base->vmode &= ~FB_VMODE_INTERLACED;
+ } else {
+ base->vmode |= FB_VMODE_INTERLACED;
+ }
+ } else if ((p = strstr(buf, "double "))) {
+ p += 7;
+
+ if (strstr(buf, "false")) {
+ base->vmode &= ~FB_VMODE_DOUBLE;
+ } else {
+ base->vmode |= FB_VMODE_DOUBLE;
+ }
+ } else if ((p = strstr(buf, "vsync "))) {
+ p += 6;
+
+ if (strstr(buf, "low")) {
+ base->sync &= ~FB_SYNC_VERT_HIGH_ACT;
+ } else {
+ base->sync |= FB_SYNC_VERT_HIGH_ACT;
+ }
+ } else if ((p = strstr(buf, "hsync "))) {
+ p += 6;
+
+ if (strstr(buf, "low")) {
+ base->sync &= ~FB_SYNC_HOR_HIGH_ACT;
+ } else {
+ base->sync |= FB_SYNC_HOR_HIGH_ACT;
+ }
+ } else if ((p = strstr(buf, "csync "))) {
+ p += 6;
+
+ if (strstr(buf, "low")) {
+ base->sync &= ~FB_SYNC_COMP_HIGH_ACT;
+ } else {
+ base->sync |= FB_SYNC_COMP_HIGH_ACT;
+ }
+ } else if ((p = strstr(buf, "extsync "))) {
+ p += 8;
+
+ if (strstr(buf, "false")) {
+ base->sync &= ~FB_SYNC_EXT;
+ } else {
+ base->sync |= FB_SYNC_EXT;
+ }
+ }
+
+ if (strstr(buf, "endmode"))
return 1;
}
}