1.\" $NetBSD: topcat.4,v 1.3 2002/02/13 08:17:58 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: @(#)tc.4 8.1 (Berkeley) 6/9/93 39.\" 40.Dd September 10, 2001 41.Dt TOPCAT 4 hp300 42.Os 43.Sh NAME 44.Nm topcat 45.Nd 46.Tn HP98544 4798550 ``Topcat'' and ``Catseye'' device interface 48.Sh SYNOPSIS 49.Cd "topcat* at intio?" 50.Cd "topcat* at dio? scode ?" 51.Sh DESCRIPTION 52This driver is for the 53.Tn HP98544 , 5498545 and 98547 ``Topcat'' 55and 56.Tn HP98548 , 5798549, and 98550 ``Catseye'' display cards. 58This driver merely checks for the existence of the device 59and does minimal set up, as it is expected the applications will initialize 60the device to their requirements. 61The Topcat and Catseye are nearly identical in common usage and only the 62Topcat will be referred to from now on. 63.Pp 64The Topcat display cards are not user configurable. If one is present on a 65system, it will always have a frame buffer address of 0x200000 and a control 66register address of 0x560000. These are the 67.Tn HP 68series 300 69.Tn ITE 70(Internal 71Terminal Emulator) defaults. The device can also be used as a graphics output 72device. 73.Pp 74The 75.Xr ioctl 2 76calls supported by the 77.Bx 78system for the Topcat are: 79.Bl -tag -width GRFIOCGINFO 80.It Dv GRFIOCGINFO 81Get Graphics Info 82.Pp 83Get info about device, setting the entries in the 84.Ar grfinfo 85structure, as defined in 86.Aq Pa hpdev/grfioctl.h . 87For the 98544 or 98549, 88the number of planes should be 1, as they are monochrome devices. 89The number of planes for a 98545 is 4, translating to 15 colors, 90excluding black. 91The 98547 and 98548 cards have 6 planes, yielding 63 colors and black. 92The 98550 has 8 planes, yielding 255 colors and black. 93The displayed frame buffer size for the 98549 and 98550 is 2048 x 1024, 94for the others it is 1024 x 768. 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. The frame buffer structure 114describing Topcat/Catseye devices is defined in 115.Aq Pa hpdev/grf_tcreg.h . 116.El 117.Pp 118For further information about the use of 119.Xr ioctl 2 120see the man page. 121.Sh FILES 122.Bl -tag -width /dev/MAKEDEV.hpux -compact 123.It Pa /dev/grf? 124.Bx 125special file 126.It Pa /dev/crt9837 127.It Pa /dev/crt98550 128.Tn HP-UX 129.Em starbase 130special files 131.It Pa /dev/MAKEDEV.hpux 132script for creating 133.Tn HP-UX 134special files 135.El 136.Sh EXAMPLES 137A small example of opening, mapping and using the device is given below. 138For more examples of the details on the behavior of the device, see the device 139dependent source files for the X Window System, in the 140.Pa /usr/src/new/X/libhp 141directory. 142.Bd -literal 143struct tcboxfb *tc; 144u_char *Addr, frame_buffer; 145struct grfinfo gi; 146int disp_fd; 147 148disp_fd = open("/dev/grf0",1); 149 150if (ioctl (disp_fd, GRFIOCGINFO, \*[Am]gi) \*[Lt] 0) return -1; 151 152(void) ioctl (disp_fd, GRFIOCON, 0); 153 154Addr = (u_char *) 0; 155if (ioctl (disp_fd, GRFIOCMAP, \*[Am]Addr) \*[Lt] 0) { 156 (void) ioctl (disp_fd, GRFIOCOFF, 0); 157 return -1; 158} 159tc = (tcboxfb *) Addr; /* Control Registers */ 160frame_buffer = (u_char *) Addr + gi.gd_regsize; /* Frame buffer memory */ 161.Ed 162.Sh DIAGNOSTICS 163None under 164.Bx . 165.Tn HP-UX 166.Tn /usr/CE.utilities/Crtadjust 167programs must be used. 168.Sh ERRORS 169.Bl -tag -width [EINVAL] 170.It Bq Er ENODEV 171no such device. 172.It Bq Er EBUSY 173Another process has the device open. 174.It Bq Er EINVAL 175Invalid 176.Xr ioctl 2 177specification. 178.El 179.Sh SEE ALSO 180.Xr ioctl 2 , 181.Xr grf 4 , 182.Xr ite 4 183