xref: /original-bsd/sys/hp/dev/grfvar.h (revision de74e4df)
1 /*
2  * Copyright (c) 1988 University of Utah.
3  * Copyright (c) 1990, 1993
4  *	The Regents of the University of California.  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.11 93/08/13$
13  *
14  *	@(#)grfvar.h	8.2 (Berkeley) 09/09/93
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 /*
25  * Static configuration info for display types
26  */
27 struct	grfsw {
28 	int	gd_hwid;	/* id returned by hardware */
29 	int	gd_swid;	/* id to be returned by software */
30 	char	*gd_desc;	/* description printed at config time */
31 	int	(*gd_init)();	/* boot time init routine */
32 	int	(*gd_mode)();	/* misc function routine */
33 };
34 
35 /* per display info */
36 struct	grf_softc {
37 	int	g_flags;		/* software flags */
38 	struct  grfsw *g_sw;		/* static configuration info */
39 	caddr_t	g_regkva;		/* KVA of registers */
40 	caddr_t	g_fbkva;		/* KVA of framebuffer */
41 	struct	grfinfo g_display;	/* hardware description (for ioctl) */
42 	struct	grf_lockpage *g_lock;	/* lock page associated with device */
43 	struct	proc *g_lockp;		/* process holding lock */
44 	short	*g_pid;			/* array of pids with device open */
45 	int	g_lockpslot;		/* g_pid entry of g_lockp */
46 	caddr_t	g_data;			/* device dependent data */
47 };
48 
49 /* flags */
50 #define	GF_ALIVE	0x01
51 #define GF_OPEN		0x02
52 #define GF_EXCLUDE	0x04
53 #define GF_WANTED	0x08
54 #define GF_BSDOPEN	0x10
55 #define GF_HPUXOPEN	0x20
56 
57 /* requests to mode routine */
58 #define GM_GRFON	1
59 #define GM_GRFOFF	2
60 #define GM_GRFOVON	3
61 #define GM_GRFOVOFF	4
62 #define GM_DESCRIBE	5
63 #define GM_MAP		6
64 #define GM_UNMAP	7
65 
66 /* minor device interpretation */
67 #define GRFOVDEV	0x10	/* overlay planes */
68 #define GRFIMDEV	0x20	/* images planes */
69 #define GRFUNIT(d)	((d) & 0x7)
70 
71 #ifdef KERNEL
72 extern	struct grf_softc grf_softc[];
73 extern	struct grfsw grfsw[];
74 extern	int ngrfsw;
75 #endif
76