1 .\" $NetBSD: wsdisplay.4,v 1.33 2009/02/19 10:48:16 wiz Exp $
3 .\" Copyright (c) 1999 Matthias Drochner.
4 .\" Copyright (c) 2002 Ben Harris.
5 .\" Copyright (c) 2004 Julio M. Merino Vidal.
6 .\" All rights reserved.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
17 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .Nd generic display device support in wscons
36 .Cd "wsdisplay* at ega? console ?"
38 .Cd "wsdisplay* at vga? console ?"
39 (VGA display on ISA or PCI)
40 .Cd "wsdisplay* at pcdisplay? console ?"
41 (generic PC (ISA) display)
42 .Cd "wsdisplay* at tga? console ?"
43 (DEC TGA display, alpha only)
44 .Cd "wsdisplay* at pfb? console ?"
45 (PCI framebuffer, bebox only)
46 .Cd "wsdisplay0 at ofb? console ?"
47 (Open Firmware framebuffer, macppc only)
48 .Cd "wsdisplay* at nextdisplay? console ?"
50 .Cd "wsdisplay0 at smg0"
51 (VAXstation small monochrome display)
52 .Cd "wsdisplay* at ... kbdmux N"
54 .Cd options WSDISPLAY_BORDER_COLOR=WSCOL_XXX
55 .Cd options WSDISPLAY_CUSTOM_BORDER
56 .Cd options WSDISPLAY_CUSTOM_OUTPUT
57 .Cd options WSDISPLAY_DEFAULTSCREENS=N
58 .Cd options WSDISPLAY_SCROLLSUPPORT
62 driver is an abstraction layer for display devices within the
65 It attaches to the hardware specific display device driver and makes it
66 available as a text terminal or graphics interface.
68 A display device can have the ability to display characters on it
69 (without the help of an X server), either directly by hardware or through
70 software putting pixel data into the display memory.
71 Such displays are called
75 driver will connect a terminal emulation module and provide a tty-like
77 In contrary, non-emulating displays can only be used by special programs
82 locator in the configuration line refers to the device's use as the output
83 part of the operating system console.
84 A device specification containing a positive value here will only match if
85 the device is in use as the system console.
86 (The console device selection in early system startup is not influenced.)
87 This way, the console device can be connected to a known wsdisplay device
91 display devices are usable as console.)
95 locator in the configuration line refers to the
97 that will be used to get keyboard events.
98 If this locator is -1 no mux will be used.
100 The logical unit of an independent contents displayed on a display
101 (sometimes referred to as
106 If the underlying device driver supports it, multiple screens can
107 be used on one display.
108 (As of this writing, only the
113 display drivers provide this ability.)
114 Screens have different minor device numbers and separate tty instances.
115 One screen possesses the
117 this means it is visible and its tty device will get
119 (In some cases \- if no screen is set up or if a screen
120 was just deleted \- it is possible that no focus is present at all.)
121 The focus can be switched by either special keyboard input (typically
122 .Tn CTRL-ALT-F Ns Ar n )
123 or an ioctl command issued by a user program.
124 Screens are created and deleted through the
126 control device (preferably using the
129 Alternatively, the compile-time option
130 .Dv WSDISPLAY_DEFAULTSCREENS Ns = Ns Ar n
131 will also create (at autoconfiguration time)
133 initial screens of the display driver's default type with
134 the system's default terminal emulator.
136 The following kernel options are available to configure the behavior of the
139 .Bl -tag -width xxxxxxxx
140 .It Cd options WSDISPLAY_BORDER_COLOR=WSCOL_XXX
141 Sets the border color at boot time.
142 Possible values are defined in
143 .Pa src/sys/dev/wscons/wsdisplayvar.h .
146 .It Cd options WSDISPLAY_CUSTOM_BORDER
148 .Dv WSDISPLAYIO_GBORDER
150 .Dv WSDISPLAYIO_SBORDER
151 ioctls, which allow the customization of the border color from userland
155 .It Cd options WSDISPLAY_CUSTOM_OUTPUT
157 .Dv WSDISPLAYIO_GMSGATTRS
159 .Dv WSDISPLAYIO_SMSGATTRS
160 ioctls, which allow the customization of the console output and kernel
161 messages from userland (after boot).
164 .It Cd options WSDISPLAY_DEFAULTSCREENS=N
165 Sets the number of virtual screens to allocate at boot time.
166 Useful for small root filesystems where the
168 utility is not wanted.
169 .It Cd options WSDISPLAY_SCROLLSUPPORT
170 Enables scrolling support.
171 The key combinations are
172 .Ic LEFT SHIFT + PAGE UP
174 .Ic LEFT SHIFT + PAGE DOWN
176 Please note that this function may not work under the system console and
177 is available depending on the framebuffer you are using.
182 calls are provided by the
184 driver or by devices which use it.
185 Their definitions are found in
186 .Aq Pa dev/wscons/wsconsio.h .
188 .It Dv WSDISPLAYIO_GTYPE Pq Li int
189 Retrieve the type of the display.
190 The list of types is in
191 .Aq Pa dev/wscons/wsconsio.h .
192 .It Dv WSDISPLAYIO_GINFO Pq Li "struct wsdisplay_fbinfo"
193 Retrieve basic information about a framebuffer display.
194 The returned structure is as follows:
195 .Bd -literal -offset indent
196 struct wsdisplay_fbinfo {
208 members are counted in pixels.
211 member indicates the number of bits per pixel, and
213 indicates the number of color map entries accessible through
214 .Dv WSDISPLAYIO_GETCMAP
216 .Dv WSDISPLAYIO_PUTCMAP .
217 This call is likely to be unavailable on text-only displays.
218 .It Dv WSDISPLAYIO_GETCMAP Pq Li "struct wsdisplay_cmap"
219 Retrieve the current color map from the display.
221 following structure set up beforehand:
222 .Bd -literal -offset indent
223 struct wsdisplay_cmap {
236 members specify the range of color map entries to retrieve.
242 members should each point to an array of
245 On return, these will be filled in with the appropriate entries from the
247 On all displays that support this call, values range from 0 for minimum
248 intensity to 255 for maximum intensity, even if the display does not use
249 eight bits internally to represent intensity.
250 .It Dv WSDISPLAYIO_PUTCMAP Pq Li "struct wsdisplay_cmap"
251 Change the display's color map.
252 The argument structure is the same as for
253 .Dv WSDISPLAYIO_GETCMAP ,
259 are taken as pointers to the values to use to set the color map.
260 This call is not available on displays with fixed color maps.
261 .It Dv WSDISPLAYIO_GVIDEO Pq Li int
262 Get the current state of the display's video output.
265 .It Dv WSDISPLAYIO_VIDEO_OFF
266 The display is blanked.
267 .It Dv WSDISPLAYIO_VIDEO_ON
268 The display is enabled.
270 .It Dv WSDISPLAYIO_SVIDEO Pq Li int
271 Set the state of the display's video output.
273 .Dv WSDISPLAYIO_GVIDEO
274 above for possible values.
275 .It Dv WSDISPLAYIO_GCURPOS Pq Li "struct wsdisplay_curpos"
276 Retrieve the current position of the hardware cursor.
277 The returned structure
279 .Bd -literal -offset indent
280 struct wsdisplay_curpos {
289 members count the number of pixels right and down, respectively, from
290 the top-left corner of the display to the hot spot of the cursor.
291 This call is not available on displays without a hardware cursor.
292 .It Dv WSDISPLAYOP_SCURPOS Pq Li "struct wsdisplay_curpos"
293 Set the current cursor position.
294 The argument structure, and its semantics, are the same as for
295 .Dv WSDISPLAYIO_GCURPOS .
296 This call is not available on displays without a hardware cursor.
297 .It Dv WSDISPLAYIO_GCURMAX Pq Li "struct wsdisplay_curpos"
298 Retrieve the maximum size of cursor supported by the display.
303 members of the returned structure indicate the maximum number of pixel rows
304 and columns, respectively, in a hardware cursor on this display.
305 This call is not available on displays without a hardware cursor.
306 .It Dv WSDISPLAYIO_GCURSOR Pq Li "struct wsdisplay_cursor"
307 Retrieve some or all of the hardware cursor's attributes.
308 The argument structure is as follows:
309 .Bd -literal -offset indent
310 struct wsdisplay_cursor {
313 struct wsdisplay_curpos pos;
314 struct wsdisplay_curpos hot;
315 struct wsdisplay_cmap cmap;
316 struct wsdisplay_curpos size;
324 member indicates which of the values the application requires to be returned.
325 It should contain the logical OR of the following flags:
327 .It Dv WSDISPLAYIO_CURSOR_DOCUR
330 which indicates whether the cursor is currently displayed (non-zero) or
332 .It Dv WSDISPLAYIO_CURSOR_DOPOS
335 which indicates the current position of the cursor on the display, as
337 .Dv WSDISPLAYIO_GCURPOS .
338 .It Dv WSDISPLAYIO_CURSOR_DOHOT
341 which indicates the location of the
344 This is the point on the cursor whose position on the display is treated
345 as being the position of the cursor by other calls.
346 Its location is counted in pixels from the top-right corner of the cursor.
347 .It Dv WSDISPLAYIO_CURSOR_DOCMAP
350 which indicates the current cursor color map.
352 .Dv WSDISPLAYIO_GETCMAP ,
354 here need not have its
359 They will be set to 0 and 2 respectively by the call.
361 .Va cmap . Ns Va red ,
362 .Va cmap . Ns Va green ,
364 .Va cmap . Ns Va blue
365 must each point to at least enough space to hold two
367 .It Dv WSDISPLAYIO_CURSOR_DOSHAPE
372 These are, respectively, the dimensions of the cursor in pixels, the
373 bitmap of set pixels in the cursor and the bitmap of opaque pixels in
375 The format in which these bitmaps are returned, and hence the amount of
376 space that must be provided by the application, are device-dependent.
377 .It Dv WSDISPLAYIO_CURSOR_DOALL
378 Get all of the above.
381 The device may elect to return information that was not requested by the user,
383 .Li "struct wsdisplay_cursor"
384 which are pointers should be initialized to
386 if not otherwise used.
387 This call is not available on displays without a hardware cursor.
388 .It Dv WSDISPLAYIO_SCURSOR Pq Li "struct wsdisplay_cursor"
389 Set some or all of the hardware cursor's attributes.
390 The argument structure is the same as for
391 .Dv WSDISPLAYIO_GCURSOR .
394 member specifies which attributes of the cursor are to be changed.
395 It should contain the logical OR of the following flags:
397 .It Dv WSDISPLAYIO_CURSOR_DOCUR
400 is zero, hide the cursor.
401 Otherwise, display it.
402 .It Dv WSDISPLAYIO_CURSOR_DOPOS
403 Set the cursor's position on the display to
406 .Dv WSDISPLAYIO_SCURPOS .
407 .It Dv WSDISPLAYIO_CURSOR_DOHOT
410 of the cursor, as defined above, to
412 .It Dv WSDISPLAYIO_CURSOR_DOCMAP
413 Set some or all of the cursor color map based on
421 indicate which color map entries to set, and the entries themselves come from
422 .Va cmap . Ns Va red ,
423 .Va cmap . Ns Va green ,
425 .Va cmap . Ns Va blue .
426 .It Dv WSDISPLAYIO_CURSOR_DOSHAPE
427 Set the cursor shape from
431 See above for their meanings.
432 .It Dv WSDISPLAYIO_CURSOR_DOALL
436 This call is not available on displays without a hardware cursor.
437 .It Dv WSDISPLAYIO_GMODE Pq Li u_int
438 Get the current mode of the display.
439 Possible results include:
441 .It Dv WSDISPLAYIO_MODE_EMUL
442 The display is in emulating (text) mode.
443 .It Dv WSDISPLAYIO_MODE_MAPPED
444 The display is in mapped (graphics) mode.
445 .It Dv WSDISPLAYIO_MODE_DUMBFB
446 The display is in mapped (frame buffer) mode.
449 .It Dv WSDISPLAYIO_SMODE Pq Li u_int
450 Set the current mode of the display.
451 For possible arguments, see
452 .Dv WSDISPLAYIO_GMODE .
454 .It Dv WSDISPLAYIO_LINEBYTES Pq Li u_int
455 Get the number of bytes per row, which may be the same as the number of pixels.
456 .It Dv WSDISPLAYIO_GMSGATTRS Pq Li struct wsdisplay_msgattrs
457 Get the attributes (colors and flags) used to print console messages, including
458 separate fields for default output and kernel output.
459 The returned structure is as follows:
460 .Bd -literal -offset indent
461 struct wsdisplay_msgattrs {
462 int default_attrs, default_bg, default_fg;
463 int kernel_attrs, kernel_bg, kernel_fg;
471 variables are a combination of
473 bits, and specify the attributes used to draw messages.
480 variables specify the colors used to print messages, being
482 for the background and
484 for the foreground; their values are one of all the
487 .It Dv WSDISPLAYIO_SMSGATTRS Pq Li struct wsdisplay_msgattrs
488 Set the attributes (colors and flags) used to print console messages, including
489 separate fields for default output and kernel output.
490 The argument structure is the same as for
491 .Dv WSDISPLAYIO_GMSGATTRS .
492 .It Dv WSDISPLAYIO_GBORDER Pq Li u_int
493 Retrieve the color of the screen border.
494 This number corresponds to an ANSI standard color.
495 .It Dv WSDISPLAYIO_SBORDER Pq Li u_int
496 Set the color of the screen border, if applicable.
497 This number corresponds to an ANSI standard color.
498 Not all drivers support this feature.
499 .It Dv WSDISPLAYIO_GETWSCHAR Pq Li struct wsdisplay_char
500 Gets a single character from the screen, specified by its position.
501 The structure used is as follows:
502 .Bd -literal -offset indent
503 struct wsdisplay_char {
506 uint8_t background, foreground;
515 parameters are used as input; the rest of the structure is filled by the
516 ioctl and is returned to you.
518 is the ASCII code of the letter found at the specified position,
525 .Sq WSDISPLAY_CHAR_BRIGHT
527 .Sq WSDISPLAY_CHAR_BLINK .
528 .It Dv WSDISPLAYIO_PUTWSCHAR Pq Li struct wsdisplay_char
529 Puts a character on the screen.
530 The structure has the same meaning as described in
531 .Dv WSDISPLAY_GETWSCHAR ,
532 although all of its fields are treated as input.
533 .\" Splash screen control
534 .It Dv WSDISPLAYIO_SSPLASH Pq Li u_int
535 Toggle the splash screen.
536 This call is only available with the
539 .It Dv WSDISPLAYIO_SPROGRESS Pq Li u_int
540 Update the splash animation.
541 This call is only available with the
544 .Dv SPLASHSCREEN_PROGRESS
551 Terminal devices (per screen).
559 .Pa /usr/include/dev/wscons/wsconsio.h
575 code currently limits the number of screens on one display to 8.
581 are not cleanly distinguished in the code and in manual pages.
584 display devices are not tested.