xref: /csrg-svn/sys/hp/dev/grfvar.h (revision 49311)
141480Smckusick /*
241480Smckusick  * Copyright (c) 1988 University of Utah.
341480Smckusick  * Copyright (c) 1990 The Regents of the University of California.
441480Smckusick  * All rights reserved.
541480Smckusick  *
641480Smckusick  * This code is derived from software contributed to Berkeley by
741480Smckusick  * the Systems Programming Group of the University of Utah Computer
841480Smckusick  * Science Department.
941480Smckusick  *
1041480Smckusick  * %sccs.include.redist.c%
1141480Smckusick  *
12*49311Shibler  * from: Utah $Hdr: grfvar.h 1.9 91/01/21$
1341480Smckusick  *
14*49311Shibler  *	@(#)grfvar.h	7.3 (Berkeley) 05/07/91
1541480Smckusick  */
1641480Smckusick 
17*49311Shibler /* internal structure of lock page */
1841480Smckusick #define GRFMAXLCK	256
19*49311Shibler struct	grf_lockpage {
20*49311Shibler 	u_char	gl_locks[GRFMAXLCK];
21*49311Shibler };
22*49311Shibler #define gl_lockslot gl_locks[0]
2341480Smckusick 
2441480Smckusick /* per display info */
2541480Smckusick struct	grf_softc {
2641480Smckusick 	int	g_flags;		/* software flags */
2741480Smckusick 	int	g_type;			/* type of display */
28*49311Shibler 	caddr_t	g_regkva;		/* KVA of registers */
29*49311Shibler 	caddr_t	g_fbkva;		/* KVA of framebuffer */
30*49311Shibler 	struct	grfinfo g_display;	/* hardware description (for ioctl) */
31*49311Shibler 	struct	grf_lockpage *g_lock;	/* lock page associated with device */
3241480Smckusick 	struct	proc *g_lockp;		/* process holding lock */
33*49311Shibler 	short	*g_pid;			/* array of pids with device open */
3441480Smckusick 	int	g_lockpslot;		/* g_pid entry of g_lockp */
35*49311Shibler 	caddr_t	g_data;			/* device dependent data */
3641480Smckusick };
3741480Smckusick 
3841480Smckusick /* flags */
3941480Smckusick #define	GF_ALIVE	0x01
4041480Smckusick #define GF_OPEN		0x02
4141480Smckusick #define GF_EXCLUDE	0x04
4241480Smckusick #define GF_WANTED	0x08
4341480Smckusick #define GF_BSDOPEN	0x10
4441480Smckusick #define GF_HPUXOPEN	0x20
4541480Smckusick 
4641480Smckusick /* display types - indices into grfdev */
4741480Smckusick #define	GT_TOPCAT	0
4841480Smckusick #define	GT_GATORBOX	1
4941480Smckusick #define	GT_RENAISSANCE	2
5041480Smckusick #define GT_LRCATSEYE	3
5141480Smckusick #define GT_HRCCATSEYE	4
5241480Smckusick #define GT_HRMCATSEYE	5
5341480Smckusick #define GT_DAVINCI	6
5441480Smckusick 
5541480Smckusick struct	grfdev {
5641480Smckusick 	int	gd_hardid;	/* secondary id returned by hardware */
5741480Smckusick 	int	gd_softid;	/* id returned by HP-UX */
5841480Smckusick 	int	(*gd_init)();	/* boot time initialization */
5941480Smckusick 	int	(*gd_mode)();	/* misc functions */
6041480Smckusick 	char	*gd_desc;	/* text description */
6141480Smckusick };
6241480Smckusick 
6341480Smckusick /* hardware ids */
6441480Smckusick #define GID_GATORBOX	1
6541480Smckusick #define	GID_TOPCAT	2
6641480Smckusick #define GID_RENAISSANCE	4
6741480Smckusick #define GID_LRCATSEYE	5
6841480Smckusick #define GID_HRCCATSEYE	6
6941480Smckusick #define GID_HRMCATSEYE	7
7041480Smckusick #define GID_DAVINCI	8
7141480Smckusick 
7241480Smckusick /* software ids defined in grfioctl.h */
7341480Smckusick 
7441480Smckusick /* requests to mode routine */
7541480Smckusick #define GM_GRFON	1
7641480Smckusick #define GM_GRFOFF	2
7741480Smckusick #define GM_GRFOVON	3
7841480Smckusick #define GM_GRFOVOFF	4
7941480Smckusick 
8041480Smckusick struct	grfreg {
8141480Smckusick 	char	gr_pad0;
8241480Smckusick 	u_char	gr_id;		/* +0x01 */
8341480Smckusick 	char	gr_pad1[0x13];
8441480Smckusick 	u_char	gr_id2;		/* +0x15 */
8541480Smckusick 	char	gr_pad2[0x47];
8641480Smckusick 	u_char	gr_fbomsb;	/* +0x5d */
8741480Smckusick 	char	gr_pad3;
8841480Smckusick 	u_char	gr_fbolsb;	/* +0x5f */
8941480Smckusick };
9041480Smckusick /* bitmapped display hardware id */
9141480Smckusick #define GRFHWID		0x39
9241480Smckusick 
9341480Smckusick /* internal bitmapped display address */
9441480Smckusick #define GRFIADDR	0x560000
9541480Smckusick 
9641480Smckusick /* minor device interpretation */
9741480Smckusick #define GRFOVDEV	0x10	/* overlay planes */
9841480Smckusick #define GRFIMDEV	0x20	/* images planes */
9941480Smckusick #define GRFUNIT(d)	((d) & 0x7)
10041480Smckusick 
10141480Smckusick #ifdef KERNEL
10241480Smckusick extern	struct grf_softc grf_softc[];
10341480Smckusick #endif
104