4
* Copyright � 2003 Eric Anholt
6
* Permission to use, copy, modify, distribute, and sell this software and its
7
* documentation for any purpose is hereby granted without fee, provided that
8
* the above copyright notice appear in all copies and that both that
9
* copyright notice and this permission notice appear in supporting
10
* documentation, and that the name of Eric Anholt not be used in
11
* advertising or publicity pertaining to distribution of the software without
12
* specific, written prior permission. Eric Anholt makes no
13
* representations about the suitability of this software for any purpose. It
14
* is provided "as is" without express or implied warranty.
16
* ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18
* EVENT SHALL ERIC ANHOLT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22
* PERFORMANCE OF THIS SOFTWARE.
29
#include "kdrive-config.h"
39
#define SIS_REG_BASE(c) ((c)->attr.address[1])
40
#define SIS_REG_SIZE(c) (0x10000)
44
static __inline__ void
45
MMIO_OUT32(__volatile__ void *base, const unsigned long offset,
46
const unsigned int val)
51
: "=m" (*((volatile unsigned char *)base+offset))
52
: "r" (val), "b" (base), "r" (offset));
55
static __inline__ CARD32
56
MMIO_IN32(__volatile__ void *base, const unsigned long offset)
58
register unsigned int val;
63
: "b" (base), "r" (offset),
64
"m" (*((volatile unsigned char *)base+offset)));
70
#define MMIO_OUT32(mmio, a, v) (*(VOL32 *)((mmio) + (a)) = (v))
71
#define MMIO_IN32(mmio, a) (*(VOL32 *)((mmio) + (a)))
75
typedef volatile CARD8 VOL8;
76
typedef volatile CARD16 VOL16;
77
typedef volatile CARD32 VOL32;
86
struct backend_funcs {
87
void (*cardfini)(KdCardInfo *);
88
void (*scrfini)(KdScreenInfo *);
89
Bool (*initScreen)(ScreenPtr);
90
Bool (*finishInitScreen)(ScreenPtr pScreen);
91
Bool (*createRes)(ScreenPtr);
92
void (*preserve)(KdCardInfo *);
93
void (*restore)(KdCardInfo *);
94
Bool (*dpms)(ScreenPtr, int);
95
Bool (*enable)(ScreenPtr);
96
void (*disable)(ScreenPtr);
97
void (*getColors)(ScreenPtr, int, int, xColorItem *);
98
void (*putColors)(ScreenPtr, int, int, xColorItem *);
101
typedef struct _SiSCardInfo {
107
VesaCardPrivRec vesa;
110
struct backend_funcs backend_funcs;
112
struct pci_id_entry *pci_id;
114
Bool use_fbdev, use_vesa;
117
#define getSiSCardInfo(kd) ((SiSCardInfo *) ((kd)->card->driver))
118
#define SiSCardInfo(kd) SiSCardInfo *sisc = getSiSCardInfo(kd)
120
typedef struct _SiSScreenInfo {
126
VesaScreenPrivRec vesa;
129
CARD32 depthSet; /* depth value for REG_BLT_SRCPITCH */
130
KaaScreenInfoRec kaa;
134
#define getSiSScreenInfo(kd) ((SiSScreenInfo *) ((kd)->screen->driver))
135
#define SiSScreenInfo(kd) SiSScreenInfo *siss = getSiSScreenInfo(kd)
138
SiSMapReg(KdCardInfo *card, SiSCardInfo *sisc);
141
SiSUnmapReg(KdCardInfo *card, SiSCardInfo *sisc);
144
SiSDrawSetup(ScreenPtr pScreen);
147
SiSDrawInit(ScreenPtr pScreen);
150
SiSDrawEnable(ScreenPtr pScreen);
153
SiSDrawSync(ScreenPtr pScreen);
156
SiSDrawDisable(ScreenPtr pScreen);
159
SiSDrawFini(ScreenPtr pScreen);
161
extern KdCardFuncs SiSFuncs;