summaryrefslogtreecommitdiff
path: root/src/mga.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mga.h')
-rw-r--r--src/mga.h57
1 files changed, 47 insertions, 10 deletions
diff --git a/src/mga.h b/src/mga.h
index 61e8729..4be0fbb 100644
--- a/src/mga.h
+++ b/src/mga.h
@@ -14,6 +14,7 @@
#ifndef MGA_H
#define MGA_H
+#include <pciaccess.h>
#include <string.h>
#include <stdio.h>
@@ -260,7 +261,7 @@ typedef struct {
#ifdef DISABLE_VGA_IO
typedef struct mgaSave {
- pciVideoPtr pvp;
+ struct pci_device * pvp;
Bool enable;
} MgaSave, *MgaSavePtr;
#endif
@@ -373,6 +374,31 @@ struct mga_bios_values {
};
+/**
+ * Attributes that of an MGA device that can be derrived purely from its
+ * PCI ID.
+ */
+struct mga_device_attributes {
+ unsigned has_sdram:1;
+ unsigned probe_for_sdram:1;
+ unsigned dual_head_possible:1;
+ unsigned fb_4mb_quirk:1;
+ unsigned hwcursor_1064:1;
+
+ unsigned dri_capable:1;
+ unsigned dri_chipset:3;
+
+ unsigned HAL_chipset:1;
+
+ enum {
+ old_BARs = 0,
+ probe_BARs,
+ new_BARs
+ } BARs:2;
+
+ uint32_t accel_flags;
+};
+
typedef struct {
#ifdef USEMGAHAL
LPCLIENTDATA pClientStruct;
@@ -383,15 +409,14 @@ typedef struct {
EntityInfoPtr pEnt;
struct mga_bios_values bios;
CARD8 BiosOutputMode;
- pciVideoPtr PciInfo;
- PCITAG PciTag;
+ struct pci_device * PciInfo;
+ const struct mga_device_attributes * chip_attribs;
xf86AccessRec Access;
int Chipset;
int ChipRev;
int is_Gx50:1;
int is_G200SE:1;
- int is_HAL_chipset:1;
Bool Primary;
Bool Interleave;
@@ -403,12 +428,25 @@ typedef struct {
int YDstOrg;
int DstOrg;
int SrcOrg;
- unsigned long IOAddress;
+
+ /**
+ * Which BAR corresponds to the framebuffer on this chip?
+ */
+ unsigned framebuffer_bar;
+
+ /**
+ * Which BAR corresponds to IO space on this chip?
+ */
+ unsigned io_bar;
+
+ /**
+ * Which BAR corresponds to ILOAD space on this chip? If the value is
+ * -1, then this chip does not have an ILOAD region.
+ */
+ int iload_bar;
+
+
unsigned long FbAddress;
- unsigned long ILOADAddress;
- int FbBaseReg;
- unsigned long BiosAddress;
- MessageType BiosFrom;
unsigned char * IOBase;
unsigned char * FbBase;
unsigned char * ILOADBase;
@@ -422,7 +460,6 @@ typedef struct {
Bool Exa;
ExaDriverPtr ExaDriver;
Bool SyncOnGreen;
- Bool Dac6Bit;
Bool HWCursor;
Bool UsePCIRetry;
Bool ShowCache;