xref: /netbsd-src/share/man/man9/rasops.9 (revision 98b5aa84a9a84ab94f6bc12d4fc18aa5b9e56b26)
1.\"     $NetBSD: rasops.9,v 1.19 2019/08/08 00:20:54 uwe Exp $
2.\"
3.\" Copyright (c) 2001 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Gregory McGarry.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd August 7, 2019
31.Dt RASOPS 9
32.Os
33.Sh NAME
34.Nm rasops ,
35.Nm rasops_init ,
36.Nm rasops_reconfig
37.Nd raster display operations
38.Sh SYNOPSIS
39.In dev/wscons/wsdisplayvar.h
40.In dev/rasops/rasops.h
41.Ft int
42.Fn rasops_init "struct rasops_info *ri" "int wantrows" "int wantcols"
43.Ft int
44.Fn rasops_reconfig "struct rasops_info *ri" "int wantrows" "int wantcols"
45.Pp
46.Cd options RASOPS_DEFAULT_WIDTH=80
47.Cd options RASOPS_DEFAULT_HEIGHT=25
48.Sh DESCRIPTION
49The
50.Nm
51subsystem is a set of raster operations for
52.Xr wscons 9 .
53.Pp
54The primary data type for using the raster operations is the
55.Vt rasops_info
56structure in
57.In dev/rasops/rasops.h .
58.Pp
59Valid values for the
60.Fa ri_flg
61member are:
62.Pp
63.Bl -tag -width ".Dv RI_ENABLE_ALPHA" -offset indent -compact
64.It Dv RI_FULLCLEAR
65.Fn eraserows
66hack to clear full screen
67.It Dv RI_FORCEMONO
68monochrome output even if we can do color
69.It Dv RI_BSWAP
70framebuffer endianness doesn't match CPU
71.It Dv RI_CURSOR
72cursor is switched on
73.It Dv RI_CLEAR
74clear display on startup
75.It Dv RI_CENTER
76center onscreen output
77.It Dv RI_CURSORCLIP
78cursor is currently clipped
79.It Dv RI_CFGDONE
80.Fn rasops_reconfig
81completed successfully
82.It Dv RI_NO_AUTO
83do not generate box drawing characters for ISO fonts.
84Use this when it is not safe to allocate memory, for example when setting up
85an early console.
86.It Dv RI_ENABLE_ALPHA
87the caller supports anti-aliased fonts in the given colour depth.
88Without this flag
89.Fn rasops_init
90will only pick bitmap fonts.
91.It Dv RI_8BIT_IS_RGB
92the caller uses an R3G3B2 colour map in 8 bit.
93.Fn rasops_init
94will generate an appropriate
95.Fa ri_devcmap Ns Li []
96but the caller still needs to set up the actual colour map.
97.El
98.Sh FUNCTIONS
99.Fn rasops_init
100initialises a
101.Vt rasops_info
102descriptor.
103.Fn rasops_reconfig
104is used to reconfigure it if parameters have changed in some way.
105.Pp
106The arguments
107.Fa wantrows
108and
109.Fa wantcols
110are the number of rows and columns we'd like.
111Passing zero for either one of them uses the default \(em normally
11280 by 25 but it can be changed with config options
113.Dv RASOPS_DEFAULT_WIDTH
114and
115.Dv RASOPS_DEFAULT_HEIGHT .
116.Pp
117In terms of optimization, bitmap fonts of width 8 or 16 work the best
118for all depths.
119For depths other than 1 the fonts of width 12 are also optimized.
120.Pp
121If calling
122.Fn rasops_reconfig
123to change the font and
124.Fa ri_wsfcookie
125is non-negative, you must call
126.Fn wsfont_unlock
127on it, and reset it to \-1 or a new, valid cookie.
128.Sh CODE REFERENCES
129The rasops subsystem is implemented within the directory
130.Pa sys/dev/rasops .
131The
132.Nm
133module itself is implemented within the file
134.Pa sys/dev/rasops/rasops.c .
135.Sh SEE ALSO
136.Xr intro 9 ,
137.Xr wscons 9 ,
138.Xr wsdisplay 9 ,
139.Xr wsfont 9
140.Sh HISTORY
141The
142.Nm
143subsystem appeared in
144.Nx 1.5 .
145.Sh AUTHORS
146The
147.Nm
148subsystem was written by
149.An Andrew Doran
150.Aq ad@NetBSD.org .
151