tgavar.h revision 1.6 1 1.6 elric /* $NetBSD: tgavar.h,v 1.6 2000/03/05 07:57:52 elric Exp $ */
2 1.1 drochner
3 1.1 drochner /*
4 1.1 drochner * Copyright (c) 1995, 1996 Carnegie-Mellon University.
5 1.1 drochner * All rights reserved.
6 1.1 drochner *
7 1.1 drochner * Author: Chris G. Demetriou
8 1.1 drochner *
9 1.1 drochner * Permission to use, copy, modify and distribute this software and
10 1.1 drochner * its documentation is hereby granted, provided that both the copyright
11 1.1 drochner * notice and this permission notice appear in all copies of the
12 1.1 drochner * software, derivative works or modified versions, and any portions
13 1.1 drochner * thereof, and that both notices appear in supporting documentation.
14 1.1 drochner *
15 1.1 drochner * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 1.1 drochner * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 1.1 drochner * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18 1.1 drochner *
19 1.1 drochner * Carnegie Mellon requests users of this software to return to
20 1.1 drochner *
21 1.1 drochner * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU
22 1.1 drochner * School of Computer Science
23 1.1 drochner * Carnegie Mellon University
24 1.1 drochner * Pittsburgh PA 15213-3890
25 1.1 drochner *
26 1.1 drochner * any improvements or extensions that they make and grant Carnegie the
27 1.1 drochner * rights to redistribute these changes.
28 1.1 drochner */
29 1.1 drochner
30 1.5 elric #include <dev/ic/ramdac.h>
31 1.1 drochner #include <dev/pci/tgareg.h>
32 1.1 drochner #include <dev/rcons/raster.h>
33 1.1 drochner #include <dev/wscons/wsconsio.h>
34 1.1 drochner #include <dev/wscons/wscons_raster.h>
35 1.1 drochner
36 1.1 drochner struct tga_devconfig;
37 1.1 drochner struct fbcmap;
38 1.1 drochner struct fbcursor;
39 1.1 drochner struct fbcurpos;
40 1.1 drochner
41 1.1 drochner struct tga_conf {
42 1.1 drochner char *tgac_name; /* name for this board type */
43 1.1 drochner
44 1.1 drochner int tgac_phys_depth; /* physical frame buffer depth */
45 1.2 eeh vsize_t tgac_cspace_size; /* core space size */
46 1.2 eeh vsize_t tgac_vvbr_units; /* what '1' in the VVBR means */
47 1.1 drochner
48 1.1 drochner int tgac_ndbuf; /* number of display buffers */
49 1.2 eeh vaddr_t tgac_dbuf[2]; /* display buffer offsets/addresses */
50 1.2 eeh vsize_t tgac_dbufsz[2]; /* display buffer sizes */
51 1.1 drochner
52 1.1 drochner int tgac_nbbuf; /* number of display buffers */
53 1.2 eeh vaddr_t tgac_bbuf[2]; /* back buffer offsets/addresses */
54 1.2 eeh vsize_t tgac_bbufsz[2]; /* back buffer sizes */
55 1.1 drochner };
56 1.1 drochner
57 1.1 drochner struct tga_devconfig {
58 1.1 drochner bus_space_tag_t dc_memt;
59 1.1 drochner pci_chipset_tag_t dc_pc;
60 1.1 drochner
61 1.1 drochner pcitag_t dc_pcitag; /* PCI tag */
62 1.1 drochner bus_addr_t dc_pcipaddr; /* PCI phys addr. */
63 1.1 drochner
64 1.1 drochner tga_reg_t *dc_regs; /* registers; XXX: need aliases */
65 1.1 drochner
66 1.1 drochner int dc_tga_type; /* the device type; see below */
67 1.6 elric int dc_tga2; /* True if it is a TGA2 */
68 1.1 drochner const struct tga_conf *dc_tgaconf; /* device buffer configuration */
69 1.1 drochner
70 1.5 elric struct ramdac_funcs
71 1.5 elric *dc_ramdac_funcs; /* The RAMDAC functions */
72 1.5 elric struct ramdac_cookie
73 1.5 elric *dc_ramdac_cookie; /* the RAMDAC type; see above */
74 1.5 elric
75 1.2 eeh vaddr_t dc_vaddr; /* memory space virtual base address */
76 1.2 eeh paddr_t dc_paddr; /* memory space physical base address */
77 1.1 drochner
78 1.1 drochner int dc_wid; /* width of frame buffer */
79 1.1 drochner int dc_ht; /* height of frame buffer */
80 1.1 drochner int dc_rowbytes; /* bytes in a FB scan line */
81 1.1 drochner
82 1.2 eeh vaddr_t dc_videobase; /* base of flat frame buffer */
83 1.1 drochner
84 1.1 drochner struct raster dc_raster; /* raster description */
85 1.1 drochner struct rcons dc_rcons; /* raster blitter control info */
86 1.1 drochner
87 1.1 drochner int dc_blanked; /* currently had video disabled */
88 1.1 drochner void *dc_ramdac_private; /* RAMDAC private storage */
89 1.5 elric
90 1.5 elric void (*dc_ramdac_intr) __P((void *));
91 1.1 drochner };
92 1.1 drochner
93 1.1 drochner struct tga_softc {
94 1.1 drochner struct device sc_dev;
95 1.1 drochner
96 1.1 drochner struct tga_devconfig *sc_dc; /* device configuration */
97 1.1 drochner void *sc_intr; /* interrupt handler info */
98 1.1 drochner /* XXX should record intr fns/arg */
99 1.1 drochner
100 1.1 drochner int nscreens;
101 1.1 drochner };
102 1.1 drochner
103 1.1 drochner #define TGA_TYPE_T8_01 0 /* 8bpp, 1MB */
104 1.1 drochner #define TGA_TYPE_T8_02 1 /* 8bpp, 2MB */
105 1.1 drochner #define TGA_TYPE_T8_22 2 /* 8bpp, 4MB */
106 1.1 drochner #define TGA_TYPE_T8_44 3 /* 8bpp, 8MB */
107 1.1 drochner #define TGA_TYPE_T32_04 4 /* 32bpp, 4MB */
108 1.1 drochner #define TGA_TYPE_T32_08 5 /* 32bpp, 8MB */
109 1.1 drochner #define TGA_TYPE_T32_88 6 /* 32bpp, 16MB */
110 1.1 drochner #define TGA_TYPE_UNKNOWN 7 /* unknown */
111 1.1 drochner
112 1.1 drochner #define DEVICE_IS_TGA(class, id) \
113 1.6 elric (((PCI_VENDOR(id) == PCI_VENDOR_DEC && \
114 1.6 elric PCI_PRODUCT(id) == PCI_PRODUCT_DEC_21030) || \
115 1.6 elric PCI_PRODUCT(id) == PCI_PRODUCT_DEC_PBXGB) ? 10 : 0)
116 1.1 drochner
117 1.1 drochner int tga_cnattach __P((bus_space_tag_t, bus_space_tag_t, pci_chipset_tag_t,
118 1.1 drochner int, int, int));
119 1.1 drochner
120 1.1 drochner int tga_identify __P((tga_reg_t *));
121 1.1 drochner const struct tga_conf *tga_getconf __P((int));
122 1.1 drochner
123 1.1 drochner int tga_builtin_set_cursor __P((struct tga_devconfig *,
124 1.1 drochner struct wsdisplay_cursor *));
125 1.1 drochner int tga_builtin_get_cursor __P((struct tga_devconfig *,
126 1.1 drochner struct wsdisplay_cursor *));
127 1.1 drochner int tga_builtin_set_curpos __P((struct tga_devconfig *,
128 1.1 drochner struct wsdisplay_curpos *));
129 1.1 drochner int tga_builtin_get_curpos __P((struct tga_devconfig *,
130 1.1 drochner struct wsdisplay_curpos *));
131 1.1 drochner int tga_builtin_get_curmax __P((struct tga_devconfig *,
132 1.1 drochner struct wsdisplay_curpos *));
133