summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h
blob: a3d92a7be03e58b5be22eb127f7afcfbff5db9c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
 * Acceleration for the Leo (ZX) framebuffer - defines.
 *
 * Copyright (C) 1999, 2000 Jakub Jelinek (jakub@redhat.com)
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * JAKUB JELINEK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h,v 1.1 2000/05/18 23:21:38 dawes Exp $ */

#ifndef LEO_H
#define LEO_H

#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86_ansic.h"
#include "xf86RamDac.h"
#include "Xmd.h"
#include "gcstruct.h"
#include "leo_regs.h"
#include "xf86sbusBus.h"

/* Various offsets in virtual (ie. mmap()) spaces Linux and Solaris support. */
#define LEO_FB0_VOFF		0x00000000
#define LEO_LC0_VOFF		0x00800000
#define LEO_LD0_VOFF		0x00801000
#define LEO_LX0_CURSOR_VOFF	0x00802000
#define LEO_FB1_VOFF		0x00803000
#define LEO_LC1_VOFF		0x01003000
#define LEO_LD1			0x01004000
#define LEO_LX0_VERT_VOFF	0x01005000
#define LEO_LX_KRN_VOFF		0x01006000
#define LEO_LC0_KRN_VOFF	0x01007000
#define LEO_LC1_KRN_VOFF	0x01008000
#define LEO_LD_GBL_VOFF		0x01009000

typedef struct {
	unsigned int fg, bg;			/* FG/BG colors for stipple */
	unsigned int patalign;                  /* X/Y alignment of bits */
        unsigned int alu;			/* Transparent/Opaque + rop */
        unsigned int bits[32];                  /* The stipple bits themselves */
} LeoStippleRec, *LeoStipplePtr;

typedef struct {
	int type;
	LeoStipplePtr stipple;
} LeoPrivGCRec, *LeoPrivGCPtr;

typedef struct {
	LeoCommand0	*lc0;
	LeoDraw		*ld0;
	LeoCursor	*dac;
	unsigned	*fb;
	int		vclipmax;
	int		width;
	int		height;
	/* cache one stipple; figuring out if we can use the stipple is as hard as
	 * computing it, so we just use this one and leave it here if it
	 * can't be used this time
	 */
	LeoStipplePtr	tmpStipple;

	sbusDevicePtr	psdp;
	Bool		HWCursor;
	Bool		NoAccel;
	CloseScreenProcPtr CloseScreen;
	xf86CursorInfoPtr CursorInfoRec;
	unsigned char	CursorShiftX, CursorShiftY;
	unsigned char	*CursorData;
} LeoRec, *LeoPtr;

extern int  LeoScreenPrivateIndex;
extern int  LeoGCPrivateIndex;
extern int  LeoWindowPrivateIndex;

#define GET_LEO_FROM_SCRN(p)    ((LeoPtr)((p)->driverPrivate))

#define LeoGetScreenPrivate(s)						\
((LeoPtr) (s)->devPrivates[LeoScreenPrivateIndex].ptr)

#define LeoGetGCPrivate(g)						\
((LeoPrivGCPtr) (g)->devPrivates [LeoGCPrivateIndex].ptr)

#define LeoGetWindowPrivate(w)						\
((LeoStipplePtr) (w)->devPrivates[LeoWindowPrivateIndex].ptr)
                            
#define LeoSetWindowPrivate(w,p) 					\
((w)->devPrivates[LeoWindowPrivateIndex].ptr = (pointer) p)

extern int leoRopTable[];

#endif /* LEO_H */