2006-08-14 03:52:11 +04:00
|
|
|
/* $NetBSD: display.c,v 1.14 2006/08/13 23:52:11 uwe Exp $ */
|
1998-12-28 17:01:16 +03:00
|
|
|
|
|
|
|
/*-
|
2004-07-30 19:22:42 +04:00
|
|
|
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
|
1998-12-28 17:01:16 +03:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
* by Juergen Hannken-Illjes.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the NetBSD
|
|
|
|
* Foundation, Inc. and its contributors.
|
|
|
|
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
|
|
* contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <sys/time.h>
|
2004-06-03 23:18:41 +04:00
|
|
|
|
2006-02-05 21:11:46 +03:00
|
|
|
#include <dev/wscons/wsconsio.h>
|
|
|
|
|
|
|
|
#include <err.h>
|
|
|
|
#include <errno.h>
|
2004-06-03 23:18:41 +04:00
|
|
|
#include <stdio.h>
|
2006-02-05 21:11:46 +03:00
|
|
|
#include <stdlib.h>
|
2004-06-03 23:18:41 +04:00
|
|
|
#include <string.h>
|
|
|
|
|
1998-12-28 17:01:16 +03:00
|
|
|
#include "wsconsctl.h"
|
|
|
|
|
Implement border color customization in wscons(4), only available for vga(4)
at the moment.
This includes the addition of two new wsdisplay ioctls, WSDISPLAY_{G,S}BORDER,
one to get the actual color and one to set it, respectively. Possible colors
match those defined by ANSI (and listed in wsdisplayvar.h).
It also adds two accessops to the underlying graphics device, getborder and
setborder, which mach their ioctl counterparts.
Two kernel options are added: WSDISPLAY_CUSTOM_BORDER, which enables the
ioctls described above (to customize the border color from userland after
boot), and WSDISPLAY_BORDER_COLOR, which sets the color at boot time.
The former is enabled by default on the GENERIC kernel, but not on INSTALL
(among others). The later is always commented out, leaving the usual black
border as a default.
wsconsctl is modified to allow accessing this value easily. For example,
'wsconsctl -d -w border=blue'.
2004-07-30 02:29:35 +04:00
|
|
|
static int border;
|
1998-12-28 17:01:16 +03:00
|
|
|
static int dpytype;
|
2002-04-07 14:40:04 +04:00
|
|
|
static struct wsdisplay_usefontdata font;
|
2005-02-27 18:26:16 +03:00
|
|
|
static struct wsdisplay_param backlight;
|
|
|
|
static struct wsdisplay_param brightness;
|
|
|
|
static struct wsdisplay_param contrast;
|
2004-05-29 01:44:15 +04:00
|
|
|
static struct wsdisplay_scroll_data scroll_l;
|
Implement support to dynamically change wscons console and kernel colors.
Two new ioctls are added to the wsdisplay device, named WSDISPLAY_GMSGATTRS
and WSDISPLAY_SMSGATTRS, used to retrieve the actual values and set them,
respectively (the name, if you are wondering, comes from "message attributes").
A new emulop is added to the underlying display driver (only vga, for now)
which sets the new attribute for the whole screen, without having to clear
it. This is optional, which means that this also works with other drivers
that don't have this new operation.
Five new kernel options have been added, although only documented in
i386 kernels (for now):
- WSDISPLAY_CUSTOM_OUTPUT, which enables the ioctls described above to
change the colors dynamically from userland. This is enabled by default
in the GENERIC kernel (as well as others) but disabled on all INSTALL*
kernels (as this feature is useless there).
- WS_DEFAULT_COLATTR, WS_DEFAULT_MONOATTR, WS_DEFAULT_BG and WS_DEFAULT_FG,
which specify the default colors for the console at boot time. These have
the same meaning as the (already existing) WS_KERNEL_* variables.
wsconsctl is modified to add msg.default.{attrs,bg,fg} and
msg.kernel.{attrs,bg,fg} to the display part, so that colors can be changed
after boot.
Tested on NetBSD/i386 with vga (and vga in mono mode), and on NetBSD/mac68k.
No objections in tech-kern@.
2004-07-28 16:34:02 +04:00
|
|
|
static int msg_default_attrs, msg_default_bg, msg_default_fg;
|
|
|
|
static int msg_kernel_attrs, msg_kernel_bg, msg_kernel_fg;
|
2006-02-18 22:35:11 +03:00
|
|
|
static int splash_enable, splash_progress;
|
1998-12-28 17:01:16 +03:00
|
|
|
|
|
|
|
struct field display_field_tab[] = {
|
2005-04-30 20:38:21 +04:00
|
|
|
{ "border", &border, FMT_COLOR, 0 },
|
1998-12-28 17:01:16 +03:00
|
|
|
{ "type", &dpytype, FMT_DPYTYPE, FLG_RDONLY },
|
2002-04-07 14:40:04 +04:00
|
|
|
{ "font", &font.name, FMT_STRING, FLG_WRONLY },
|
2005-02-27 18:26:16 +03:00
|
|
|
{ "backlight", &backlight.curval, FMT_UINT, 0 },
|
|
|
|
{ "brightness", &brightness.curval, FMT_UINT, FLG_MODIFY },
|
|
|
|
{ "contrast", &contrast.curval, FMT_UINT, FLG_MODIFY },
|
2006-02-05 21:11:46 +03:00
|
|
|
{ "scroll.fastlines", &scroll_l.fastlines, FMT_UINT, FLG_MODIFY },
|
|
|
|
{ "scroll.slowlines", &scroll_l.slowlines, FMT_UINT, FLG_MODIFY },
|
2005-04-30 20:38:21 +04:00
|
|
|
{ "msg.default.attrs", &msg_default_attrs, FMT_ATTRS, 0 },
|
|
|
|
{ "msg.default.bg", &msg_default_bg, FMT_COLOR, 0 },
|
|
|
|
{ "msg.default.fg", &msg_default_fg, FMT_COLOR, 0 },
|
|
|
|
{ "msg.kernel.attrs", &msg_kernel_attrs, FMT_ATTRS, 0 },
|
|
|
|
{ "msg.kernel.bg", &msg_kernel_bg, FMT_COLOR, 0 },
|
|
|
|
{ "msg.kernel.fg", &msg_kernel_fg, FMT_COLOR, 0 },
|
2006-08-14 03:52:11 +04:00
|
|
|
{ "splash.enable", &splash_enable, FMT_UINT, FLG_WRONLY },
|
|
|
|
{ "splash.progress", &splash_progress, FMT_UINT, FLG_WRONLY },
|
1998-12-28 17:01:16 +03:00
|
|
|
};
|
|
|
|
|
2006-02-05 21:11:46 +03:00
|
|
|
int display_field_tab_len = sizeof(display_field_tab) /
|
|
|
|
sizeof(display_field_tab[0]);
|
1998-12-28 17:01:16 +03:00
|
|
|
|
|
|
|
void
|
2005-01-19 23:37:52 +03:00
|
|
|
display_get_values(int fd)
|
1998-12-28 17:01:16 +03:00
|
|
|
{
|
2006-02-05 21:11:46 +03:00
|
|
|
|
1998-12-28 17:01:16 +03:00
|
|
|
if (field_by_value(&dpytype)->flags & FLG_GET)
|
|
|
|
if (ioctl(fd, WSDISPLAYIO_GTYPE, &dpytype) < 0)
|
2006-02-05 21:11:46 +03:00
|
|
|
err(EXIT_FAILURE, "WSDISPLAYIO_GTYPE");
|
2004-05-29 01:44:15 +04:00
|
|
|
|
Implement border color customization in wscons(4), only available for vga(4)
at the moment.
This includes the addition of two new wsdisplay ioctls, WSDISPLAY_{G,S}BORDER,
one to get the actual color and one to set it, respectively. Possible colors
match those defined by ANSI (and listed in wsdisplayvar.h).
It also adds two accessops to the underlying graphics device, getborder and
setborder, which mach their ioctl counterparts.
Two kernel options are added: WSDISPLAY_CUSTOM_BORDER, which enables the
ioctls described above (to customize the border color from userland after
boot), and WSDISPLAY_BORDER_COLOR, which sets the color at boot time.
The former is enabled by default on the GENERIC kernel, but not on INSTALL
(among others). The later is always commented out, leaving the usual black
border as a default.
wsconsctl is modified to allow accessing this value easily. For example,
'wsconsctl -d -w border=blue'.
2004-07-30 02:29:35 +04:00
|
|
|
if (field_by_value(&border)->flags & FLG_GET)
|
|
|
|
if (ioctl(fd, WSDISPLAYIO_GBORDER, &border) < 0)
|
2004-07-30 15:08:03 +04:00
|
|
|
field_disable_by_value(&border);
|
Implement border color customization in wscons(4), only available for vga(4)
at the moment.
This includes the addition of two new wsdisplay ioctls, WSDISPLAY_{G,S}BORDER,
one to get the actual color and one to set it, respectively. Possible colors
match those defined by ANSI (and listed in wsdisplayvar.h).
It also adds two accessops to the underlying graphics device, getborder and
setborder, which mach their ioctl counterparts.
Two kernel options are added: WSDISPLAY_CUSTOM_BORDER, which enables the
ioctls described above (to customize the border color from userland after
boot), and WSDISPLAY_BORDER_COLOR, which sets the color at boot time.
The former is enabled by default on the GENERIC kernel, but not on INSTALL
(among others). The later is always commented out, leaving the usual black
border as a default.
wsconsctl is modified to allow accessing this value easily. For example,
'wsconsctl -d -w border=blue'.
2004-07-30 02:29:35 +04:00
|
|
|
|
2005-02-27 18:26:16 +03:00
|
|
|
if (field_by_value(&backlight.curval)->flags & FLG_GET) {
|
|
|
|
backlight.param = WSDISPLAYIO_PARAM_BACKLIGHT;
|
|
|
|
if (ioctl(fd, WSDISPLAYIO_GETPARAM, &backlight) < 0)
|
|
|
|
field_disable_by_value(&backlight.curval);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (field_by_value(&brightness.curval)->flags & FLG_GET) {
|
|
|
|
brightness.param = WSDISPLAYIO_PARAM_BRIGHTNESS;
|
|
|
|
if (ioctl(fd, WSDISPLAYIO_GETPARAM, &brightness))
|
|
|
|
field_disable_by_value(&brightness.curval);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (field_by_value(&contrast.curval)->flags & FLG_GET) {
|
|
|
|
contrast.param = WSDISPLAYIO_PARAM_CONTRAST;
|
|
|
|
if (ioctl(fd, WSDISPLAYIO_GETPARAM, &contrast))
|
|
|
|
field_disable_by_value(&contrast.curval);
|
|
|
|
}
|
|
|
|
|
Implement support to dynamically change wscons console and kernel colors.
Two new ioctls are added to the wsdisplay device, named WSDISPLAY_GMSGATTRS
and WSDISPLAY_SMSGATTRS, used to retrieve the actual values and set them,
respectively (the name, if you are wondering, comes from "message attributes").
A new emulop is added to the underlying display driver (only vga, for now)
which sets the new attribute for the whole screen, without having to clear
it. This is optional, which means that this also works with other drivers
that don't have this new operation.
Five new kernel options have been added, although only documented in
i386 kernels (for now):
- WSDISPLAY_CUSTOM_OUTPUT, which enables the ioctls described above to
change the colors dynamically from userland. This is enabled by default
in the GENERIC kernel (as well as others) but disabled on all INSTALL*
kernels (as this feature is useless there).
- WS_DEFAULT_COLATTR, WS_DEFAULT_MONOATTR, WS_DEFAULT_BG and WS_DEFAULT_FG,
which specify the default colors for the console at boot time. These have
the same meaning as the (already existing) WS_KERNEL_* variables.
wsconsctl is modified to add msg.default.{attrs,bg,fg} and
msg.kernel.{attrs,bg,fg} to the display part, so that colors can be changed
after boot.
Tested on NetBSD/i386 with vga (and vga in mono mode), and on NetBSD/mac68k.
No objections in tech-kern@.
2004-07-28 16:34:02 +04:00
|
|
|
if (field_by_value(&msg_default_attrs)->flags & FLG_GET ||
|
|
|
|
field_by_value(&msg_default_bg)->flags & FLG_GET ||
|
|
|
|
field_by_value(&msg_default_fg)->flags & FLG_GET ||
|
|
|
|
field_by_value(&msg_kernel_attrs)->flags & FLG_GET ||
|
|
|
|
field_by_value(&msg_kernel_bg)->flags & FLG_GET ||
|
|
|
|
field_by_value(&msg_kernel_fg)->flags & FLG_GET) {
|
|
|
|
struct wsdisplay_msgattrs ma;
|
|
|
|
|
|
|
|
if (ioctl(fd, WSDISPLAYIO_GMSGATTRS, &ma) < 0) {
|
2004-07-30 15:08:03 +04:00
|
|
|
field_disable_by_value(&msg_default_attrs);
|
|
|
|
field_disable_by_value(&msg_default_bg);
|
|
|
|
field_disable_by_value(&msg_default_fg);
|
|
|
|
field_disable_by_value(&msg_kernel_attrs);
|
|
|
|
field_disable_by_value(&msg_kernel_bg);
|
|
|
|
field_disable_by_value(&msg_kernel_fg);
|
|
|
|
} else {
|
|
|
|
msg_default_attrs = ma.default_attrs;
|
|
|
|
if (ma.default_attrs & WSATTR_WSCOLORS) {
|
|
|
|
msg_default_bg = ma.default_bg;
|
|
|
|
msg_default_fg = ma.default_fg;
|
|
|
|
} else
|
|
|
|
msg_default_bg = msg_default_fg = -1;
|
|
|
|
|
|
|
|
msg_kernel_attrs = ma.kernel_attrs;
|
|
|
|
if (ma.kernel_attrs & WSATTR_WSCOLORS) {
|
|
|
|
msg_kernel_bg = ma.kernel_bg;
|
|
|
|
msg_kernel_fg = ma.kernel_fg;
|
|
|
|
} else
|
|
|
|
msg_kernel_bg = msg_kernel_fg = -1;
|
Implement support to dynamically change wscons console and kernel colors.
Two new ioctls are added to the wsdisplay device, named WSDISPLAY_GMSGATTRS
and WSDISPLAY_SMSGATTRS, used to retrieve the actual values and set them,
respectively (the name, if you are wondering, comes from "message attributes").
A new emulop is added to the underlying display driver (only vga, for now)
which sets the new attribute for the whole screen, without having to clear
it. This is optional, which means that this also works with other drivers
that don't have this new operation.
Five new kernel options have been added, although only documented in
i386 kernels (for now):
- WSDISPLAY_CUSTOM_OUTPUT, which enables the ioctls described above to
change the colors dynamically from userland. This is enabled by default
in the GENERIC kernel (as well as others) but disabled on all INSTALL*
kernels (as this feature is useless there).
- WS_DEFAULT_COLATTR, WS_DEFAULT_MONOATTR, WS_DEFAULT_BG and WS_DEFAULT_FG,
which specify the default colors for the console at boot time. These have
the same meaning as the (already existing) WS_KERNEL_* variables.
wsconsctl is modified to add msg.default.{attrs,bg,fg} and
msg.kernel.{attrs,bg,fg} to the display part, so that colors can be changed
after boot.
Tested on NetBSD/i386 with vga (and vga in mono mode), and on NetBSD/mac68k.
No objections in tech-kern@.
2004-07-28 16:34:02 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-07-30 15:08:03 +04:00
|
|
|
if (field_by_value(&scroll_l.fastlines)->flags & FLG_GET ||
|
|
|
|
field_by_value(&scroll_l.slowlines)->flags & FLG_GET) {
|
|
|
|
if (ioctl(fd, WSDISPLAYIO_DGSCROLL, &scroll_l) < 0) {
|
|
|
|
field_disable_by_value(&scroll_l.fastlines);
|
|
|
|
field_disable_by_value(&scroll_l.slowlines);
|
|
|
|
}
|
2004-06-03 23:18:41 +04:00
|
|
|
}
|
1998-12-28 17:01:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
display_put_values(fd)
|
|
|
|
int fd;
|
|
|
|
{
|
2006-02-05 21:11:46 +03:00
|
|
|
|
2002-04-07 14:40:04 +04:00
|
|
|
if (field_by_value(&font.name)->flags & FLG_SET) {
|
|
|
|
if (ioctl(fd, WSDISPLAYIO_SFONT, &font) < 0)
|
2006-02-05 21:11:46 +03:00
|
|
|
err(EXIT_FAILURE, "WSDISPLAYIO_SFONT");
|
2002-04-07 14:40:04 +04:00
|
|
|
pr_field(field_by_value(&font.name), " -> ");
|
|
|
|
}
|
Implement support to dynamically change wscons console and kernel colors.
Two new ioctls are added to the wsdisplay device, named WSDISPLAY_GMSGATTRS
and WSDISPLAY_SMSGATTRS, used to retrieve the actual values and set them,
respectively (the name, if you are wondering, comes from "message attributes").
A new emulop is added to the underlying display driver (only vga, for now)
which sets the new attribute for the whole screen, without having to clear
it. This is optional, which means that this also works with other drivers
that don't have this new operation.
Five new kernel options have been added, although only documented in
i386 kernels (for now):
- WSDISPLAY_CUSTOM_OUTPUT, which enables the ioctls described above to
change the colors dynamically from userland. This is enabled by default
in the GENERIC kernel (as well as others) but disabled on all INSTALL*
kernels (as this feature is useless there).
- WS_DEFAULT_COLATTR, WS_DEFAULT_MONOATTR, WS_DEFAULT_BG and WS_DEFAULT_FG,
which specify the default colors for the console at boot time. These have
the same meaning as the (already existing) WS_KERNEL_* variables.
wsconsctl is modified to add msg.default.{attrs,bg,fg} and
msg.kernel.{attrs,bg,fg} to the display part, so that colors can be changed
after boot.
Tested on NetBSD/i386 with vga (and vga in mono mode), and on NetBSD/mac68k.
No objections in tech-kern@.
2004-07-28 16:34:02 +04:00
|
|
|
|
Implement border color customization in wscons(4), only available for vga(4)
at the moment.
This includes the addition of two new wsdisplay ioctls, WSDISPLAY_{G,S}BORDER,
one to get the actual color and one to set it, respectively. Possible colors
match those defined by ANSI (and listed in wsdisplayvar.h).
It also adds two accessops to the underlying graphics device, getborder and
setborder, which mach their ioctl counterparts.
Two kernel options are added: WSDISPLAY_CUSTOM_BORDER, which enables the
ioctls described above (to customize the border color from userland after
boot), and WSDISPLAY_BORDER_COLOR, which sets the color at boot time.
The former is enabled by default on the GENERIC kernel, but not on INSTALL
(among others). The later is always commented out, leaving the usual black
border as a default.
wsconsctl is modified to allow accessing this value easily. For example,
'wsconsctl -d -w border=blue'.
2004-07-30 02:29:35 +04:00
|
|
|
if (field_by_value(&border)->flags & FLG_SET) {
|
|
|
|
if (ioctl(fd, WSDISPLAYIO_SBORDER, &border) < 0)
|
2006-02-05 21:11:46 +03:00
|
|
|
err(EXIT_FAILURE, "WSDISPLAYIO_SBORDER");
|
Implement border color customization in wscons(4), only available for vga(4)
at the moment.
This includes the addition of two new wsdisplay ioctls, WSDISPLAY_{G,S}BORDER,
one to get the actual color and one to set it, respectively. Possible colors
match those defined by ANSI (and listed in wsdisplayvar.h).
It also adds two accessops to the underlying graphics device, getborder and
setborder, which mach their ioctl counterparts.
Two kernel options are added: WSDISPLAY_CUSTOM_BORDER, which enables the
ioctls described above (to customize the border color from userland after
boot), and WSDISPLAY_BORDER_COLOR, which sets the color at boot time.
The former is enabled by default on the GENERIC kernel, but not on INSTALL
(among others). The later is always commented out, leaving the usual black
border as a default.
wsconsctl is modified to allow accessing this value easily. For example,
'wsconsctl -d -w border=blue'.
2004-07-30 02:29:35 +04:00
|
|
|
pr_field(field_by_value(&border), " -> ");
|
|
|
|
}
|
|
|
|
|
2005-02-27 18:26:16 +03:00
|
|
|
if (field_by_value(&backlight.curval)->flags & FLG_SET) {
|
|
|
|
backlight.param = WSDISPLAYIO_PARAM_BACKLIGHT;
|
|
|
|
if (ioctl(fd, WSDISPLAYIO_SETPARAM, &backlight) < 0)
|
2006-02-05 21:11:46 +03:00
|
|
|
err(EXIT_FAILURE, "WSDISPLAYIO_PARAM_BACKLIGHT");
|
2005-02-27 18:26:16 +03:00
|
|
|
pr_field(field_by_value(&backlight.curval), " -> ");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (field_by_value(&brightness.curval)->flags & FLG_SET) {
|
|
|
|
brightness.param = WSDISPLAYIO_PARAM_BRIGHTNESS;
|
|
|
|
if (ioctl(fd, WSDISPLAYIO_SETPARAM, &brightness) < 0)
|
2006-02-05 21:11:46 +03:00
|
|
|
err(EXIT_FAILURE, "WSDISPLAYIO_PARAM_BRIGHTNESS");
|
2005-02-27 18:26:16 +03:00
|
|
|
pr_field(field_by_value(&brightness.curval), " -> ");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (field_by_value(&contrast.curval)->flags & FLG_SET) {
|
|
|
|
contrast.param = WSDISPLAYIO_PARAM_CONTRAST;
|
|
|
|
if (ioctl(fd, WSDISPLAYIO_SETPARAM, &contrast) < 0)
|
2006-02-05 21:11:46 +03:00
|
|
|
err(EXIT_FAILURE, "WSDISPLAYIO_PARAM_CONTRAST");
|
2005-02-27 18:26:16 +03:00
|
|
|
pr_field(field_by_value(&contrast.curval), " -> ");
|
|
|
|
}
|
|
|
|
|
2006-02-18 22:35:11 +03:00
|
|
|
if (field_by_value(&splash_enable)->flags & FLG_SET) {
|
|
|
|
if (ioctl(fd, WSDISPLAYIO_SSPLASH, &splash_enable) < 0)
|
|
|
|
err(EXIT_FAILURE, "WSDISPLAYIO_SSPLASH");
|
|
|
|
pr_field(field_by_value(&splash_enable), " -> ");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (field_by_value(&splash_progress)->flags & FLG_SET) {
|
|
|
|
if (ioctl(fd, WSDISPLAYIO_SPROGRESS, &splash_progress) < 0)
|
|
|
|
err(EXIT_FAILURE, "WSDISPLAYIO_SPROGRESS");
|
|
|
|
pr_field(field_by_value(&splash_progress), " -> ");
|
|
|
|
}
|
|
|
|
|
Implement support to dynamically change wscons console and kernel colors.
Two new ioctls are added to the wsdisplay device, named WSDISPLAY_GMSGATTRS
and WSDISPLAY_SMSGATTRS, used to retrieve the actual values and set them,
respectively (the name, if you are wondering, comes from "message attributes").
A new emulop is added to the underlying display driver (only vga, for now)
which sets the new attribute for the whole screen, without having to clear
it. This is optional, which means that this also works with other drivers
that don't have this new operation.
Five new kernel options have been added, although only documented in
i386 kernels (for now):
- WSDISPLAY_CUSTOM_OUTPUT, which enables the ioctls described above to
change the colors dynamically from userland. This is enabled by default
in the GENERIC kernel (as well as others) but disabled on all INSTALL*
kernels (as this feature is useless there).
- WS_DEFAULT_COLATTR, WS_DEFAULT_MONOATTR, WS_DEFAULT_BG and WS_DEFAULT_FG,
which specify the default colors for the console at boot time. These have
the same meaning as the (already existing) WS_KERNEL_* variables.
wsconsctl is modified to add msg.default.{attrs,bg,fg} and
msg.kernel.{attrs,bg,fg} to the display part, so that colors can be changed
after boot.
Tested on NetBSD/i386 with vga (and vga in mono mode), and on NetBSD/mac68k.
No objections in tech-kern@.
2004-07-28 16:34:02 +04:00
|
|
|
if (field_by_value(&msg_default_attrs)->flags & FLG_SET ||
|
|
|
|
field_by_value(&msg_default_bg)->flags & FLG_SET ||
|
|
|
|
field_by_value(&msg_default_fg)->flags & FLG_SET ||
|
|
|
|
field_by_value(&msg_kernel_attrs)->flags & FLG_SET ||
|
|
|
|
field_by_value(&msg_kernel_bg)->flags & FLG_SET ||
|
|
|
|
field_by_value(&msg_kernel_fg)->flags & FLG_SET) {
|
|
|
|
struct wsdisplay_msgattrs ma;
|
|
|
|
|
|
|
|
if (ioctl(fd, WSDISPLAYIO_GMSGATTRS, &ma) < 0)
|
2006-02-05 21:11:46 +03:00
|
|
|
err(EXIT_FAILURE, "WSDISPLAYIO_GMSGATTRS");
|
Implement support to dynamically change wscons console and kernel colors.
Two new ioctls are added to the wsdisplay device, named WSDISPLAY_GMSGATTRS
and WSDISPLAY_SMSGATTRS, used to retrieve the actual values and set them,
respectively (the name, if you are wondering, comes from "message attributes").
A new emulop is added to the underlying display driver (only vga, for now)
which sets the new attribute for the whole screen, without having to clear
it. This is optional, which means that this also works with other drivers
that don't have this new operation.
Five new kernel options have been added, although only documented in
i386 kernels (for now):
- WSDISPLAY_CUSTOM_OUTPUT, which enables the ioctls described above to
change the colors dynamically from userland. This is enabled by default
in the GENERIC kernel (as well as others) but disabled on all INSTALL*
kernels (as this feature is useless there).
- WS_DEFAULT_COLATTR, WS_DEFAULT_MONOATTR, WS_DEFAULT_BG and WS_DEFAULT_FG,
which specify the default colors for the console at boot time. These have
the same meaning as the (already existing) WS_KERNEL_* variables.
wsconsctl is modified to add msg.default.{attrs,bg,fg} and
msg.kernel.{attrs,bg,fg} to the display part, so that colors can be changed
after boot.
Tested on NetBSD/i386 with vga (and vga in mono mode), and on NetBSD/mac68k.
No objections in tech-kern@.
2004-07-28 16:34:02 +04:00
|
|
|
|
|
|
|
if (field_by_value(&msg_default_attrs)->flags & FLG_SET) {
|
|
|
|
ma.default_attrs = msg_default_attrs;
|
|
|
|
pr_field(field_by_value(&msg_default_attrs), " -> ");
|
|
|
|
}
|
|
|
|
if (ma.default_attrs & WSATTR_WSCOLORS) {
|
|
|
|
if (field_by_value(&msg_default_bg)->flags & FLG_SET) {
|
|
|
|
ma.default_bg = msg_default_bg;
|
|
|
|
pr_field(field_by_value(&msg_default_bg),
|
2006-02-05 21:11:46 +03:00
|
|
|
" -> ");
|
Implement support to dynamically change wscons console and kernel colors.
Two new ioctls are added to the wsdisplay device, named WSDISPLAY_GMSGATTRS
and WSDISPLAY_SMSGATTRS, used to retrieve the actual values and set them,
respectively (the name, if you are wondering, comes from "message attributes").
A new emulop is added to the underlying display driver (only vga, for now)
which sets the new attribute for the whole screen, without having to clear
it. This is optional, which means that this also works with other drivers
that don't have this new operation.
Five new kernel options have been added, although only documented in
i386 kernels (for now):
- WSDISPLAY_CUSTOM_OUTPUT, which enables the ioctls described above to
change the colors dynamically from userland. This is enabled by default
in the GENERIC kernel (as well as others) but disabled on all INSTALL*
kernels (as this feature is useless there).
- WS_DEFAULT_COLATTR, WS_DEFAULT_MONOATTR, WS_DEFAULT_BG and WS_DEFAULT_FG,
which specify the default colors for the console at boot time. These have
the same meaning as the (already existing) WS_KERNEL_* variables.
wsconsctl is modified to add msg.default.{attrs,bg,fg} and
msg.kernel.{attrs,bg,fg} to the display part, so that colors can be changed
after boot.
Tested on NetBSD/i386 with vga (and vga in mono mode), and on NetBSD/mac68k.
No objections in tech-kern@.
2004-07-28 16:34:02 +04:00
|
|
|
}
|
|
|
|
if (field_by_value(&msg_default_fg)->flags & FLG_SET) {
|
|
|
|
ma.default_fg = msg_default_fg;
|
|
|
|
pr_field(field_by_value(&msg_default_fg),
|
2006-02-05 21:11:46 +03:00
|
|
|
" -> ");
|
Implement support to dynamically change wscons console and kernel colors.
Two new ioctls are added to the wsdisplay device, named WSDISPLAY_GMSGATTRS
and WSDISPLAY_SMSGATTRS, used to retrieve the actual values and set them,
respectively (the name, if you are wondering, comes from "message attributes").
A new emulop is added to the underlying display driver (only vga, for now)
which sets the new attribute for the whole screen, without having to clear
it. This is optional, which means that this also works with other drivers
that don't have this new operation.
Five new kernel options have been added, although only documented in
i386 kernels (for now):
- WSDISPLAY_CUSTOM_OUTPUT, which enables the ioctls described above to
change the colors dynamically from userland. This is enabled by default
in the GENERIC kernel (as well as others) but disabled on all INSTALL*
kernels (as this feature is useless there).
- WS_DEFAULT_COLATTR, WS_DEFAULT_MONOATTR, WS_DEFAULT_BG and WS_DEFAULT_FG,
which specify the default colors for the console at boot time. These have
the same meaning as the (already existing) WS_KERNEL_* variables.
wsconsctl is modified to add msg.default.{attrs,bg,fg} and
msg.kernel.{attrs,bg,fg} to the display part, so that colors can be changed
after boot.
Tested on NetBSD/i386 with vga (and vga in mono mode), and on NetBSD/mac68k.
No objections in tech-kern@.
2004-07-28 16:34:02 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (field_by_value(&msg_kernel_attrs)->flags & FLG_SET) {
|
|
|
|
ma.kernel_attrs = msg_kernel_attrs;
|
|
|
|
pr_field(field_by_value(&msg_kernel_attrs), " -> ");
|
|
|
|
}
|
|
|
|
if (ma.default_attrs & WSATTR_WSCOLORS) {
|
|
|
|
if (field_by_value(&msg_kernel_bg)->flags & FLG_SET) {
|
|
|
|
ma.kernel_bg = msg_kernel_bg;
|
|
|
|
pr_field(field_by_value(&msg_kernel_bg),
|
2006-02-05 21:11:46 +03:00
|
|
|
" -> ");
|
Implement support to dynamically change wscons console and kernel colors.
Two new ioctls are added to the wsdisplay device, named WSDISPLAY_GMSGATTRS
and WSDISPLAY_SMSGATTRS, used to retrieve the actual values and set them,
respectively (the name, if you are wondering, comes from "message attributes").
A new emulop is added to the underlying display driver (only vga, for now)
which sets the new attribute for the whole screen, without having to clear
it. This is optional, which means that this also works with other drivers
that don't have this new operation.
Five new kernel options have been added, although only documented in
i386 kernels (for now):
- WSDISPLAY_CUSTOM_OUTPUT, which enables the ioctls described above to
change the colors dynamically from userland. This is enabled by default
in the GENERIC kernel (as well as others) but disabled on all INSTALL*
kernels (as this feature is useless there).
- WS_DEFAULT_COLATTR, WS_DEFAULT_MONOATTR, WS_DEFAULT_BG and WS_DEFAULT_FG,
which specify the default colors for the console at boot time. These have
the same meaning as the (already existing) WS_KERNEL_* variables.
wsconsctl is modified to add msg.default.{attrs,bg,fg} and
msg.kernel.{attrs,bg,fg} to the display part, so that colors can be changed
after boot.
Tested on NetBSD/i386 with vga (and vga in mono mode), and on NetBSD/mac68k.
No objections in tech-kern@.
2004-07-28 16:34:02 +04:00
|
|
|
}
|
|
|
|
if (field_by_value(&msg_kernel_fg)->flags & FLG_SET) {
|
|
|
|
ma.kernel_fg = msg_kernel_fg;
|
|
|
|
pr_field(field_by_value(&msg_kernel_fg),
|
2006-02-05 21:11:46 +03:00
|
|
|
" -> ");
|
Implement support to dynamically change wscons console and kernel colors.
Two new ioctls are added to the wsdisplay device, named WSDISPLAY_GMSGATTRS
and WSDISPLAY_SMSGATTRS, used to retrieve the actual values and set them,
respectively (the name, if you are wondering, comes from "message attributes").
A new emulop is added to the underlying display driver (only vga, for now)
which sets the new attribute for the whole screen, without having to clear
it. This is optional, which means that this also works with other drivers
that don't have this new operation.
Five new kernel options have been added, although only documented in
i386 kernels (for now):
- WSDISPLAY_CUSTOM_OUTPUT, which enables the ioctls described above to
change the colors dynamically from userland. This is enabled by default
in the GENERIC kernel (as well as others) but disabled on all INSTALL*
kernels (as this feature is useless there).
- WS_DEFAULT_COLATTR, WS_DEFAULT_MONOATTR, WS_DEFAULT_BG and WS_DEFAULT_FG,
which specify the default colors for the console at boot time. These have
the same meaning as the (already existing) WS_KERNEL_* variables.
wsconsctl is modified to add msg.default.{attrs,bg,fg} and
msg.kernel.{attrs,bg,fg} to the display part, so that colors can be changed
after boot.
Tested on NetBSD/i386 with vga (and vga in mono mode), and on NetBSD/mac68k.
No objections in tech-kern@.
2004-07-28 16:34:02 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ioctl(fd, WSDISPLAYIO_SMSGATTRS, &ma) < 0)
|
2006-02-05 21:11:46 +03:00
|
|
|
err(EXIT_FAILURE, "WSDISPLAYIO_SMSGATTRS");
|
Implement support to dynamically change wscons console and kernel colors.
Two new ioctls are added to the wsdisplay device, named WSDISPLAY_GMSGATTRS
and WSDISPLAY_SMSGATTRS, used to retrieve the actual values and set them,
respectively (the name, if you are wondering, comes from "message attributes").
A new emulop is added to the underlying display driver (only vga, for now)
which sets the new attribute for the whole screen, without having to clear
it. This is optional, which means that this also works with other drivers
that don't have this new operation.
Five new kernel options have been added, although only documented in
i386 kernels (for now):
- WSDISPLAY_CUSTOM_OUTPUT, which enables the ioctls described above to
change the colors dynamically from userland. This is enabled by default
in the GENERIC kernel (as well as others) but disabled on all INSTALL*
kernels (as this feature is useless there).
- WS_DEFAULT_COLATTR, WS_DEFAULT_MONOATTR, WS_DEFAULT_BG and WS_DEFAULT_FG,
which specify the default colors for the console at boot time. These have
the same meaning as the (already existing) WS_KERNEL_* variables.
wsconsctl is modified to add msg.default.{attrs,bg,fg} and
msg.kernel.{attrs,bg,fg} to the display part, so that colors can be changed
after boot.
Tested on NetBSD/i386 with vga (and vga in mono mode), and on NetBSD/mac68k.
No objections in tech-kern@.
2004-07-28 16:34:02 +04:00
|
|
|
}
|
|
|
|
|
2004-07-30 15:08:03 +04:00
|
|
|
scroll_l.which = 0;
|
|
|
|
if (field_by_value(&scroll_l.fastlines)->flags & FLG_SET)
|
|
|
|
scroll_l.which |= WSDISPLAY_SCROLL_DOFASTLINES;
|
|
|
|
if (field_by_value(&scroll_l.slowlines)->flags & FLG_SET)
|
|
|
|
scroll_l.which |= WSDISPLAY_SCROLL_DOSLOWLINES;
|
|
|
|
if (scroll_l.which != 0 &&
|
|
|
|
ioctl(fd, WSDISPLAYIO_DSSCROLL, &scroll_l) < 0)
|
2006-02-05 21:11:46 +03:00
|
|
|
err(EXIT_FAILURE, "WSDISPLAYIO_DSSCROLL");
|
2004-05-29 01:44:15 +04:00
|
|
|
if (scroll_l.which & WSDISPLAY_SCROLL_DOFASTLINES)
|
|
|
|
pr_field(field_by_value(&scroll_l.fastlines), " -> ");
|
|
|
|
if (scroll_l.which & WSDISPLAY_SCROLL_DOSLOWLINES)
|
|
|
|
pr_field(field_by_value(&scroll_l.slowlines), " -> ");
|
1998-12-28 17:01:16 +03:00
|
|
|
}
|