summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2008-05-30 11:30:11 -0700
committerIan Romanick <idr@us.ibm.com>2008-05-30 11:30:11 -0700
commit55cc78e4eb15fde0e9239736c75313a1b24b65ef (patch)
treeecf53cda5d68c3f81bfaf63a6628a8b5d803521f
parentf9f7b2a7457744f9abc99626ee992a6886a6fbe5 (diff)
Fix build for libpciaccess X servers
-rw-r--r--src/xgi_setup.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/xgi_setup.c b/src/xgi_setup.c
index 0265d36..159af0c 100644
--- a/src/xgi_setup.c
+++ b/src/xgi_setup.c
@@ -172,10 +172,19 @@ xgiXG2X_Setup(ScrnInfoPtr pScrn)
ulMemSize = 8*1024 ;
}
- if( pXGI->Chipset == PCI_CHIP_XGIXG40)
- {
- if ( (pciReadLong(pXGI->PciTag, 0x08) & 0xFF ) == 2 )
- {
+ if (pXGI->Chipset == PCI_CHIP_XGIXG40) {
+ const unsigned revision =
+#ifdef XSERVER_LIBPCIACCESS
+ pXGI->PciInfo->revision
+#else
+ pciReadLong(pXGI->PciTag, 0x08) & 0x0FF
+#endif
+ ;
+
+ /* Revision 2 cards encode the memory config bits slightly differently
+ * from revision 1 cards.
+ */
+ if (revision == 2) {
switch((ulMemConfig>>2)&0x1)
{
case 0: