tcx.h revision ecc0bcc7
1/*
2 * TCX framebuffer - defines.
3 *
4 * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com)
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19 * JAKUB JELINEK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 */
23/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h,v 1.1 2000/06/30 17:15:16 dawes Exp $ */
24
25#ifndef TCX_H
26#define TCX_H
27
28#include "xf86.h"
29#include "xf86_OSproc.h"
30#include "xf86RamDac.h"
31#include <X11/Xmd.h>
32#include "gcstruct.h"
33#include "xf86sbusBus.h"
34#include "exa.h"
35#include "tcx_regs.h"
36
37/* Various offsets in virtual (ie. mmap()) spaces Linux and Solaris support. */
38#define TCX_RAM8_VOFF		0x00000000
39#define TCX_RAM24_VOFF		0x01000000
40#define TCX_CPLANE_VOFF		0x28000000
41#define	TCX_RSTIP_VOFF		0x30000000
42#define	TCX_RBLIT_VOFF		0x38000000
43#define TCX_TEC_VOFF		0x70000000
44#define TCX_BTREGS_VOFF		0x70002000
45#define TCX_THC_VOFF		0x70004000
46#define TCX_DHC_VOFF		0x70008000
47#define TCX_ALT_VOFF		0x7000a000
48#define TCX_SYNC_VOFF		0x7000e000
49
50typedef struct {
51	unsigned char	*fb;
52	int		width;
53	int		height;
54	unsigned int	*cplane;
55	TcxThcPtr	thc;
56	sbusDevicePtr	psdp;
57	CloseScreenProcPtr CloseScreen;
58	Bool		HWCursor;
59	uint64_t	*rblit;
60	uint64_t	*rstip;
61	xf86CursorInfoPtr CursorInfoRec;
62	unsigned int	CursorXY;
63	int		CursorBg, CursorFg;
64	Bool		CursorEnabled, NoAccel;
65	unsigned char	CursorShiftX, CursorShiftY;
66	unsigned char	*CursorData;
67	OptionInfoPtr	Options;
68	ExaDriverPtr	pExa;
69	int		xdir, ydir, srcoff, srcpitch, fg;
70} TcxRec, *TcxPtr;
71
72Bool TcxInitAccel(ScreenPtr);
73
74#define TCX_CPLANE_MODE		0x03000000
75
76#define GET_TCX_FROM_SCRN(p)    ((TcxPtr)((p)->driverPrivate))
77
78#endif /* TCX_H */
79