summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2009-07-18 20:16:01 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2009-07-18 20:16:01 +0000
commit59fd25f7fcedb5e75c576e66a63514a11bca3bb7 (patch)
tree0bb6fc957089ec2211846208122b6832e5d8bd0d /driver
parenteabf9a62e7ccd971c1aa1fb2f7a9f6c0a59c8a46 (diff)
Correct patch for libpciaccess issue from X.Org bug 18122, by
Marien Zwart. Tested by Pierre Cardoso.
Diffstat (limited to 'driver')
-rw-r--r--driver/xf86-video-chips/src/ct_driver.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/driver/xf86-video-chips/src/ct_driver.c b/driver/xf86-video-chips/src/ct_driver.c
index 9f47bf94e..46a2b3c15 100644
--- a/driver/xf86-video-chips/src/ct_driver.c
+++ b/driver/xf86-video-chips/src/ct_driver.c
@@ -900,7 +900,6 @@ CHIPSPciProbe(DriverPtr drv, int entity_num, struct pci_device * dev,
intptr_t match_data)
{
ScrnInfoPtr pScrn = NULL;
- EntityInfoPtr pEnt;
CHIPSPtr cPtr;
/* Allocate a ScrnInfoRec and claim the slot */
@@ -921,12 +920,16 @@ CHIPSPciProbe(DriverPtr drv, int entity_num, struct pci_device * dev,
pScrn->FreeScreen = CHIPSFreeScreen;
pScrn->ValidMode = CHIPSValidMode;
+ if (!CHIPSGetRec(pScrn)) {
+ return FALSE;
+ }
+ cPtr = CHIPSPTR(pScrn);
+ cPtr->Chipset = match_data;
/*
* For cards that can do dual head per entity, mark the entity
* as sharable.
*/
- pEnt = xf86GetEntityInfo(entity_num);
- if (pEnt->chipset == CHIPS_CT69030) {
+ if (match_data == CHIPS_CT69030) {
CHIPSEntPtr cPtrEnt = NULL;
DevUnion *pPriv;
@@ -1202,7 +1205,11 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags)
for (i = 0; i<pScrn->numEntities; i++) {
cPtr->pEnt = xf86GetEntityInfo(pScrn->entityList[i]);
if (cPtr->pEnt->resources) return FALSE;
- cPtr->Chipset = cPtr->pEnt->chipset;
+ /* If we are using libpciaccess this is already set in CHIPSPciProbe.
+ * If we are using something else we need to set it here.
+ */
+ if (!cPtr->Chipset)
+ cPtr->Chipset = cPtr->pEnt->chipset;
pScrn->chipset = (char *)xf86TokenToString(CHIPSChipsets,
cPtr->pEnt->chipset);
if ((cPtr->Chipset == CHIPS_CT64200) ||