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