diff options
Diffstat (limited to 'src/nv_driver.c')
-rw-r--r-- | src/nv_driver.c | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/src/nv_driver.c b/src/nv_driver.c index ef9efc6..b66353b 100644 --- a/src/nv_driver.c +++ b/src/nv_driver.c @@ -1794,12 +1794,15 @@ NVMapMem(ScrnInfoPtr pScrn) pNv->VRAMPhysical = NVDRMGetParam(pNv, NOUVEAU_GETPARAM_FB_PHYSICAL); pNv->AGPSize = NVDRMGetParam(pNv, NOUVEAU_GETPARAM_AGP_SIZE); pNv->AGPPhysical = NVDRMGetParam(pNv, NOUVEAU_GETPARAM_AGP_PHYSICAL); + if ( ! pNv->AGPSize ) /*if no AGP*/ + /*use PCI*/ + pNv->SGPhysical = NVDRMGetParam(pNv, NOUVEAU_GETPARAM_PCI_PHYSICAL); - if (pNv->AGPSize) { - int gart_scratch_size; + int gart_scratch_size; + if (pNv->AGPSize) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "GART: %dMiB available\n", + "AGPGART: %dMiB available\n", (unsigned int)(pNv->AGPSize >> 20)); if (pNv->AGPSize > (16*1024*1024)) @@ -1807,19 +1810,29 @@ NVMapMem(ScrnInfoPtr pScrn) else gart_scratch_size = pNv->AGPSize; - pNv->AGPScratch = NVAllocateMemory(pNv, NOUVEAU_MEM_AGP, - gart_scratch_size); - if (!pNv->AGPScratch) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Unable to allocate GART memory\n"); - } else { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "GART: mapped %dMiB at %p\n", - (unsigned int)(pNv->AGPScratch->size >> 20), - pNv->AGPScratch->map); } + else { + + gart_scratch_size = (4 << 20) - (1 << 18) ; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "GART: PCI DMA - using %dKiB\n", gart_scratch_size >> 10); + } + /*The DRM allocates AGP memory, PCI as a fallback */ + pNv->GARTScratch = NVAllocateMemory(pNv, NOUVEAU_MEM_AGP | NOUVEAU_MEM_PCI_ACCEPTABLE, + gart_scratch_size); + if (!pNv->GARTScratch) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Unable to allocate GART memory\n"); + } else { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "GART: mapped %dMiB at %p, offset is %d\n", + (unsigned int)(pNv->GARTScratch->size >> 20), + pNv->GARTScratch->map, pNv->GARTScratch->offset); + } + + pNv->Cursor = NVAllocateMemory(pNv, NOUVEAU_MEM_FB, 64*1024); if (!pNv->Cursor) { ErrorF("Failed to allocate memory for hardware cursor\n"); |