summaryrefslogtreecommitdiff
path: root/src/mga.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mga.h')
-rw-r--r--src/mga.h61
1 files changed, 57 insertions, 4 deletions
diff --git a/src/mga.h b/src/mga.h
index 156ac81..c46fdbb 100644
--- a/src/mga.h
+++ b/src/mga.h
@@ -14,6 +14,9 @@
#ifndef MGA_H
#define MGA_H
+#ifdef XSERVER_LIBPCIACCESS
+#include <pciaccess.h>
+#endif
#include <string.h>
#include <stdio.h>
@@ -286,7 +289,11 @@ typedef struct {
#ifdef DISABLE_VGA_IO
typedef struct mgaSave {
+#ifdef XSERVER_LIBPCIACCESS
+ struct pci_device * pvp;
+#else
pciVideoPtr pvp;
+#endif
Bool enable;
} MgaSave, *MgaSavePtr;
#endif
@@ -399,6 +406,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;
@@ -409,15 +441,19 @@ typedef struct {
EntityInfoPtr pEnt;
struct mga_bios_values bios;
CARD8 BiosOutputMode;
+#ifdef XSERVER_LIBPCIACCESS
+ struct pci_device * PciInfo;
+#else
pciVideoPtr PciInfo;
PCITAG PciTag;
+#endif
+ 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;
@@ -429,12 +465,30 @@ typedef struct {
int YDstOrg;
int DstOrg;
int SrcOrg;
+
+ /**
+ * 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;
+
+#ifndef XSERVER_LIBPCIACCESS
unsigned long IOAddress;
- unsigned long FbAddress;
unsigned long ILOADAddress;
- int FbBaseReg;
unsigned long BiosAddress;
MessageType BiosFrom;
+#endif
+ unsigned long FbAddress;
unsigned char * IOBase;
unsigned char * FbBase;
unsigned char * ILOADBase;
@@ -448,7 +502,6 @@ typedef struct {
Bool Exa;
ExaDriverPtr ExaDriver;
Bool SyncOnGreen;
- Bool Dac6Bit;
Bool HWCursor;
Bool UsePCIRetry;
Bool ShowCache;