grfvar.h revision 1.8 1 /* $NetBSD: grfvar.h,v 1.8 1995/07/06 17:13:51 briggs Exp $ */
2
3 /*
4 * Copyright (c) 1988 University of Utah.
5 * Copyright (c) 1990 The Regents of the University of California.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by
9 * the Systems Programming Group of the University of Utah Computer
10 * Science Department.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 * 3. All advertising materials mentioning features or use of this software
21 * must display the following acknowledgement:
22 * This product includes software developed by the University of
23 * California, Berkeley and its contributors.
24 * 4. Neither the name of the University nor the names of its contributors
25 * may be used to endorse or promote products derived from this software
26 * without specific prior written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
29 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
32 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 * SUCH DAMAGE.
39 *
40 * from: Utah $Hdr: grfvar.h 1.9 91/01/21$
41 *
42 * @(#)grfvar.h 7.3 (Berkeley) 5/7/91
43 */
44
45 #define CARD_NAME_LEN 64
46 /* per display info */
47 struct grf_softc {
48 struct device sc_dev;
49 nubus_slot sc_slot;
50
51 char card_name[CARD_NAME_LEN];
52 struct grfmode curr_mode; /* hardware desc(for ioctl) */
53 u_int32_t g_flags; /* software flags */
54 u_int32_t g_type; /* index into grfdev */
55 u_int16_t card_id; /* DrHW value for nubus cards */
56 nubus_dir board_dir; /* Nubus dir for curr board */
57 caddr_t g_data; /* device dependent data */
58 };
59
60 /* flags */
61 #define GF_ALIVE 0x01
62 #define GF_OPEN 0x02
63 #define GF_EXCLUDE 0x04
64 #define GF_WANTED 0x08
65 #define GF_BSDOPEN 0x10
66 #define GF_HPUXOPEN 0x20
67
68 /* display types - indices into grfdev */
69 #define GT_MACVIDEO 0
70 #define GT_INTERNALVIDEO 1
71
72 struct grfdev {
73 int gd_softid; /* DrSW */
74 int (*gd_probe)(); /* probe routine */
75 int (*gd_init) (); /* boot time initialization */
76 int (*gd_mode) (); /* mode-change on/off/mode function */
77 char *gd_desc; /* text description */
78 caddr_t (*gd_phys) (); /* map virtual addr to physical addr */
79 };
80
81 /* requests to mode routine */
82 #define GM_GRFON 1
83 #define GM_GRFOFF 2
84 #define GM_CURRMODE 3
85 #define GM_LISTMODES 4
86 #define GM_NEWMODE 5
87
88 /* minor device interpretation */
89 #define GRFUNIT(d) ((d) & 0x7)
90
91 /*
92 * Nubus image data structure. This is the equivalent of a PixMap in
93 * MacOS programming parlance. One of these structures exists for each
94 * video mode that a quickdraw compatible card can fit in.
95 */
96 struct image_data {
97 u_int32_t size;
98 u_int32_t offset;
99 u_int16_t rowbytes;
100 u_int16_t top;
101 u_int16_t left;
102 u_int16_t bottom;
103 u_int16_t right;
104 u_int16_t version;
105 u_int16_t packType;
106 u_int32_t packSize;
107 u_int32_t hRes;
108 u_int32_t vRes;
109 u_int16_t pixelType;
110 u_int16_t pixelSize;
111 u_int16_t cmpCount;
112 u_int16_t cmpSize;
113 u_int32_t planeBytes;
114 };
115
116 #define VID_PARAMS 1
117 #define VID_TABLE_OFFSET 2
118 #define VID_PAGE_CNT 3
119 #define VID_DEV_TYPE 4
120