aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-09-30 16:22:59 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-09-30 16:22:59 +0000
commit274b8c0639ae3b733c63252959c3a7fa4025b5cc (patch)
tree44e1371ba02fa3956abbc650792f1b12ee452935
parent7e3eb5171b66a0d91fef01f8acb91d84980e7ad2 (diff)
downloadbusybox-w32-274b8c0639ae3b733c63252959c3a7fa4025b5cc.tar.gz
busybox-w32-274b8c0639ae3b733c63252959c3a7fa4025b5cc.tar.bz2
busybox-w32-274b8c0639ae3b733c63252959c3a7fa4025b5cc.zip
fbset: add support for -a (bug 1017)
-rw-r--r--util-linux/fbset.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 9a207b6e3..9ca3e1b64 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -21,6 +21,7 @@ enum {
21 OPT_CHANGE = (1 << 0), 21 OPT_CHANGE = (1 << 0),
22 OPT_INFO = (1 << 1), 22 OPT_INFO = (1 << 1),
23 OPT_READMODE = (1 << 2), 23 OPT_READMODE = (1 << 2),
24 OPT_ALL = (1 << 9),
24 25
25 CMD_FB = 1, 26 CMD_FB = 1,
26 CMD_DB = 2, 27 CMD_DB = 2,
@@ -63,6 +64,7 @@ enum {
63static unsigned int g_options = 0; 64static unsigned int g_options = 0;
64 65
65/* Stuff stolen from the kernel's fb.h */ 66/* Stuff stolen from the kernel's fb.h */
67#define FB_ACTIVATE_ALL 64
66enum { 68enum {
67 FBIOGET_VSCREENINFO = 0x4600, 69 FBIOGET_VSCREENINFO = 0x4600,
68 FBIOPUT_VSCREENINFO = 0x4601 70 FBIOPUT_VSCREENINFO = 0x4601
@@ -357,9 +359,12 @@ int fbset_main(int argc, char **argv)
357 varset.hsync_len = strtoul(argv[6], 0, 0); 359 varset.hsync_len = strtoul(argv[6], 0, 0);
358 varset.vsync_len = strtoul(argv[7], 0, 0); 360 varset.vsync_len = strtoul(argv[7], 0, 0);
359 break; 361 break;
360 case CMD_CHANGE: 362 case CMD_ALL:
361 g_options |= OPT_CHANGE; 363 g_options |= OPT_ALL;
362 break; 364 break;
365 case CMD_CHANGE:
366 g_options |= OPT_CHANGE;
367 break;
363#ifdef CONFIG_FEATURE_FBSET_FANCY 368#ifdef CONFIG_FEATURE_FBSET_FANCY
364 case CMD_XRES: 369 case CMD_XRES:
365 varset.xres = strtoul(argv[1], 0, 0); 370 varset.xres = strtoul(argv[1], 0, 0);
@@ -367,7 +372,7 @@ int fbset_main(int argc, char **argv)
367 case CMD_YRES: 372 case CMD_YRES:
368 varset.yres = strtoul(argv[1], 0, 0); 373 varset.yres = strtoul(argv[1], 0, 0);
369 break; 374 break;
370 case CMD_DEPTH: 375 case CMD_DEPTH:
371 varset.bits_per_pixel = strtoul(argv[1], 0, 0); 376 varset.bits_per_pixel = strtoul(argv[1], 0, 0);
372 break; 377 break;
373#endif 378#endif
@@ -392,15 +397,18 @@ int fbset_main(int argc, char **argv)
392 bb_perror_msg_and_die("fbset(ioctl)"); 397 bb_perror_msg_and_die("fbset(ioctl)");
393 if (g_options & OPT_READMODE) { 398 if (g_options & OPT_READMODE) {
394 if (!readmode(&var, modefile, mode)) { 399 if (!readmode(&var, modefile, mode)) {
395 bb_error_msg("Unknown video mode `%s'", mode); 400 bb_error_msg("unknown video mode '%s'", mode);
396 return EXIT_FAILURE; 401 return EXIT_FAILURE;
397 } 402 }
398 } 403 }
399 404
400 setmode(&var, &varset); 405 setmode(&var, &varset);
401 if (g_options & OPT_CHANGE) 406 if (g_options & OPT_CHANGE) {
407 if (g_options & OPT_ALL)
408 var.activate = FB_ACTIVATE_ALL;
402 if (ioctl(fh, FBIOPUT_VSCREENINFO, &var)) 409 if (ioctl(fh, FBIOPUT_VSCREENINFO, &var))
403 bb_perror_msg_and_die("fbset(ioctl)"); 410 bb_perror_msg_and_die("fbset(ioctl)");
411 }
404 showmode(&var); 412 showmode(&var);
405 /* Don't close the file, as exiting will take care of that */ 413 /* Don't close the file, as exiting will take care of that */
406 /* close(fh); */ 414 /* close(fh); */