1/*	$NetBSD: tdvfbvar.h,v 1.2 2012/07/20 12:03:32 rkujawa Exp $	*/
2
3/*
4 * Copyright (c) 2012 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Radoslaw Kujawa.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 *    notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 *    notice, this list of conditions and the following disclaimer in the
17 *    documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#ifndef TDVFBVAR_H
32#define TDVFBVAR_H
33
34#include <dev/wscons/wsdisplayvar.h>
35#include <dev/wscons/wsconsio.h>
36#include <dev/wsfont/wsfont.h>
37#include <dev/rasops/rasops.h>
38#include <dev/wscons/wsdisplay_vconsvar.h>
39
40struct tdvfb_dac_timing {
41	uint8_t m;
42	uint8_t n;
43	int fout;
44};
45
46struct tdvfb_softc {
47	device_t sc_dev;
48
49	int sc_voodootype;
50#define TDV_VOODOO_1	1
51#define TDV_VOODOO_2	2
52
53	/* bus attachment, handles */
54	pci_chipset_tag_t sc_pc;
55	pcitag_t sc_pcitag;
56
57	bus_space_tag_t sc_cvgt;
58	bus_space_handle_t sc_cvgh;
59	bus_addr_t sc_cvg_pa;
60
61	bus_space_handle_t sc_fbh;
62
63	/* DAC */
64	struct tdvfb_dac_timing cvg_timing;
65	struct tdvfb_dac_timing vid_timing;
66
67	size_t sc_memsize;
68	const struct videomode *sc_videomode;
69	int sc_width, sc_height, sc_linebytes, sc_bpp;
70	int sc_x_tiles;
71
72	int sc_mode;
73	uint32_t sc_bg;
74
75	struct vcons_screen sc_console_screen;
76	struct vcons_data vd;
77	struct wsscreen_descr sc_defaultscreen_descr;
78	const struct wsscreen_descr *sc_screens[1];
79	struct wsscreen_list sc_screenlist;
80
81	u_char sc_cmap_red[256];
82	u_char sc_cmap_green[256];
83	u_char sc_cmap_blue[256];
84
85};
86
87#endif /* TDVFBVAR_H */
88