1/*
2 * Fujitsu AG-10e framebuffer - defines.
3 *
4 * Copyright (C) 2007 Michael Lorenz
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.3 2001/05/04 19:05:45 dawes Exp $ */
24
25#ifndef AG10E_H
26#define AG10E_H
27
28#include "xf86.h"
29#include "xf86_OSproc.h"
30#if ABI_VIDEODRV_VERSION < SET_ABI_VERSION(25, 2)
31#include "xf86RamDac.h"
32#else
33#include "xf86Cursor.h"
34#endif
35#include "Xmd.h"
36#include "gcstruct.h"
37#include "ag10e_regs.h"
38#include "xf86sbusBus.h"
39#include "xaa.h"
40
41typedef struct {
42	unsigned char	*fb;
43	unsigned char   *regs;
44	int		vclipmax;
45	int		width;
46	int		height;
47	int		maxheight;
48	int		vidmem;
49
50	sbusDevicePtr	psdp;
51	Bool		HWCursor;
52	Bool		NoAccel;
53	CloseScreenProcPtr CloseScreen;
54	xf86CursorInfoPtr CursorInfoRec;
55	struct fbcursor Cursor;
56	unsigned char pal[9];
57
58	OptionInfoPtr	Options;
59	unsigned char *buffers[1];
60	XAAInfoRecPtr	AccelInfoRec;
61	int 		tex_width, tex_height;
62	FBAreaPtr	tex_buffer;
63
64	/* Glint stuff */
65	GCPtr		CurrentGC;
66	DrawablePtr		CurrentDrawable;
67	int		IOOffset;
68	int		FIFOSize;
69	int		InFifoSpace;
70	int		pprod;
71	CARD32		ROP;
72	CARD32		FrameBufferReadMode;
73	CARD32		BltScanDirection;
74	CARD32		TexMapFormat;
75	CARD32		PixelWidth;
76	Bool		ClippingOn;
77	CARD32		ForeGroundColor;
78	CARD32		BackGroundColor;
79	int		bppalign;
80	CARD32		startxdom;
81	CARD32		startxsub;
82	CARD32		starty;
83	CARD32		count;
84	CARD32		dy;
85	CARD32		x;
86	CARD32		y;
87	CARD32		w;
88	CARD32		h;
89	CARD32		dxdom;
90	int		dwords;
91	int		cpuheight;
92	int		cpucount;
93	CARD32		planemask;
94	int		realWidth;
95
96} AG10ERec, *AG10EPtr;
97
98extern int  AG10EScreenPrivateIndex;
99extern int  AG10EGCPrivateIndex;
100extern int  AG10EWindowPrivateIndex;
101
102#define GET_AG10E_FROM_SCRN(p)    ((AG10EPtr)((p)->driverPrivate))
103
104#define AG10EGetScreenPrivate(s)						\
105((AG10EPtr) (s)->devPrivates[AG10EScreenPrivateIndex].ptr)
106
107#define AG10EGetGCPrivate(g)						\
108((AG10EPrivGCPtr) (g)->devPrivates [AG10EGCPrivateIndex].ptr)
109
110#define AG10EGetWindowPrivate(w)						\
111((AG10EStipplePtr) (w)->devPrivates[AG10EWindowPrivateIndex].ptr)
112
113#define AG10ESetWindowPrivate(w,p) 					\
114((w)->devPrivates[AG10EWindowPrivateIndex].ptr = (pointer) p)
115
116int AG10EAccelInit(ScreenPtr);
117Bool AG10EDGAInit(ScreenPtr);
118
119/* ag10e_cursor.c */
120Bool AG10EHWCursorInit(ScreenPtr);
121
122#endif /* AG10E_H */
123