1*62996Sbostic.\" Copyright (c) 1990, 1991, 1993 2*62996Sbostic.\" The Regents of the University of California. All rights reserved. 344684Sbostic.\" 444684Sbostic.\" This code is derived from software contributed to Berkeley by 544684Sbostic.\" the Systems Programming Group of the University of Utah Computer 644684Sbostic.\" Science Department. 744684Sbostic.\" 844684Sbostic.\" %sccs.include.redist.man% 944684Sbostic.\" 10*62996Sbostic.\" @(#)tc.4 8.1 (Berkeley) 06/09/93 1144684Sbostic.\" 1247672Scael.Dd 1347672Scael.Dt TC 4 hp300 1447672Scael.Os 1547672Scael.Sh NAME 1647672Scael.Nm \&tc 1747672Scael.Nd 1847672Scael.Tn HP98544 1947672Scael98550 ``Topcat'' and ``Catseye'' device interface 2047672Scael.Sh DESCRIPTION 2147672ScaelThis driver is for the 2247672Scael.Tn HP98544 , 2347672Scael98545 and 98547 ``Topcat'' 2447672Scaeland 2547672Scael.Tn HP98548 , 2647672Scael98549, and 98550 ``Catseye'' display cards. 2744684SbosticThis driver merely checks for the existence of the device 2844684Sbosticand does minimal set up, as it is expected the applications will initialize 2944684Sbosticthe device to their requirements. 3044684SbosticThe Topcat and Catseye are nearly identical in common usage and only the 3144684SbosticTopcat will be referred to from now on. 3247672Scael.Pp 3344684SbosticThe Topcat display cards are not user configurable. If one is present on a 3444684Sbosticsystem, it will always have a frame buffer address of 0x200000 and a control 3547672Scaelregister address of 0x560000. These are the 3647672Scael.Tn HP 3747672Scaelseries 300 3847672Scael.Tn ITE 3947672Scael(Internal 4044684SbosticTerminal Emulator) defaults. The device can also be used as a graphics output 4144684Sbosticdevice. 4247672Scael.Pp 4344684SbosticThe 4447672Scael.Xr ioctl 2 4547672Scaelcalls supported by the 4647672Scael.Bx 4747672Scaelsystem for the Topcat are: 4847672Scael.Bl -tag -width GRFIOCGINFO 4947672Scael.It Dv GRFIOCGINFO 5044684SbosticGet Graphics Info 5147672Scael.Pp 5244684SbosticGet info about device, setting the entries in the 5347672Scael.Ar grfinfo 5447672Scaelstructure, as defined in 5547672Scael.Aq Pa hpdev/grfioctl.h . 5644684SbosticFor the 98544 or 98549, 5744684Sbosticthe number of planes should be 1, as they are monochrome devices. 5844684SbosticThe number of planes for a 98545 is 4, translating to 15 colors, 5944684Sbosticexcluding black. 6044684SbosticThe 98547 and 98548 cards have 6 planes, yielding 63 colors and black. 6144684SbosticThe 98550 has 8 planes, yielding 255 colors and black. 6244684SbosticThe displayed frame buffer size for the 98549 and 98550 is 2048 x 1024, 6344684Sbosticfor the others it is 1024 x 768. 6447672Scael.It Dv GRFIOCON 6544684SbosticGraphics On 6647672Scael.Pp 6747672ScaelTurn graphics on by enabling 6847672Scael.Tn CRT 6947672Scaeloutput. The screen will come on, displaying 7044684Sbosticwhatever is in the frame buffer, using whatever colormap is in place. 7147672Scael.It Dv GRFIOCOFF 7244684SbosticGraphics Off 7347672Scael.Pp 7447672ScaelTurn graphics off by disabling output to the 7547672Scael.Tn CRT . 7647672ScaelThe frame buffer contents 7744684Sbosticare not affected. 7847672Scael.It Dv GRFIOCMAP 7944684SbosticMap Device to user space 8047672Scael.Pp 8144684SbosticMap in control registers and framebuffer space. Once the device file is 8244684Sbosticmapped, the frame buffer structure is accessible. The frame buffer structure 8347672Scaeldescribing Topcat/Catseye devices is defined in 8447672Scael.Aq Pa hpdev/grf_tcreg.h . 8547672Scael.El 8647672Scael.Pp 8747672ScaelFor further information about the use of 8847672Scael.Xr ioctl 8947672Scaelsee the man page. 9047672Scael.Sh EXAMPLE 9144684SbosticA small example of opening, mapping and using the device is given below. 9244684SbosticFor more examples of the details on the behavior of the device, see the device 9344684Sbosticdependent source files for the X Window System, in the 9447672Scael.Pa /usr/src/new/X/libhp 9544684Sbosticdirectory. 9647672Scael.Bd -literal 9747672Scaelstruct tcboxfb *tc; 9847672Scaelu_char *Addr, frame_buffer; 9947672Scaelstruct grfinfo gi; 10047672Scaelint disp_fd; 10144684Sbostic 10247672Scaeldisp_fd = open("/dev/grf0",1); 10344684Sbostic 10447672Scaelif (ioctl (disp_fd, GRFIOCGINFO, &gi) < 0) return -1; 10544684Sbostic 10647672Scael(void) ioctl (disp_fd, GRFIOCON, 0); 10744684Sbostic 10847672ScaelAddr = (u_char *) 0; 10947672Scaelif (ioctl (disp_fd, GRFIOCMAP, &Addr) < 0) { 11047672Scael (void) ioctl (disp_fd, GRFIOCOFF, 0); 11147672Scael return -1; 11244684Sbostic} 11347672Scaeltc = (tcboxfb *) Addr; /* Control Registers */ 11447672Scaelframe_buffer = (u_char *) Addr + gi.gd_regsize; /* Frame buffer memory */ 11547672Scael.Ed 11647672Scael.Sh FILES 11747672Scael.Bl -tag -width /dev/MAKEDEV.hpux -compact 11847672Scael.It Pa /dev/grf? 11947672Scael.Bx 12047672Scaelspecial file 12147672Scael.It Pa /dev/crt9837 12247672Scael.It Pa /dev/crt98550 12347672Scael.Tn HP-UX 12447672Scael.Em starbase 12547672Scaelspecial files 12647672Scael.It Pa /dev/MAKEDEV.hpux 12747672Scaelscript for creating 12847672Scael.Tn HP-UX 12947672Scaelspecial files 13047672Scael.El 13147672Scael.Sh DIAGNOSTICS 13247672ScaelNone under 13347672Scael.Bx . 13447672Scael.Tn HP-UX 13547672Scael.Tn /usr/CE.utilities/Crtadjust 13647672Scaelprograms must be used. 13747672Scael.Sh ERRORS 13847672Scael.Bl -tag -width [EINVAL] 13947672Scael.It Bq Er ENODEV 14044684Sbosticno such device. 14147672Scael.It Bq Er EBUSY 14244684SbosticAnother process has the device open. 14347672Scael.It Bq Er EINVAL 14447672ScaelInvalid 14547672Scael.Xr ioctl 14647672Scaelspecification. 14747672Scael.El 14847672Scael.Sh SEE ALSO 14947672Scael.Xr ioctl 2 , 15047672Scael.Xr grf 4 151