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