1*62978Sbostic.\" Copyright (c) 1990, 1991, 1993 2*62978Sbostic.\" The Regents of the University of California. All rights reserved. 344676Sbostic.\" 444676Sbostic.\" This code is derived from software contributed to Berkeley by 544676Sbostic.\" the Systems Programming Group of the University of Utah Computer 644676Sbostic.\" Science Department. 762977Sbostic.\" 844676Sbostic.\" %sccs.include.redist.man% 944676Sbostic.\" 10*62978Sbostic.\" @(#)gb.4 8.1 (Berkeley) 06/09/93 1144676Sbostic.\" 1247672Scael.Dd 1347672Scael.Dt GB 4 hp300 1447672Scael.Os 1547672Scael.Sh NAME 1647672Scael.Nm gb 1747672Scael.Nd 1847672Scael.Tn HP98700 1947672Scael``Gatorbox'' device interface 2047672Scael.Sh DESCRIPTION 2147672ScaelThis driver is for the 2247672Scael.Tn HP98700 2347672Scaeland 98710 graphics devices, also known as 2444676Sbosticthe Gatorbox. The term ``Gator'' will often be used, and it is not to be 2547672Scaelconfused with ``Gator'' used in reference to an 2647672Scael.Tn HP 2747672Scael9837 or 200/237 machine. 2844676SbosticAlso, the term Gatorbox is used for the 98700 alone, with the 98701 frame 2944676Sbosticbuffer memory or with the 98710 accelerator installed. This driver merely 3044676Sbosticchecks for the existence of the device and does minimal set up, as it is 3144676Sbosticexpected the applications will initialize the device to their requirements. 3247672Scael.Pp 3344676SbosticThe 98700 can be used as the only graphics device on a system, in which case 3444676Sbosticit will be used as the system console. It can also be installed as a secondary 3547672Scaeldisplay device. For the first case, the 3647672Scael.Tn HP 3747672Scael.Tn 98287A M.A.D. 3847672Scaelinterface card 3944676Sbosticshould be set to internal control space. This will put the frame buffer at 4044676Sbosticthe DIO address 0x200000 and the control registers at 0x560000. 4144676SbosticAt this address it will be the ``preferred'' console device (see 4247672Scael.Xr cons 4 ) . 4344676SbosticFor use as a secondary device, 4444676Sbosticthe 98287A should be set to frame buffer address 0x300000, 4544676Sbosticand to an external select code. 4647672Scael.Pp 4744676SbosticIt should be noted that this configuration will conflict with the 98547 4844676Sbosticdisplay card which has a 2 megabyte frame buffer starting at address 0x200000. 4944676SbosticThe 98700 should only be installed as a secondary device in a machine with a 5044676Sbostic1 bit 98544 display card or 4 bit 98545 card. 5144676SbosticThe 5247672Scael.%T 98700H Installation Guide 5344676Sbosticcontains further configuration information. 5447672Scael.Pp 5544676SbosticThe 5647672Scael.Xr ioctl 2 5747672Scaelcalls supported by the 5847672Scael.Bx 5947672Scaelsystem for the Gatorbox are: 6047672Scael.Bl -tag -width indent 6147672Scael.It Dv GRFIOCGINFO 6244676SbosticGet Graphics Info 6347672Scael.Pp 6444676SbosticGet info about device, setting the entries in the 6547672Scael.Em grfinfo 6647672Scaelstructure, as defined in 6747672Scael.Aq Pa hpdev/grfioctl.h . 6844676SbosticFor the standard 98700, the number of planes should be 4. The number of 6944676Sbosticcolors would therefore be 15, excluding black. With the 98701 option installed 7044676Sbosticthere will be another 4 planes for a total of 8, giving 255 colors. 7147672Scael.It Dv GRFIOCON 7244676SbosticGraphics On 7347672Scael.Pp 7447672ScaelTurn graphics on by enabling 7547672Scael.Tn CRT 7647672Scaeloutput. The screen will come on, displaying 7744676Sbosticwhatever is in the frame buffer, using whatever colormap is in place. 7847672Scael.It Dv GRFIOCOFF 7944676SbosticGraphics Off 8047672Scael.Pp 8147672ScaelTurn graphics off by disabling output to the 8247672Scael.Tn CRT . 8347672ScaelThe frame buffer contents 8444676Sbosticare not affected. 8547672Scael.It Dv GRFIOCMAP 8644676SbosticMap Device to user space 8747672Scael.Pp 8844676SbosticMap in control registers and framebuffer space. Once the device file is 8944676Sbosticmapped, the frame buffer structure is accessible. 9044676SbosticThe frame buffer structure describing the 98700 9147672Scaelis given in 9247672Scael.Aq Pa hpdev/grf_gbreg.h . 9347672Scael.It Dv GRFIOCUNMAP 9444676SbosticUnmap Device 9547672Scael.Pp 9644676SbosticUnmap control registers and framebuffer space. 9747672Scael.Pp 9844676SbosticFor further information about the use of ioctl see the man page. 9947672Scael.El 10047672Scael.Sh EXAMPLE 10144676SbosticA small example of opening, mapping and using the device is given below. 10244676SbosticFor more examples of the details on the behavior of the device, see the device 10344676Sbosticdependent source files for the X Window System, in the 10447672Scael.Pa /usr/src/new/X/libhp.fb 10544676Sbosticdirectory. 10647672Scael.Bd -literal -offset indent 10747672Scaelstruct gboxfb *gbox; 10847672Scaelu_char *Addr, frame_buffer; 10947672Scaelstruct grfinfo gi; 11047672Scaelint disp_fd; 11144676Sbostic 11247672Scaeldisp_fd = open("/dev/grf0",1); 11344676Sbostic 11447672Scaelif (ioctl (disp_fd, GRFIOCGINFO, &gi) < 0) return -1; 11544676Sbostic 11647672Scael(void) ioctl (disp_fd, GRFIOCON, 0); 11744676Sbostic 11847672ScaelAddr = (u_char *) 0; 11947672Scaelif (ioctl (disp_fd, GRFIOCMAP, &Addr) < 0) { 12047672Scael(void) ioctl (disp_fd, GRFIOCOFF, 0); 12147672Scaelreturn -1; 12244676Sbostic} 12347672Scaelgbox = (gboxfb *) Addr; /* Control Registers */ 12447672Scaelframe_buffer = (u_char *) Addr + gi.gd_regsize; /* Frame buffer memory */ 12547672Scael.Ed 12647672Scael.Sh FILES 12747672Scael.Bl -tag -width /dev/crt98700 -compact 12847672Scael.It Pa /dev/grf? 12947672Scael.Bx 13047672Scaelspecial file 13147672Scael.It Pa /dev/crt98700 13247672Scael.Tn HP-UX 13347672Scael.Em starbase 13447672Scaelspecial file 13547672Scael.El 13647672Scael.Sh DIAGNOSTICS 13747672ScaelNone under 13847672Scael.Bx . 13947672Scael.Tn HP-UX 14047672ScaelThe 14147672Scael.Tn CE.utilities/Crtadjust 14247672Scaelprograms must be used. 14347672Scael.Sh ERRORS 14447672Scael.Bl -tag -width [EINVAL] 14547672Scael.It Bq Er ENODEV 14644676Sbosticno such device. 14747672Scael.It Bq Er EBUSY 14844676SbosticAnother process has the device open. 14947672Scael.It Bq Er EINVAL 15044676SbosticInvalid ioctl specification. 15147672Scael.El 15247672Scael.Sh SEE ALSO 15347672Scael.Xr ioctl 2 , 15447672Scael.Xr grf 4 155