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