xref: /netbsd/share/man/man4/man4.hp300/gbox.4 (revision 6550d01e)
1.\"	$NetBSD: gbox.4,v 1.5 2010/03/22 18:58:31 joerg Exp $
2.\"
3.\" Copyright (c) 1990, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" This code is derived from software contributed to Berkeley by
7.\" the Systems Programming Group of the University of Utah Computer
8.\" Science Department.
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\" 1. Redistributions of source code must retain the above copyright
14.\"    notice, this list of conditions and the following disclaimer.
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\"    notice, this list of conditions and the following disclaimer in the
17.\"    documentation and/or other materials provided with the distribution.
18.\" 3. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"     from: @(#)gb.4	8.1 (Berkeley) 6/9/93
35.\"
36.Dd June 9, 1993
37.Dt GB 4 hp300
38.Os
39.Sh NAME
40.Nm gb
41.Nd
42.Tn HP98700
43``Gatorbox'' graphics device interface
44.Sh DESCRIPTION
45This driver is for the
46.Tn HP98700
47and 98710 graphics devices, also known as
48the Gatorbox.  The term ``Gator'' will often be used, and it is not to be
49confused with ``Gator'' used in reference to an
50.Tn HP
519837 or 200/237 machine.
52Also, the term Gatorbox is used for the 98700 alone, with the 98701 frame
53buffer memory or with the 98710 accelerator installed.  This driver merely
54checks for the existence of the device and does minimal set up, as it is
55expected the applications will initialize the device to their requirements.
56.Pp
57The 98700 can be used as the only graphics device on a system, in which case
58it will be used as the system console.  It can also be installed as a secondary
59display device.  For the first case, the
60.Tn HP
61.Tn 98287A M.A.D.
62interface card
63should be set to internal control space.  This will put the frame buffer at
64the DIO address 0x200000 and the control registers at 0x560000.
65At this address it will be the ``preferred'' console device (see
66.Xr cons 4 ) .
67For use as a secondary device,
68the 98287A should be set to frame buffer address 0x300000,
69and to an external select code.
70.Pp
71It should be noted that this configuration will conflict with the 98547
72display card which has a 2 megabyte frame buffer starting at address 0x200000.
73The 98700 should only be installed as a secondary device in a machine with a
741 bit 98544 display card or 4 bit 98545 card.
75The
76.%T 98700H Installation Guide
77contains further configuration information.
78.Pp
79The
80.Xr ioctl 2
81calls supported by the
82.Bx
83system for the Gatorbox are:
84.Bl -tag -width indent
85.It Dv GRFIOCGINFO
86Get Graphics Info
87.Pp
88Get info about device, setting the entries in the
89.Em grfinfo
90structure, as defined in
91.In hpdev/grfioctl.h .
92For the standard 98700, the number of planes should be 4.  The number of
93colors would therefore be 15, excluding black.  With the 98701 option installed
94there will be another 4 planes for a total of 8, giving 255 colors.
95.It Dv GRFIOCON
96Graphics On
97.Pp
98Turn graphics on by enabling
99.Tn CRT
100output.  The screen will come on, displaying
101whatever is in the frame buffer, using whatever colormap is in place.
102.It Dv GRFIOCOFF
103Graphics Off
104.Pp
105Turn graphics off by disabling output to the
106.Tn CRT .
107The frame buffer contents
108are not affected.
109.It Dv GRFIOCMAP
110Map Device to user space
111.Pp
112Map in control registers and framebuffer space. Once the device file is
113mapped, the frame buffer structure is accessible.
114The frame buffer structure describing the 98700
115is given in
116.In hpdev/grf_gbreg.h .
117.It Dv GRFIOCUNMAP
118Unmap Device
119.Pp
120Unmap control registers and framebuffer space.
121.Pp
122For further information about the use of ioctl see the man page.
123.El
124.Sh FILES
125.Bl -tag -width /dev/crt98700 -compact
126.It Pa /dev/grf?
127.Bx
128special file
129.It Pa /dev/crt98700
130.Tn HP-UX
131.Em starbase
132special file
133.El
134.Sh EXAMPLES
135A small example of opening, mapping and using the device is given below.
136For more examples of the details on the behavior of the device, see the device
137dependent source files for the X Window System, in the
138.Pa /usr/src/new/X/libhp.fb
139directory.
140.Bd -literal -offset indent
141struct gboxfb *gbox;
142u_char *Addr, frame_buffer;
143struct grfinfo gi;
144int disp_fd;
145
146disp_fd = open("/dev/grf0",1);
147
148if (ioctl (disp_fd, GRFIOCGINFO, \*[Am]gi) \*[Lt] 0) return -1;
149
150(void) ioctl (disp_fd, GRFIOCON, 0);
151
152Addr = (u_char *) 0;
153if (ioctl (disp_fd, GRFIOCMAP, \*[Am]Addr) \*[Lt] 0) {
154(void) ioctl (disp_fd, GRFIOCOFF, 0);
155return -1;
156}
157gbox = (gboxfb *) Addr;                         /* Control Registers   */
158frame_buffer = (u_char *) Addr + gi.gd_regsize; /* Frame buffer memory */
159.Ed
160.Sh DIAGNOSTICS
161None under
162.Bx .
163.Tn HP-UX
164The
165.Tn CE.utilities/Crtadjust
166programs must be used.
167.Sh ERRORS
168.Bl -tag -width [EINVAL]
169.It Bq Er ENODEV
170no such device.
171.It Bq Er EBUSY
172Another process has the device open.
173.It Bq Er EINVAL
174Invalid ioctl specification.
175.El
176.Sh SEE ALSO
177.Xr ioctl 2 ,
178.Xr grf 4
179