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