xref: /original-bsd/share/man/man4/man4.hp300/tc.4 (revision 52960f3f)
1.\" Copyright (c) 1990, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the Systems Programming Group of the University of Utah Computer
6.\" Science Department.
7.\"
8.\" %sccs.include.redist.man%
9.\"
10.\"     @(#)tc.4	8.1 (Berkeley) 06/09/93
11.\"
12.Dd
13.Dt TC 4 hp300
14.Os
15.Sh NAME
16.Nm \&tc
17.Nd
18.Tn HP98544
1998550 ``Topcat'' and ``Catseye'' device interface
20.Sh DESCRIPTION
21This driver is for the
22.Tn HP98544 ,
2398545 and 98547 ``Topcat''
24and
25.Tn HP98548 ,
2698549, and 98550 ``Catseye'' display cards.
27This driver merely checks for the existence of the device
28and does minimal set up, as it is expected the applications will initialize
29the device to their requirements.
30The Topcat and Catseye are nearly identical in common usage and only the
31Topcat will be referred to from now on.
32.Pp
33The Topcat display cards are not user configurable.  If one is present on a
34system, it will always have a frame buffer address of 0x200000 and a control
35register address of 0x560000.  These are the
36.Tn HP
37series 300
38.Tn ITE
39(Internal
40Terminal Emulator) defaults.  The device can also be used as a graphics output
41device.
42.Pp
43The
44.Xr ioctl 2
45calls supported by the
46.Bx
47system for the Topcat are:
48.Bl -tag -width GRFIOCGINFO
49.It Dv GRFIOCGINFO
50Get Graphics Info
51.Pp
52Get info about device, setting the entries in the
53.Ar grfinfo
54structure, as defined in
55.Aq Pa hpdev/grfioctl.h .
56For the 98544 or 98549,
57the number of planes should be 1, as they are monochrome devices.
58The number of planes for a 98545 is 4, translating to 15 colors,
59excluding black.
60The 98547 and 98548 cards have 6 planes, yielding 63 colors and black.
61The 98550 has 8 planes, yielding 255 colors and black.
62The displayed frame buffer size for the 98549 and 98550 is 2048 x 1024,
63for the others it is 1024 x 768.
64.It Dv GRFIOCON
65Graphics On
66.Pp
67Turn graphics on by enabling
68.Tn CRT
69output.  The screen will come on, displaying
70whatever is in the frame buffer, using whatever colormap is in place.
71.It Dv GRFIOCOFF
72Graphics Off
73.Pp
74Turn graphics off by disabling output to the
75.Tn CRT .
76The frame buffer contents
77are not affected.
78.It Dv GRFIOCMAP
79Map Device to user space
80.Pp
81Map in control registers and framebuffer space. Once the device file is
82mapped, the frame buffer structure is accessible.  The frame buffer structure
83describing Topcat/Catseye devices is defined in
84.Aq Pa hpdev/grf_tcreg.h .
85.El
86.Pp
87For further information about the use of
88.Xr ioctl
89see the man page.
90.Sh EXAMPLE
91A small example of opening, mapping and using the device is given below.
92For more examples of the details on the behavior of the device, see the device
93dependent source files for the X Window System, in the
94.Pa /usr/src/new/X/libhp
95directory.
96.Bd -literal
97struct tcboxfb *tc;
98u_char *Addr, frame_buffer;
99struct grfinfo gi;
100int disp_fd;
101
102disp_fd = open("/dev/grf0",1);
103
104if (ioctl (disp_fd, GRFIOCGINFO, &gi) < 0) return -1;
105
106(void) ioctl (disp_fd, GRFIOCON, 0);
107
108Addr = (u_char *) 0;
109if (ioctl (disp_fd, GRFIOCMAP, &Addr) < 0) {
110	(void) ioctl (disp_fd, GRFIOCOFF, 0);
111	return -1;
112}
113tc = (tcboxfb *) Addr;                          /* Control Registers   */
114frame_buffer = (u_char *) Addr + gi.gd_regsize; /* Frame buffer memory */
115.Ed
116.Sh FILES
117.Bl -tag -width /dev/MAKEDEV.hpux -compact
118.It Pa /dev/grf?
119.Bx
120special file
121.It Pa /dev/crt9837
122.It Pa /dev/crt98550
123.Tn HP-UX
124.Em starbase
125special files
126.It Pa /dev/MAKEDEV.hpux
127script for creating
128.Tn HP-UX
129special files
130.El
131.Sh DIAGNOSTICS
132None under
133.Bx .
134.Tn HP-UX
135.Tn /usr/CE.utilities/Crtadjust
136programs must be used.
137.Sh ERRORS
138.Bl -tag -width [EINVAL]
139.It Bq Er ENODEV
140no such device.
141.It Bq Er EBUSY
142Another process has the device open.
143.It Bq Er EINVAL
144Invalid
145.Xr ioctl
146specification.
147.El
148.Sh SEE ALSO
149.Xr ioctl 2 ,
150.Xr grf 4
151