xref: /original-bsd/sys/hp/dev/grfvar.h (revision 46bf0326)
1 /*
2  * Copyright (c) 1988 University of Utah.
3  * Copyright (c) 1990 The Regents of the University of California.
4  * 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  * %sccs.include.redist.c%
11  *
12  * from: Utah $Hdr: grfvar.h 1.9 91/01/21$
13  *
14  *	@(#)grfvar.h	7.3 (Berkeley) 05/07/91
15  */
16 
17 /* internal structure of lock page */
18 #define GRFMAXLCK	256
19 struct	grf_lockpage {
20 	u_char	gl_locks[GRFMAXLCK];
21 };
22 #define gl_lockslot gl_locks[0]
23 
24 /* per display info */
25 struct	grf_softc {
26 	int	g_flags;		/* software flags */
27 	int	g_type;			/* type of display */
28 	caddr_t	g_regkva;		/* KVA of registers */
29 	caddr_t	g_fbkva;		/* KVA of framebuffer */
30 	struct	grfinfo g_display;	/* hardware description (for ioctl) */
31 	struct	grf_lockpage *g_lock;	/* lock page associated with device */
32 	struct	proc *g_lockp;		/* process holding lock */
33 	short	*g_pid;			/* array of pids with device open */
34 	int	g_lockpslot;		/* g_pid entry of g_lockp */
35 	caddr_t	g_data;			/* device dependent data */
36 };
37 
38 /* flags */
39 #define	GF_ALIVE	0x01
40 #define GF_OPEN		0x02
41 #define GF_EXCLUDE	0x04
42 #define GF_WANTED	0x08
43 #define GF_BSDOPEN	0x10
44 #define GF_HPUXOPEN	0x20
45 
46 /* display types - indices into grfdev */
47 #define	GT_TOPCAT	0
48 #define	GT_GATORBOX	1
49 #define	GT_RENAISSANCE	2
50 #define GT_LRCATSEYE	3
51 #define GT_HRCCATSEYE	4
52 #define GT_HRMCATSEYE	5
53 #define GT_DAVINCI	6
54 
55 struct	grfdev {
56 	int	gd_hardid;	/* secondary id returned by hardware */
57 	int	gd_softid;	/* id returned by HP-UX */
58 	int	(*gd_init)();	/* boot time initialization */
59 	int	(*gd_mode)();	/* misc functions */
60 	char	*gd_desc;	/* text description */
61 };
62 
63 /* hardware ids */
64 #define GID_GATORBOX	1
65 #define	GID_TOPCAT	2
66 #define GID_RENAISSANCE	4
67 #define GID_LRCATSEYE	5
68 #define GID_HRCCATSEYE	6
69 #define GID_HRMCATSEYE	7
70 #define GID_DAVINCI	8
71 
72 /* software ids defined in grfioctl.h */
73 
74 /* requests to mode routine */
75 #define GM_GRFON	1
76 #define GM_GRFOFF	2
77 #define GM_GRFOVON	3
78 #define GM_GRFOVOFF	4
79 
80 struct	grfreg {
81 	char	gr_pad0;
82 	u_char	gr_id;		/* +0x01 */
83 	char	gr_pad1[0x13];
84 	u_char	gr_id2;		/* +0x15 */
85 	char	gr_pad2[0x47];
86 	u_char	gr_fbomsb;	/* +0x5d */
87 	char	gr_pad3;
88 	u_char	gr_fbolsb;	/* +0x5f */
89 };
90 /* bitmapped display hardware id */
91 #define GRFHWID		0x39
92 
93 /* internal bitmapped display address */
94 #define GRFIADDR	0x560000
95 
96 /* minor device interpretation */
97 #define GRFOVDEV	0x10	/* overlay planes */
98 #define GRFIMDEV	0x20	/* images planes */
99 #define GRFUNIT(d)	((d) & 0x7)
100 
101 #ifdef KERNEL
102 extern	struct grf_softc grf_softc[];
103 #endif
104