xref: /original-bsd/share/man/man4/man4.hp300/gb.4 (revision 80dd9c38)
1.\" Copyright (c) 1990, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the Systems Programming Group of the University of Utah Computer
6.\" Science Department.
7.\"
8.\" %sccs.include.redist.man%
9.\"
10.\"     @(#)gb.4	8.1 (Berkeley) 06/09/93
11.\"
12.Dd
13.Dt GB 4 hp300
14.Os
15.Sh NAME
16.Nm gb
17.Nd
18.Tn HP98700
19``Gatorbox'' device interface
20.Sh DESCRIPTION
21This driver is for the
22.Tn HP98700
23and 98710 graphics devices, also known as
24the Gatorbox.  The term ``Gator'' will often be used, and it is not to be
25confused with ``Gator'' used in reference to an
26.Tn HP
279837 or 200/237 machine.
28Also, the term Gatorbox is used for the 98700 alone, with the 98701 frame
29buffer memory or with the 98710 accelerator installed.  This driver merely
30checks for the existence of the device and does minimal set up, as it is
31expected the applications will initialize the device to their requirements.
32.Pp
33The 98700 can be used as the only graphics device on a system, in which case
34it will be used as the system console.  It can also be installed as a secondary
35display device.  For the first case, the
36.Tn HP
37.Tn 98287A M.A.D.
38interface card
39should be set to internal control space.  This will put the frame buffer at
40the DIO address 0x200000 and the control registers at 0x560000.
41At this address it will be the ``preferred'' console device (see
42.Xr cons 4 ) .
43For use as a secondary device,
44the 98287A should be set to frame buffer address 0x300000,
45and to an external select code.
46.Pp
47It should be noted that this configuration will conflict with the 98547
48display card which has a 2 megabyte frame buffer starting at address 0x200000.
49The 98700 should only be installed as a secondary device in a machine with a
501 bit 98544 display card or 4 bit 98545 card.
51The
52.%T 98700H Installation Guide
53contains further configuration information.
54.Pp
55The
56.Xr ioctl 2
57calls supported by the
58.Bx
59system for the Gatorbox are:
60.Bl -tag -width indent
61.It Dv GRFIOCGINFO
62Get Graphics Info
63.Pp
64Get info about device, setting the entries in the
65.Em grfinfo
66structure, as defined in
67.Aq Pa hpdev/grfioctl.h .
68For the standard 98700, the number of planes should be 4.  The number of
69colors would therefore be 15, excluding black.  With the 98701 option installed
70there will be another 4 planes for a total of 8, giving 255 colors.
71.It Dv GRFIOCON
72Graphics On
73.Pp
74Turn graphics on by enabling
75.Tn CRT
76output.  The screen will come on, displaying
77whatever is in the frame buffer, using whatever colormap is in place.
78.It Dv GRFIOCOFF
79Graphics Off
80.Pp
81Turn graphics off by disabling output to the
82.Tn CRT .
83The frame buffer contents
84are not affected.
85.It Dv GRFIOCMAP
86Map Device to user space
87.Pp
88Map in control registers and framebuffer space. Once the device file is
89mapped, the frame buffer structure is accessible.
90The frame buffer structure describing the 98700
91is given in
92.Aq Pa hpdev/grf_gbreg.h .
93.It Dv GRFIOCUNMAP
94Unmap Device
95.Pp
96Unmap control registers and framebuffer space.
97.Pp
98For further information about the use of ioctl see the man page.
99.El
100.Sh EXAMPLE
101A small example of opening, mapping and using the device is given below.
102For more examples of the details on the behavior of the device, see the device
103dependent source files for the X Window System, in the
104.Pa /usr/src/new/X/libhp.fb
105directory.
106.Bd -literal -offset indent
107struct gboxfb *gbox;
108u_char *Addr, frame_buffer;
109struct grfinfo gi;
110int disp_fd;
111
112disp_fd = open("/dev/grf0",1);
113
114if (ioctl (disp_fd, GRFIOCGINFO, &gi) < 0) return -1;
115
116(void) ioctl (disp_fd, GRFIOCON, 0);
117
118Addr = (u_char *) 0;
119if (ioctl (disp_fd, GRFIOCMAP, &Addr) < 0) {
120(void) ioctl (disp_fd, GRFIOCOFF, 0);
121return -1;
122}
123gbox = (gboxfb *) Addr;                         /* Control Registers   */
124frame_buffer = (u_char *) Addr + gi.gd_regsize; /* Frame buffer memory */
125.Ed
126.Sh FILES
127.Bl -tag -width /dev/crt98700 -compact
128.It Pa /dev/grf?
129.Bx
130special file
131.It Pa /dev/crt98700
132.Tn HP-UX
133.Em starbase
134special file
135.El
136.Sh DIAGNOSTICS
137None under
138.Bx .
139.Tn HP-UX
140The
141.Tn CE.utilities/Crtadjust
142programs must be used.
143.Sh ERRORS
144.Bl -tag -width [EINVAL]
145.It Bq Er ENODEV
146no such device.
147.It Bq Er EBUSY
148Another process has the device open.
149.It Bq Er EINVAL
150Invalid ioctl specification.
151.El
152.Sh SEE ALSO
153.Xr ioctl 2 ,
154.Xr grf 4
155