summaryrefslogtreecommitdiff
path: root/src/nv_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nv_driver.c')
-rw-r--r--src/nv_driver.c51
1 files changed, 31 insertions, 20 deletions
diff --git a/src/nv_driver.c b/src/nv_driver.c
index 183f2f1..5b9a9ca 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -1814,18 +1814,19 @@ NVMapMem(ScrnInfoPtr pScrn)
/*XXX: have to get these after we've allocated something, otherwise
* they're uninitialised in the DRM!
*/
- pNv->VRAMSize = NVDRMGetParam(pNv, NOUVEAU_GETPARAM_FB_SIZE);
- pNv->VRAMPhysical =
- NVDRMGetParam(pNv, NOUVEAU_GETPARAM_FB_PHYSICAL);
- pNv->AGPSize = NVDRMGetParam(pNv, NOUVEAU_GETPARAM_AGP_SIZE);
- pNv->AGPPhysical =
- NVDRMGetParam(pNv, NOUVEAU_GETPARAM_AGP_PHYSICAL);
+ pNv->VRAMSize = NVDRMGetParam(pNv, NOUVEAU_GETPARAM_FB_SIZE);
+ 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))
@@ -1833,20 +1834,30 @@ 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);
+
}
- pNv->Cursor = NVAllocateMemory(pNv, NOUVEAU_MEM_FB, 64 * 1024);
+ /*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");
return FALSE;