grfioctl.h revision 1.1 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 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the University of
21 * California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * from: Utah $Hdr: grfioctl.h 1.1 90/07/09$
39 *
40 * from: from: @(#)grfioctl.h 7.2 (Berkeley) 11/4/90
41 * $Id: grfioctl.h,v 1.1 1994/07/30 04:21:59 lkestel Exp $
42 */
43
44 struct grfinfo {
45 int gd_id; /* HPUX identifier */
46 caddr_t gd_regaddr; /* control registers physaddr */
47 int gd_regsize; /* control registers size */
48 caddr_t gd_fbaddr; /* frame buffer physaddr */
49 int gd_fbsize; /* frame buffer size */
50 short gd_colors; /* number of colors */
51 short gd_planes; /* number of planes */
52 /* new stuff */
53 int gd_fbwidth; /* frame buffer width */
54 int gd_fbheight; /* frame buffer height */
55 int gd_fbrowbytes; /* frame buffer rowbytes */
56 int gd_dwidth; /* displayed part width */
57 int gd_dheight; /* displayed part height */
58 int gd_pad[6]; /* for future expansion */
59 };
60
61 /* types */
62 #define GRFMAC 8
63
64 /*
65 * HPUX ioctls (here for the benefit of the driver)
66 */
67 struct grf_slot {
68 int slot;
69 u_char *addr;
70 };
71
72 #ifndef _IOH
73 #define _IOH(x,y) (IOC_IN|((x)<<8)|y) /* IOC_IN is IOC_VOID */
74
75 #define GCID _IOR('G', 0, int)
76 #define GCON _IOH('G', 1)
77 #define GCOFF _IOH('G', 2)
78 #define GCAON _IOH('G', 3)
79 #define GCAOFF _IOH('G', 4)
80 #define GCMAP _IOWR('G', 5, int)
81 #define GCUNMAP _IOWR('G', 6, int)
82 #define GCLOCK _IOH('G', 7)
83 #define GCUNLOCK _IOH('G', 8)
84 #define GCLOCK_MINIMUM _IOH('G', 9)
85 #define GCUNLOCK_MINIMUM _IOH('G', 10)
86 #define GCSTATIC_CMAP _IOH('G', 11)
87 #define GCVARIABLE_CMAP _IOH('G', 12)
88 #define GCSLOT _IOWR('G', 13, struct grf_slot)
89
90 /* XXX: for now */
91 #define IOMAPID _IOR('M',0,int) /* ??? */
92 #define IOMAPMAP _IOWR('M',1,int)
93 #define IOMAPUNMAP _IOWR('M',2,int)
94 #endif
95
96 /*
97 * BSD ioctls
98 */
99 #define GRFIOCGINFO _IOR('G', 0, struct grfinfo) /* get info on device */
100 #define GRFIOCON _IO('G', 1) /* turn graphics on */
101 #define GRFIOCOFF _IO('G', 2) /* turn graphics off */
102 #define GRFIOCMAP _IOWR('G', 5, int) /* map in regs+framebuffer */
103 #define GRFIOCUNMAP _IOW('G', 6, int) /* unmap regs+framebuffer */
104
105 /* compat - for old grfinfo structure */
106 struct ogrfinfo { char oinfo[24]; };
107 #define OGRFIOCGINFO _IOR('G', 0, struct ogrfinfo)
108