2
* MGA Millennium (MGA2064W) functions
4
* Copyright 1996 The XFree86 Project, Inc.
18
#include "linux/types.h"
21
#define PCI_CHIP_MGA2085 0x0518
22
#define PCI_CHIP_MGA2064 0x0519
23
#define PCI_CHIP_MGA1064 0x051A
24
#define PCI_CHIP_MGA2164 0x051B
25
#define PCI_CHIP_MGA2164_AGP 0x051F
26
#define PCI_CHIP_MGAG200_PCI 0x0520
27
#define PCI_CHIP_MGAG200 0x0521
28
#define PCI_CHIP_MGAG400 0x0525
29
#define PCI_CHIP_MGAG550 0x2527
30
#define PCI_CHIP_MGAG100_PCI 0x1000
31
#define PCI_CHIP_MGAG100 0x1001
34
# define MMIO_IN8(base, offset) \
35
*(volatile unsigned char *)(((unsigned char*)(base)) + (offset))
36
# define MMIO_IN16(base, offset) \
37
*(volatile unsigned short *)(void *)(((unsigned char*)(base)) + (offset))
38
# define MMIO_IN32(base, offset) \
39
*(volatile unsigned int *)(void *)(((unsigned char*)(base)) + (offset))
40
# define MMIO_OUT8(base, offset, val) \
41
*(volatile unsigned char *)(((unsigned char*)(base)) + (offset)) = (val)
42
# define MMIO_OUT16(base, offset, val) \
43
*(volatile unsigned short *)(void *)(((unsigned char*)(base)) + (offset)) = (val)
44
# define MMIO_OUT32(base, offset, val) \
45
*(volatile unsigned int *)(void *)(((unsigned char*)(base)) + (offset)) = (val)
47
#define INREG8(addr) MMIO_IN8(pMga->IOBase, addr)
48
#define INREG16(addr) MMIO_IN16(pMga->IOBase, addr)
49
#define INREG(addr) MMIO_IN32(pMga->IOBase, addr)
50
#define OUTREG8(addr, val) MMIO_OUT8(pMga->IOBase, addr, val)
51
#define OUTREG16(addr, val) MMIO_OUT16(pMga->IOBase, addr, val)
52
#define OUTREG(addr, val) MMIO_OUT32(pMga->IOBase, addr, val)
54
#define MGAIOMAPSIZE 0x00004000
58
int Chipset; /**< \brief Chipset number */
60
int irq; /**< \brief IRQ number */
63
int frontOffset; /**< \brief Front color buffer offset */
64
int frontPitch; /**< \brief Front color buffer pitch */
65
int backOffset; /**< \brief Back color buffer offset */
66
int backPitch; /**< \brief Back color buffer pitch */
67
int depthOffset; /**< \brief Depth buffer offset */
68
int depthPitch; /**< \brief Depth buffer pitch */
69
int textureOffset; /**< \brief Texture area offset */
70
int textureSize; /**< \brief Texture area size */
71
int logTextureGranularity;
77
drmSize agpSize; /**< \brief AGP map size */
78
int agpMode; /**< \brief AGP mode */
91
drmRegion agpTextures;
93
drmBufMapPtr drmBuffers;
95
unsigned long IOAddress;
96
unsigned char *IOBase;
104
#define MGA_FRONT 0x1
106
#define MGA_DEPTH 0x4
108
#define MGA_AGP_1X_MODE 0x01
109
#define MGA_AGP_2X_MODE 0x02
110
#define MGA_AGP_4X_MODE 0x04
111
#define MGA_AGP_MODE_MASK 0x07