xref: /csrg-svn/share/man/man4/man4.hp300/tc.4 (revision 47672)
1*47672Scael.\" Copyright (c) 1990, 1991 The Regents of the University of California.
244684Sbostic.\" 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*47672Scael.\"     @(#)tc.4	5.2 (Berkeley) 03/27/91
1144684Sbostic.\"
12*47672Scael.Dd
13*47672Scael.Dt TC 4 hp300
14*47672Scael.Os
15*47672Scael.Sh NAME
16*47672Scael.Nm \&tc
17*47672Scael.Nd
18*47672Scael.Tn HP98544
19*47672Scael98550 ``Topcat'' and ``Catseye'' device interface
20*47672Scael.Sh DESCRIPTION
21*47672ScaelThis driver is for the
22*47672Scael.Tn HP98544 ,
23*47672Scael98545 and 98547 ``Topcat''
24*47672Scaeland
25*47672Scael.Tn HP98548 ,
26*47672Scael98549, 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.
32*47672Scael.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
35*47672Scaelregister address of 0x560000.  These are the
36*47672Scael.Tn HP
37*47672Scaelseries 300
38*47672Scael.Tn ITE
39*47672Scael(Internal
4044684SbosticTerminal Emulator) defaults.  The device can also be used as a graphics output
4144684Sbosticdevice.
42*47672Scael.Pp
4344684SbosticThe
44*47672Scael.Xr ioctl 2
45*47672Scaelcalls supported by the
46*47672Scael.Bx
47*47672Scaelsystem for the Topcat are:
48*47672Scael.Bl -tag -width GRFIOCGINFO
49*47672Scael.It Dv GRFIOCGINFO
5044684SbosticGet Graphics Info
51*47672Scael.Pp
5244684SbosticGet info about device, setting the entries in the
53*47672Scael.Ar grfinfo
54*47672Scaelstructure, as defined in
55*47672Scael.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.
64*47672Scael.It Dv GRFIOCON
6544684SbosticGraphics On
66*47672Scael.Pp
67*47672ScaelTurn graphics on by enabling
68*47672Scael.Tn CRT
69*47672Scaeloutput.  The screen will come on, displaying
7044684Sbosticwhatever is in the frame buffer, using whatever colormap is in place.
71*47672Scael.It Dv GRFIOCOFF
7244684SbosticGraphics Off
73*47672Scael.Pp
74*47672ScaelTurn graphics off by disabling output to the
75*47672Scael.Tn CRT .
76*47672ScaelThe frame buffer contents
7744684Sbosticare not affected.
78*47672Scael.It Dv GRFIOCMAP
7944684SbosticMap Device to user space
80*47672Scael.Pp
8144684SbosticMap in control registers and framebuffer space. Once the device file is
8244684Sbosticmapped, the frame buffer structure is accessible.  The frame buffer structure
83*47672Scaeldescribing Topcat/Catseye devices is defined in
84*47672Scael.Aq Pa hpdev/grf_tcreg.h .
85*47672Scael.El
86*47672Scael.Pp
87*47672ScaelFor further information about the use of
88*47672Scael.Xr ioctl
89*47672Scaelsee the man page.
90*47672Scael.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
94*47672Scael.Pa /usr/src/new/X/libhp
9544684Sbosticdirectory.
96*47672Scael.Bd -literal
97*47672Scaelstruct tcboxfb *tc;
98*47672Scaelu_char *Addr, frame_buffer;
99*47672Scaelstruct grfinfo gi;
100*47672Scaelint disp_fd;
10144684Sbostic
102*47672Scaeldisp_fd = open("/dev/grf0",1);
10344684Sbostic
104*47672Scaelif (ioctl (disp_fd, GRFIOCGINFO, &gi) < 0) return -1;
10544684Sbostic
106*47672Scael(void) ioctl (disp_fd, GRFIOCON, 0);
10744684Sbostic
108*47672ScaelAddr = (u_char *) 0;
109*47672Scaelif (ioctl (disp_fd, GRFIOCMAP, &Addr) < 0) {
110*47672Scael	(void) ioctl (disp_fd, GRFIOCOFF, 0);
111*47672Scael	return -1;
11244684Sbostic}
113*47672Scaeltc = (tcboxfb *) Addr;                          /* Control Registers   */
114*47672Scaelframe_buffer = (u_char *) Addr + gi.gd_regsize; /* Frame buffer memory */
115*47672Scael.Ed
116*47672Scael.Sh FILES
117*47672Scael.Bl -tag -width /dev/MAKEDEV.hpux -compact
118*47672Scael.It Pa /dev/grf?
119*47672Scael.Bx
120*47672Scaelspecial file
121*47672Scael.It Pa /dev/crt9837
122*47672Scael.It Pa /dev/crt98550
123*47672Scael.Tn HP-UX
124*47672Scael.Em starbase
125*47672Scaelspecial files
126*47672Scael.It Pa /dev/MAKEDEV.hpux
127*47672Scaelscript for creating
128*47672Scael.Tn HP-UX
129*47672Scaelspecial files
130*47672Scael.El
131*47672Scael.Sh DIAGNOSTICS
132*47672ScaelNone under
133*47672Scael.Bx .
134*47672Scael.Tn HP-UX
135*47672Scael.Tn /usr/CE.utilities/Crtadjust
136*47672Scaelprograms must be used.
137*47672Scael.Sh ERRORS
138*47672Scael.Bl -tag -width [EINVAL]
139*47672Scael.It Bq Er ENODEV
14044684Sbosticno such device.
141*47672Scael.It Bq Er EBUSY
14244684SbosticAnother process has the device open.
143*47672Scael.It Bq Er EINVAL
144*47672ScaelInvalid
145*47672Scael.Xr ioctl
146*47672Scaelspecification.
147*47672Scael.El
148*47672Scael.Sh SEE ALSO
149*47672Scael.Xr ioctl 2 ,
150*47672Scael.Xr grf 4
151*47672Scael.Sh HISTORY
152*47672ScaelThe
153*47672Scael.Nm
154*47672Scaeldriver
155*47672Scael.Ud
156