diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-10-25 10:37:08 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-10-25 10:46:53 +1000 |
commit | 9737a812aacbc544b93eeaa031cf1c2e8adbd661 (patch) | |
tree | 1b1b66bbd4509f6ad5f78187e3c9ab6bcd26e1ca /src/nv_driver.c | |
parent | d40c16f5497739c0215f37566db1651a74cb20ba (diff) |
kms: initial pass at supporting zaphod-mode
This works ok from some simple testing, there's undoubtedly things that
will need polishing still however.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'src/nv_driver.c')
-rw-r--r-- | src/nv_driver.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/nv_driver.c b/src/nv_driver.c index fad7d6a..f351fac 100644 --- a/src/nv_driver.c +++ b/src/nv_driver.c @@ -205,6 +205,7 @@ NVPciProbe(DriverPtr drv, int entity_num, struct pci_device *pci_dev, { -1, -1, NULL } }; struct nouveau_device *dev = NULL; + EntityInfoPtr pEnt = NULL; ScrnInfoPtr pScrn = NULL; drmVersion *version; int chipset, ret; @@ -280,6 +281,12 @@ NVPciProbe(DriverPtr drv, int entity_num, struct pci_device *pci_dev, pScrn->LeaveVT = NVLeaveVT; pScrn->FreeScreen = NVFreeScreen; + xf86SetEntitySharable(entity_num); + + pEnt = xf86GetEntityInfo(entity_num); + xf86SetEntityInstanceForScreen(pScrn, pEnt->index, xf86GetNumEntityInstances(pEnt->index) - 1); + free(pEnt); + return TRUE; } @@ -628,10 +635,18 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) pNv->pEnt = xf86GetEntityInfo(pScrn->entityList[0]); if (pNv->pEnt->location.type != BUS_PCI) return FALSE; - + + if (xf86IsEntityShared(pScrn->entityList[0])) { + if(!xf86IsPrimInitDone(pScrn->entityList[0])) { + pNv->Primary = TRUE; + xf86SetPrimInitDone(pScrn->entityList[0]); + } else { + pNv->Secondary = TRUE; + } + } + /* Find the PCI info for this screen */ pNv->PciInfo = xf86GetPciInfoForEntity(pNv->pEnt->index); - pNv->Primary = xf86IsPrimaryPci(pNv->PciInfo); /* Initialise the kernel module */ if (!NVPreInitDRM(pScrn)) |