cg6.h revision 4d26f1c6
1/*
2 * GX and Turbo GX 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/suncg6/cg6.h,v 1.2 2000/06/30 17:15:15 dawes Exp $ */
24
25#ifndef CG6_H
26#define CG6_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 "cg6_regs.h"
34#include "xf86sbusBus.h"
35#include "xaa.h"
36
37/* Various offsets in virtual (ie. mmap()) spaces Linux and Solaris support. */
38#define CG6_FBC_VOFF	0x70000000
39#define CG6_TEC_VOFF	0x70001000
40#define CG6_BTREGS_VOFF	0x70002000
41#define CG6_FHC_VOFF	0x70004000
42#define CG6_THC_VOFF	0x70005000
43#define CG6_ROM_VOFF	0x70006000
44#define CG6_RAM_VOFF	0x70016000
45#define CG6_DHC_VOFF	0x80000000
46
47typedef struct {
48	unsigned int fg, bg;			/* FG/BG colors for stipple */
49	unsigned int patalign;                  /* X/Y alignment of bits */
50        unsigned int alu;			/* Transparent/Opaque + rop */
51        unsigned int bits[32];                  /* The stipple bits themselves */
52} Cg6StippleRec, *Cg6StipplePtr;
53
54typedef struct {
55	int type;
56	Cg6StipplePtr stipple;
57} Cg6PrivGCRec, *Cg6PrivGCPtr;
58
59typedef struct {
60	unsigned char	*fb;
61	Cg6FbcPtr	fbc;
62	Cg6ThcPtr	thc;
63	int		vclipmax;
64	int		width;
65	int		height;
66	int		maxheight;
67	int		vidmem;
68
69	sbusDevicePtr	psdp;
70	Bool		HWCursor;
71	Bool		NoAccel;
72	CloseScreenProcPtr CloseScreen;
73	xf86CursorInfoPtr CursorInfoRec;
74	unsigned int	CursorXY;
75	int		CursorBg, CursorFg;
76	Bool		CursorEnabled;
77	OptionInfoPtr	Options;
78
79        unsigned char	*buffers[1];
80        CARD32  	scanline[1024];
81        int             words_in_scanline, scan_x, scan_y, scan_xe;
82        int             clipxa, clipxe;
83        XAAInfoRecPtr   pXAA;
84} Cg6Rec, *Cg6Ptr;
85
86extern int  Cg6ScreenPrivateIndex;
87extern int  Cg6GCPrivateIndex;
88extern int  Cg6WindowPrivateIndex;
89
90#define GET_CG6_FROM_SCRN(p)    ((Cg6Ptr)((p)->driverPrivate))
91
92#define Cg6GetScreenPrivate(s)						\
93((Cg6Ptr) (s)->devPrivates[Cg6ScreenPrivateIndex].ptr)
94
95#define Cg6GetGCPrivate(g)						\
96((Cg6PrivGCPtr) (g)->devPrivates [Cg6GCPrivateIndex].ptr)
97
98#define Cg6GetWindowPrivate(w)						\
99((Cg6StipplePtr) (w)->devPrivates[Cg6WindowPrivateIndex].ptr)
100
101#define Cg6SetWindowPrivate(w,p) 					\
102((w)->devPrivates[Cg6WindowPrivateIndex].ptr = (pointer) p)
103
104extern int cg6RopTable[];
105
106int CG6AccelInit(ScrnInfoPtr);
107Bool Cg6DGAInit(ScreenPtr pScreen);
108
109#endif /* CG6_H */
110