xref: /original-bsd/sys/hp/dev/grfvar.h (revision 0a334d47)
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.10 92/01/21$
13  *
14  *	@(#)grfvar.h	7.4 (Berkeley) 06/05/92
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 
64 /* minor device interpretation */
65 #define GRFOVDEV	0x10	/* overlay planes */
66 #define GRFIMDEV	0x20	/* images planes */
67 #define GRFUNIT(d)	((d) & 0x7)
68 
69 #ifdef KERNEL
70 extern	struct grf_softc grf_softc[];
71 extern	struct grfsw grfsw[];
72 extern	int ngrfsw;
73 #endif
74