CMD_INFO = 12,
CMD_CHANGE = 13,
-#ifdef CONFIG_FEATURE_FBSET_FANCY
+#if ENABLE_FEATURE_FBSET_FANCY
CMD_XRES = 100,
CMD_YRES = 101,
CMD_VXRES = 102,
{ "-laced", 1, CMD_LACED },
{ "-double", 1, CMD_DOUBLE },
{ "-n", 0, CMD_CHANGE },
-#ifdef CONFIG_FEATURE_FBSET_FANCY
+#if ENABLE_FEATURE_FBSET_FANCY
{ "-all", 0, CMD_ALL },
{ "-xres", 1, CMD_XRES },
{ "-yres", 1, CMD_YRES },
{ "", 0, 0 }
};
-#ifdef CONFIG_FEATURE_FBSET_READMODE
+#if ENABLE_FEATURE_FBSET_READMODE
/* taken from linux/fb.h */
enum {
FB_VMODE_INTERLACED = 1, /* interlaced */
static int readmode(struct fb_var_screeninfo *base, const char *fn,
const char *mode)
{
-#ifdef CONFIG_FEATURE_FBSET_READMODE
+#if ENABLE_FEATURE_FBSET_READMODE
FILE *f;
char buf[256];
char *p = buf;
vrate = hrate / (v->upper_margin + v->yres + v->lower_margin + v->vsync_len);
}
printf("\nmode \"%ux%u-%u\"\n"
-#ifdef CONFIG_FEATURE_FBSET_FANCY
+#if ENABLE_FEATURE_FBSET_FANCY
"\t# D: %.3f MHz, H: %.3f kHz, V: %.3f Hz\n"
#endif
"\tgeometry %u %u %u %u %u\n"
"\trgba %u/%u,%u/%u,%u/%u,%u/%u\n"
"endmode\n\n",
v->xres, v->yres, (int) (vrate + 0.5),
-#ifdef CONFIG_FEATURE_FBSET_FANCY
+#if ENABLE_FEATURE_FBSET_FANCY
drate / 1e6, hrate / 1e3, vrate,
#endif
v->xres, v->yres, v->xres_virtual, v->yres_virtual, v->bits_per_pixel,
case CMD_CHANGE:
g_options |= OPT_CHANGE;
break;
-#ifdef CONFIG_FEATURE_FBSET_FANCY
+#if ENABLE_FEATURE_FBSET_FANCY
case CMD_XRES:
varset.xres = xatou32(argv[1]);
break;
}
fh = xopen(fbdev, O_RDONLY);
- if (ioctl(fh, FBIOGET_VSCREENINFO, &var))
- bb_perror_msg_and_die("ioctl(%sT_VSCREENINFO)", "GE");
+ xioctl(fh, FBIOGET_VSCREENINFO, &var);
if (g_options & OPT_READMODE) {
if (!readmode(&var, modefile, mode)) {
bb_error_msg_and_die("unknown video mode '%s'", mode);
if (g_options & OPT_CHANGE) {
if (g_options & OPT_ALL)
var.activate = FB_ACTIVATE_ALL;
- if (ioctl(fh, FBIOPUT_VSCREENINFO, &var))
- bb_perror_msg_and_die("ioctl(%sT_VSCREENINFO)", "PU");
+ xioctl(fh, FBIOPUT_VSCREENINFO, &var);
}
showmode(&var);
/* Don't close the file, as exiting will take care of that */