1.\" $NetBSD: dvbox.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: @(#)dv.4 8.1 (Berkeley) 6/9/93 39.\" 40.Dd June 9, 1993 41.Dt DVBOX 4 hp300 42.Os 43.Sh NAME 44.Nm dvbox 45.Nd 46.Tn HP98730 47``DaVinci'' graphics device interface 48.Sh DESCRIPTION 49This driver is for the 50.Tn HP98730 51and 98731 graphics device, also known as 52the DaVinci. This driver has not been tested with all possible 53combinations of frame buffer boards and scan boards installed in the device. 54The driver merely checks for the existence of the device and does minimal set 55up. 56.Pp 57The DaVinci can be configured at either the ``internal'' address 58(frame buffer address 0x200000, control register space address 0x560000) 59or at an external select code less than 32. 60At the internal address it will be the ``preferred'' console device. 61The hardware installation manual describes the procedure for 62setting these values. 63.Pp 64A user process communicates to the device initially by means of 65.Xr ioctl 2 66calls. For the 67.Tn HP-UX 68.Xr ioctl 2 69calls supported, refer to 70.Tn HP-UX 71manuals. 72The 73.Bx 74calls supported are: 75.Bl -tag -width indent 76.It Dv GRFIOCGINFO 77Get Graphics Info 78.Pp 79Get info about device, setting the entries in the 80.Ar grfinfo 81structure, as defined in 82.Aq Pa hpdev/grfioctl.h . 83For the standard 98730, the number of planes should be 4. The number of 84colors would therefore be 15, excluding black. If one 98732A frame buffer 85board is installed, there will still be 4 planes, with the 4 planes on the 86colormap board becoming overlay planes. With each additional 98732 frame 87buffer board 4 planes will be added up to a maximum of 32 planes total. 88.It Dv GRFIOCON 89Graphics On 90.Pp 91Turn graphics on by enabling 92.Tn CRT 93output. The screen will come on, displaying 94whatever is in the frame buffer, using whatever colormap is in place. 95.It Dv GRFIOCOFF 96Graphics Off 97.Pp 98Turn graphics off by disabling output to the 99.Tn CRT . 100The frame buffer contents 101are not affected. 102.It Dv GRFIOCMAP 103Map Device to user space 104.Pp 105Map in control registers and frame buffer space. Once the device file is 106mapped, the frame buffer structure is accessible. The structure describing 107the 98730 is defined in 108.Aq Pa hpdev/grf_dvreg.h . 109.El 110.Sh FILES 111.Bl -tag -width /dev/MAKEDEV.hpux -compact 112.It Pa /dev/grf? 113.Bx 114special file 115.It Pa /dev/crt98730 116.It Pa /dev/ocrt98730 117.Tn HP-UX 118.Em starbase 119special files 120.It Pa /dev/MAKEDEV.hpux 121script for creating 122.Tn HP-UX 123special files 124.El 125.Sh EXAMPLES 126This is a short segment of code showing how the device is opened and mapped 127into user process address space assuming that it is 128.Ql grf0 : 129.Bd -literal -offset indent 130struct dvboxfb *dvbox; 131u_char *Addr, frame_buffer; 132struct grfinfo gi; 133int disp_fd; 134 135disp_fd = open("/dev/grf0",1); 136 137if (ioctl (disp_fd, GRFIOCGINFO, \*[Am]gi) \*[Lt] 0) return -1; 138 139(void) ioctl (disp_fd, GRFIOCON, 0); 140 141Addr = (u_char *) 0; 142if (ioctl (disp_fd, GRFIOCMAP, \*[Am]Addr) \*[Lt] 0) { 143(void) ioctl (disp_fd, GRFIOCOFF, 0); 144return -1; 145} 146dvbox = (dvboxfb *) Addr; /* Control Registers */ 147frame_buffer=(u_char *)Addr+gi.gd_regsize; /* Frame buffer memory */ 148.Ed 149.Sh DIAGNOSTICS 150None under 151.Bx . 152.Tn HP-UX 153.Tn CE.utilities 154must be used. 155.Sh ERRORS 156.Bl -tag -width [EINVAL] 157.It Bq Er ENODEV 158no such device. 159.It Bq Er EBUSY 160Another process has the device open. 161.It Bq Er EINVAL 162Invalid ioctl specification. 163.El 164.Sh SEE ALSO 165.Xr ioctl 2 , 166.Xr grf 4 167.Sh BUGS 168Not tested for all configurations of scan board and frame buffer memory boards. 169