sticvar.h revision 1.18 1 1.18 joerg /* $NetBSD: sticvar.h,v 1.18 2008/07/09 13:19:33 joerg Exp $ */
2 1.1 jonathan
3 1.4 ad /*-
4 1.7 ad * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
5 1.1 jonathan * All rights reserved.
6 1.1 jonathan *
7 1.4 ad * This code is derived from software contributed to The NetBSD Foundation
8 1.4 ad * by Andrew Doran.
9 1.4 ad *
10 1.1 jonathan * Redistribution and use in source and binary forms, with or without
11 1.1 jonathan * modification, are permitted provided that the following conditions
12 1.1 jonathan * are met:
13 1.1 jonathan * 1. Redistributions of source code must retain the above copyright
14 1.1 jonathan * notice, this list of conditions and the following disclaimer.
15 1.1 jonathan * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 jonathan * notice, this list of conditions and the following disclaimer in the
17 1.1 jonathan * documentation and/or other materials provided with the distribution.
18 1.1 jonathan *
19 1.4 ad * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 1.4 ad * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.4 ad * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.4 ad * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 1.4 ad * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.4 ad * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.4 ad * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.4 ad * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.4 ad * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.4 ad * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.4 ad * POSSIBILITY OF SUCH DAMAGE.
30 1.1 jonathan */
31 1.1 jonathan
32 1.1 jonathan #ifndef _TC_STICVAR_H_
33 1.1 jonathan #define _TC_STICVAR_H_
34 1.1 jonathan
35 1.4 ad #if defined(pmax)
36 1.4 ad #define STIC_KSEG_TO_PHYS(x) MIPS_KSEG0_TO_PHYS(x)
37 1.4 ad #elif defined(alpha)
38 1.8 ad #define STIC_KSEG_TO_PHYS(x) ALPHA_K0SEG_TO_PHYS((vaddr_t)x)
39 1.11 wiz #else
40 1.11 wiz #error No support for your architecture
41 1.4 ad #endif
42 1.4 ad
43 1.9 ad #define STIC_MAXDV 5
44 1.9 ad
45 1.4 ad struct stic_hwcmap256 {
46 1.4 ad #define CMAP_SIZE 256 /* 256 R/G/B entries */
47 1.4 ad u_int8_t r[CMAP_SIZE];
48 1.4 ad u_int8_t g[CMAP_SIZE];
49 1.4 ad u_int8_t b[CMAP_SIZE];
50 1.4 ad };
51 1.4 ad
52 1.4 ad struct stic_hwcursor64 {
53 1.4 ad struct wsdisplay_curpos cc_pos;
54 1.4 ad struct wsdisplay_curpos cc_hot;
55 1.4 ad struct wsdisplay_curpos cc_size;
56 1.4 ad #define CURSOR_MAX_SIZE 64
57 1.4 ad u_int8_t cc_color[6];
58 1.14 chs u_int64_t cc_image[CURSOR_MAX_SIZE];
59 1.14 chs u_int64_t cc_mask[CURSOR_MAX_SIZE];
60 1.4 ad };
61 1.4 ad
62 1.4 ad struct stic_screen {
63 1.4 ad struct stic_info *ss_si;
64 1.4 ad u_int16_t *ss_backing;
65 1.4 ad int ss_flags;
66 1.4 ad int ss_curx;
67 1.4 ad int ss_cury;
68 1.4 ad };
69 1.4 ad
70 1.7 ad #define SS_ALLOCED 0x01
71 1.7 ad #define SS_ACTIVE 0x02
72 1.8 ad #define SS_CURENB 0x04
73 1.4 ad
74 1.4 ad struct stic_info {
75 1.9 ad struct device *si_dv;
76 1.9 ad
77 1.4 ad u_int32_t *si_stamp;
78 1.6 ad u_int32_t *si_buf;
79 1.4 ad u_int32_t *si_vdac;
80 1.4 ad u_int32_t *si_vdac_reset;
81 1.4 ad volatile struct stic_regs *si_stic;
82 1.9 ad volatile struct stic_xcomm *si_sxc;
83 1.4 ad
84 1.4 ad u_int32_t *(*si_pbuf_get)(struct stic_info *);
85 1.4 ad int (*si_pbuf_post)(struct stic_info *, u_int32_t *);
86 1.16 christos int (*si_ioctl)(struct stic_info *, u_long, void *, int,
87 1.15 christos struct lwp *);
88 1.4 ad int si_pbuf_select;
89 1.9 ad int si_hwflags;
90 1.4 ad
91 1.4 ad struct stic_screen *si_curscreen;
92 1.4 ad struct wsdisplay_font *si_font;
93 1.4 ad
94 1.4 ad int si_consw;
95 1.4 ad int si_consh;
96 1.4 ad int si_fontw;
97 1.4 ad int si_fonth;
98 1.4 ad int si_stamph;
99 1.10 ad int si_stamphm;
100 1.4 ad int si_stampw;
101 1.4 ad int si_depth;
102 1.9 ad int si_disptype;
103 1.9 ad int si_dispmode;
104 1.9 ad int si_unit;
105 1.4 ad
106 1.4 ad tc_addr_t si_slotbase;
107 1.6 ad paddr_t si_buf_phys;
108 1.6 ad size_t si_buf_size;
109 1.4 ad
110 1.7 ad int si_flags;
111 1.7 ad struct stic_hwcursor64 si_cursor;
112 1.7 ad struct stic_hwcmap256 si_cmap;
113 1.4 ad
114 1.4 ad struct callout si_switch_callout;
115 1.4 ad void (*si_switchcb)(void *, int, int);
116 1.4 ad void *si_switchcbarg;
117 1.4 ad };
118 1.1 jonathan
119 1.7 ad #define SI_CURENB_CHANGED 0x0001
120 1.7 ad #define SI_CURCMAP_CHANGED 0x0002
121 1.7 ad #define SI_CURSHAPE_CHANGED 0x0004
122 1.7 ad #define SI_CMAP_CHANGED 0x0008
123 1.7 ad #define SI_ALL_CHANGED 0x000f
124 1.9 ad #define SI_DVOPEN 0x0010
125 1.7 ad
126 1.4 ad void stic_init(struct stic_info *);
127 1.18 joerg void stic_attach(device_t, struct stic_info *, int);
128 1.4 ad void stic_cnattach(struct stic_info *);
129 1.4 ad void stic_reset(struct stic_info *);
130 1.4 ad void stic_flush(struct stic_info *);
131 1.4 ad
132 1.4 ad extern struct stic_info stic_consinfo;
133 1.2 nisimura
134 1.4 ad #endif /* !_TC_STICVAR_H_ */
135