xref: /original-bsd/sys/hp/dev/grfioctl.h (revision f51da917)
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: grfioctl.h 1.17 93/08/13$
13  *
14  *	@(#)grfioctl.h	8.2 (Berkeley) 09/09/93
15  */
16 
17 struct	grfinfo {
18 	int	gd_id;			/* HPUX identifier */
19 	caddr_t	gd_regaddr;		/* control registers physaddr */
20 	int	gd_regsize;		/* control registers size */
21 	caddr_t	gd_fbaddr;		/* frame buffer physaddr */
22 	int	gd_fbsize;		/* frame buffer size */
23 	short	gd_colors;		/* number of colors */
24 	short	gd_planes;		/* number of planes */
25 /* new stuff */
26 	int	gd_fbwidth;		/* frame buffer width */
27 	int	gd_fbheight;		/* frame buffer height */
28 	int	gd_dwidth;		/* displayed part width */
29 	int	gd_dheight;		/* displayed part height */
30 	int	gd_pad[6];		/* for future expansion */
31 };
32 
33 /* types */
34 #define GRFGATOR	8
35 #define GRFBOBCAT	9
36 #define	GRFCATSEYE	9
37 #define GRFRBOX		10
38 #define GRFFIREEYE	11
39 #define GRFHYPERION	12
40 #define GRFDAVINCI	14
41 
42 /*
43  * HPUX ioctls (here for the benefit of the driver)
44  */
45 struct	grf_slot {
46 	int	slot;
47 	u_char	*addr;
48 };
49 
50 struct	grf_fbinfo {
51 	int	id;
52 	int	mapsize;
53 	int	dwidth, dlength;
54 	int	width, length;
55 	int	xlen;
56 	int	bpp, bppu;
57 	int	npl, nplbytes;
58 	char	name[32];
59 	int	attr;
60 	caddr_t	fbbase, regbase;
61 	caddr_t	regions[6];
62 };
63 
64 #ifndef _IOH
65 #define _IOH(x,y)	(IOC_IN|((x)<<8)|y)	/* IOC_IN is IOC_VOID */
66 
67 #define	GCID		_IOR('G', 0, int)
68 #define	GCON		_IOH('G', 1)
69 #define	GCOFF		_IOH('G', 2)
70 #define	GCAON		_IOH('G', 3)
71 #define	GCAOFF		_IOH('G', 4)
72 #define	GCMAP		_IOWR('G', 5, int)
73 #define	GCUNMAP		_IOWR('G', 6, int)
74 #define	GCLOCK		_IOH('G', 7)
75 #define	GCUNLOCK	_IOH('G', 8)
76 #define	GCLOCK_MINIMUM	_IOH('G', 9)
77 #define	GCUNLOCK_MINIMUM _IOH('G', 10)
78 #define	GCSTATIC_CMAP	_IOH('G', 11)
79 #define	GCVARIABLE_CMAP _IOH('G', 12)
80 #define GCSLOT		_IOWR('G', 13, struct grf_slot)
81 #define GCDESCRIBE	_IOR('G', 21, struct grf_fbinfo)
82 
83 /* XXX: for now */
84 #define	IOMAPID		_IOR('M',0,int)	/* ??? */
85 #define	IOMAPMAP	_IOWR('M',1,int)
86 #define	IOMAPUNMAP	_IOWR('M',2,int)
87 #endif
88 
89 /*
90  * BSD ioctls
91  */
92 #define	GRFIOCGINFO	_IOR('G', 0, struct grfinfo) /* get info on device */
93 #define	GRFIOCON	_IO('G', 1)		/* turn graphics on */
94 #define	GRFIOCOFF	_IO('G', 2)		/* turn graphics off */
95 #define GRFIOCMAP	_IOWR('G', 5, int)	/* map in regs+framebuffer */
96 #define GRFIOCUNMAP	_IOW('G', 6, int)	/* unmap regs+framebuffer */
97