igsfbvar.h revision 1.1.2.2 1 1.1.2.2 nathanw /* $NetBSD: igsfbvar.h,v 1.1.2.2 2002/04/17 00:05:39 nathanw Exp $ */
2 1.1.2.2 nathanw
3 1.1.2.2 nathanw /*
4 1.1.2.2 nathanw * Copyright (c) 2002 Valeriy E. Ushakov
5 1.1.2.2 nathanw * All rights reserved.
6 1.1.2.2 nathanw *
7 1.1.2.2 nathanw * Redistribution and use in source and binary forms, with or without
8 1.1.2.2 nathanw * modification, are permitted provided that the following conditions
9 1.1.2.2 nathanw * are met:
10 1.1.2.2 nathanw * 1. Redistributions of source code must retain the above copyright
11 1.1.2.2 nathanw * notice, this list of conditions and the following disclaimer.
12 1.1.2.2 nathanw * 2. Redistributions in binary form must reproduce the above copyright
13 1.1.2.2 nathanw * notice, this list of conditions and the following disclaimer in the
14 1.1.2.2 nathanw * documentation and/or other materials provided with the distribution.
15 1.1.2.2 nathanw * 3. The name of the author may not be used to endorse or promote products
16 1.1.2.2 nathanw * derived from this software without specific prior written permission
17 1.1.2.2 nathanw *
18 1.1.2.2 nathanw * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 1.1.2.2 nathanw * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 1.1.2.2 nathanw * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 1.1.2.2 nathanw * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 1.1.2.2 nathanw * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 1.1.2.2 nathanw * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 1.1.2.2 nathanw * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 1.1.2.2 nathanw * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 1.1.2.2 nathanw * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 1.1.2.2 nathanw * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 1.1.2.2 nathanw */
29 1.1.2.2 nathanw
30 1.1.2.2 nathanw /*
31 1.1.2.2 nathanw * Integraphics Systems IGA 1682 and (untested) CyberPro 2k.
32 1.1.2.2 nathanw */
33 1.1.2.2 nathanw #ifndef _DEV_IC_IGSFBVAR_H_
34 1.1.2.2 nathanw #define _DEV_IC_IGSFBVAR_H_
35 1.1.2.2 nathanw
36 1.1.2.2 nathanw
37 1.1.2.2 nathanw #define IGS_CMAP_SIZE 256 /* 256 R/G/B entries */
38 1.1.2.2 nathanw struct igs_hwcmap {
39 1.1.2.2 nathanw u_int8_t r[IGS_CMAP_SIZE];
40 1.1.2.2 nathanw u_int8_t g[IGS_CMAP_SIZE];
41 1.1.2.2 nathanw u_int8_t b[IGS_CMAP_SIZE];
42 1.1.2.2 nathanw };
43 1.1.2.2 nathanw
44 1.1.2.2 nathanw
45 1.1.2.2 nathanw #define IGS_CURSOR_MAX_SIZE 64 /* 64x64 sprite */
46 1.1.2.2 nathanw struct igs_hwcursor {
47 1.1.2.2 nathanw struct wsdisplay_curpos cc_pos;
48 1.1.2.2 nathanw struct wsdisplay_curpos cc_hot;
49 1.1.2.2 nathanw struct wsdisplay_curpos cc_size;
50 1.1.2.2 nathanw u_int8_t cc_image[512]; /* save copy of image for GCURSOR */
51 1.1.2.2 nathanw u_int8_t cc_mask[512]; /* save copy of mask for GCURSOR */
52 1.1.2.2 nathanw u_int16_t cc_sprite[512]; /* sprite in device 2bpp format */
53 1.1.2.2 nathanw u_int8_t cc_color[6]; /* 2 colors, 3 rgb components */
54 1.1.2.2 nathanw };
55 1.1.2.2 nathanw
56 1.1.2.2 nathanw
57 1.1.2.2 nathanw /*
58 1.1.2.2 nathanw * Precomputed bit tables to convert 1bpp image/mask to 2bpp hw cursor
59 1.1.2.2 nathanw * sprite. For IGSFB_HW_BSWAP attachments they are pre-bswapped as well.
60 1.1.2.2 nathanw */
61 1.1.2.2 nathanw struct igs_bittab {
62 1.1.2.2 nathanw u_int16_t iexpand[256]; /* image: 0 -> 00, 1 -> 01 */
63 1.1.2.2 nathanw u_int16_t mexpand[256]; /* mask: 0 -> 00, 1 -> 11 */
64 1.1.2.2 nathanw };
65 1.1.2.2 nathanw
66 1.1.2.2 nathanw struct igsfb_softc {
67 1.1.2.2 nathanw struct device sc_dev;
68 1.1.2.2 nathanw
69 1.1.2.2 nathanw /* io registers */
70 1.1.2.2 nathanw bus_space_tag_t sc_iot;
71 1.1.2.2 nathanw bus_space_handle_t sc_ioh;
72 1.1.2.2 nathanw
73 1.1.2.2 nathanw /* linear memory */
74 1.1.2.2 nathanw bus_space_tag_t sc_memt;
75 1.1.2.2 nathanw bus_addr_t sc_memaddr; /* memory phys addr */
76 1.1.2.2 nathanw bus_size_t sc_memsz; /* size of linear address space */
77 1.1.2.2 nathanw int sc_memflags;
78 1.1.2.2 nathanw
79 1.1.2.2 nathanw /* fb part actually mapped for wsdisplay */
80 1.1.2.2 nathanw bus_space_handle_t sc_fbh;
81 1.1.2.2 nathanw bus_size_t sc_fbsz;
82 1.1.2.2 nathanw
83 1.1.2.2 nathanw /* 1k of cursor sprite data */
84 1.1.2.2 nathanw bus_space_handle_t sc_crh;
85 1.1.2.2 nathanw
86 1.1.2.2 nathanw /*
87 1.1.2.2 nathanw * graphic coprocessor can be accessed either via i/o space or
88 1.1.2.2 nathanw * via memory-mapped i/o access through memory space.
89 1.1.2.2 nathanw */
90 1.1.2.2 nathanw bus_space_tag_t sc_copt;
91 1.1.2.2 nathanw bus_space_handle_t sc_coph;
92 1.1.2.2 nathanw
93 1.1.2.2 nathanw /* IGA1682 vs CyberPro 2k (use version num. for finer distinction?) */
94 1.1.2.2 nathanw int sc_is2k;
95 1.1.2.2 nathanw
96 1.1.2.2 nathanw /* flags that control driver operation */
97 1.1.2.2 nathanw int sc_hwflags;
98 1.1.2.2 nathanw
99 1.1.2.2 nathanw struct rasops_info *sc_ri;
100 1.1.2.2 nathanw
101 1.1.2.2 nathanw struct igs_hwcmap sc_cmap; /* software copy of colormap */
102 1.1.2.2 nathanw struct igs_hwcursor sc_cursor; /* software copy of cursor sprite */
103 1.1.2.2 nathanw
104 1.1.2.2 nathanw /* precomputed bit tables for cursor sprite 1bpp -> 2bpp conversion */
105 1.1.2.2 nathanw struct igs_bittab *sc_bittab;
106 1.1.2.2 nathanw
107 1.1.2.2 nathanw int nscreens;
108 1.1.2.2 nathanw
109 1.1.2.2 nathanw int sc_blanked; /* screen is currently blanked */
110 1.1.2.2 nathanw int sc_curenb; /* cursor sprite enabled */
111 1.1.2.2 nathanw };
112 1.1.2.2 nathanw
113 1.1.2.2 nathanw /* sc_hwflags */
114 1.1.2.2 nathanw #define IGSFB_HW_BSWAP 1 /* endianness mismatch */
115 1.1.2.2 nathanw
116 1.1.2.2 nathanw
117 1.1.2.2 nathanw /* methods for bus attachment glue */
118 1.1.2.2 nathanw int igsfb_io_enable(bus_space_tag_t, bus_addr_t);
119 1.1.2.2 nathanw void igsfb_mem_enable(struct igsfb_softc *);
120 1.1.2.2 nathanw void igsfb_common_attach(struct igsfb_softc *, int);
121 1.1.2.2 nathanw
122 1.1.2.2 nathanw #endif /* _DEV_IC_IGSFBVAR_H_ */
123