1 /* $NetBSD: grfvar.h,v 1.28 2005/12/11 12:18:02 christos Exp $ */
4 * Copyright (c) 1990 The Regents of the University of California.
7 * This code is derived from software contributed to Berkeley by
8 * the Systems Programming Group of the University of Utah Computer
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. Neither the name of the University nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * from: Utah $Hdr: grfvar.h 1.9 91/01/21$
37 * @(#)grfvar.h 7.3 (Berkeley) 5/7/91
40 * Copyright (c) 1988 University of Utah.
42 * This code is derived from software contributed to Berkeley by
43 * the Systems Programming Group of the University of Utah Computer
46 * Redistribution and use in source and binary forms, with or without
47 * modification, are permitted provided that the following conditions
49 * 1. Redistributions of source code must retain the above copyright
50 * notice, this list of conditions and the following disclaimer.
51 * 2. Redistributions in binary form must reproduce the above copyright
52 * notice, this list of conditions and the following disclaimer in the
53 * documentation and/or other materials provided with the distribution.
54 * 3. All advertising materials mentioning features or use of this software
55 * must display the following acknowledgement:
56 * This product includes software developed by the University of
57 * California, Berkeley and its contributors.
58 * 4. Neither the name of the University nor the names of its contributors
59 * may be used to endorse or promote products derived from this software
60 * without specific prior written permission.
62 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
63 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
64 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
65 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
66 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
67 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
68 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
69 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
70 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
71 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
74 * from: Utah $Hdr: grfvar.h 1.9 91/01/21$
76 * @(#)grfvar.h 7.3 (Berkeley) 5/7/91
79 #define CARD_NAME_LEN 64
82 * State info, per hardware instance.
88 bus_addr_t sc_basepa
; /* base of video space */
89 bus_addr_t sc_fbofs
; /* offset to framebuffer */
91 bus_space_tag_t sc_tag
;
92 bus_space_handle_t sc_handle
;
93 bus_space_handle_t sc_regh
;
95 struct grfmode curr_mode
; /* hardware desc(for ioctl) */
96 u_int32_t card_id
; /* DrHW value for nubus cards */
97 bus_size_t cli_offset
; /* Offset to clear interrupt */
98 /* for cards where that's suff. */
99 u_int32_t cli_value
; /* Value to write at cli_offset */
100 nubus_dir board_dir
; /* Nubus dir for curr board */
104 * State info, per grf instance.
107 char sc_xname
[15]; /* name of the device */
108 struct macfb_softc
*mfb_sc
;
112 * Attach grf and ite semantics to Mac video hardware.
114 struct grfbus_attach_args
{
115 const char *ga_name
; /* name of semantics to attach */
116 bus_space_tag_t ga_tag
; /* forwarded ... */
117 bus_space_handle_t ga_handle
;
118 struct grfmode
*ga_grfmode
;
122 int (*ga_mode
)(struct grf_softc
*, int, void *);
125 typedef void *(*grf_phys_t
)(struct grf_softc
*, vaddr_t
);
128 #define GF_ALIVE 0x01
130 #define GF_EXCLUDE 0x04
131 #define GF_WANTED 0x08
132 #define GF_BSDOPEN 0x10
133 #define GF_HPUXOPEN 0x20
135 /* requests to mode routine */
138 #define GM_CURRMODE 3
139 #define GM_LISTMODES 4
142 /* minor device interpretation */
143 #define GRFUNIT(d) (minor(d))
146 * Nubus image data structure. This is the equivalent of a PixMap in
147 * MacOS programming parlance. One of these structures exists for each
148 * video mode that a quickdraw compatible card can fit in.
167 u_int32_t planeBytes
;
171 #define VID_TABLE_OFFSET 2
172 #define VID_PAGE_CNT 3
173 #define VID_DEV_TYPE 4
175 void grf_attach(struct macfb_softc
*, int);
177 void grf_establish(struct grfbus_softc
*, nubus_slot
*,
178 int (*)(struct grf_softc
*, int, void *));
179 int grfbusprint(void *, const char *);