diff options
author | Ben Skeggs <skeggsb@gmail.com> | 2007-06-24 16:47:36 +1000 |
---|---|---|
committer | Ben Skeggs <skeggsb@gmail.com> | 2007-06-24 16:47:36 +1000 |
commit | 45dccb99a541a0e1e7be7b4e5aab12c3d8d9f30d (patch) | |
tree | ce6fa6ca7227734fcd6c4f4005e0a9b46c7b9659 | |
parent | d41cf4febd555cca1c65df7aa981be64a6ae4219 (diff) | |
download | xorg-driver-xf86-video-nouveau-45dccb99a541a0e1e7be7b4e5aab12c3d8d9f30d.tar.gz |
Hide the allocator's use of physical addresses
-rw-r--r-- | src/nv_accel_common.c | 4 | ||||
-rw-r--r-- | src/nv_dma.c | 12 | ||||
-rw-r--r-- | src/nv_dri.c | 2 | ||||
-rw-r--r-- | src/nv_driver.c | 2 | ||||
-rw-r--r-- | src/nv_exa.c | 4 | ||||
-rw-r--r-- | src/nv_hw.c | 2 | ||||
-rw-r--r-- | src/nv_mem.c | 5 | ||||
-rw-r--r-- | src/nv_video.c | 1 | ||||
-rw-r--r-- | src/nv_xaa.c | 8 |
9 files changed, 17 insertions, 23 deletions
diff --git a/src/nv_accel_common.c b/src/nv_accel_common.c index 0004bc2..b1ba672 100644 --- a/src/nv_accel_common.c +++ b/src/nv_accel_common.c @@ -40,11 +40,11 @@ NVAccelGetPixmapOffset(NVPtr pNv, PixmapPtr pPix) CARD32 offset; if (pPix->drawable.type == DRAWABLE_WINDOW) { - offset = pNv->FB->offset - pNv->VRAMPhysical; + offset = pNv->FB->offset; } else { offset = (uint32_t)((unsigned long)pPix->devPrivate.ptr - (unsigned long)pNv->FB->map); - offset += pNv->FB->offset - pNv->VRAMPhysical; + offset += pNv->FB->offset; } return offset; diff --git a/src/nv_dma.c b/src/nv_dma.c index a612c9b..cc5bdd6 100644 --- a/src/nv_dma.c +++ b/src/nv_dma.c @@ -170,8 +170,8 @@ void NVResetGraphics(ScrnInfoPtr pScrn) NVDmaStart(pNv, NvSubContextSurfaces, SURFACE_FORMAT, 4); NVDmaNext (pNv, surfaceFormat); NVDmaNext (pNv, pitch | (pitch << 16)); - NVDmaNext (pNv, (CARD32)(pNv->FB->offset - pNv->VRAMPhysical)); - NVDmaNext (pNv, (CARD32)(pNv->FB->offset - pNv->VRAMPhysical)); + NVDmaNext (pNv, (uint32_t)pNv->FB->offset); + NVDmaNext (pNv, (uint32_t)pNv->FB->offset); NVDmaStart(pNv, NvSubImagePattern, PATTERN_FORMAT, 1); NVDmaNext (pNv, patternFormat); @@ -214,20 +214,14 @@ Bool NVDmaCreateDMAObject(NVPtr pNv, uint32_t handle, int class, Bool NVDmaCreateDMAObjectFromMem(NVPtr pNv, uint32_t handle, int class, NVAllocRec *mem, int access) { - uint32_t offset = mem->offset; int target; target = mem->type & (NOUVEAU_MEM_FB | NOUVEAU_MEM_AGP); if (!target) return FALSE; - if (target & NOUVEAU_MEM_FB) - offset -= pNv->VRAMPhysical; - else if (target & NOUVEAU_MEM_AGP) - offset -= pNv->AGPPhysical; - return NVDmaCreateDMAObject(pNv, handle, class, target, - offset, mem->size, access); + mem->offset, mem->size, access); } /* diff --git a/src/nv_dri.c b/src/nv_dri.c index 7edb865..b6c38b0 100644 --- a/src/nv_dri.c +++ b/src/nv_dri.c @@ -377,7 +377,7 @@ Bool NVDRIFinishScreenInit(ScrnInfoPtr pScrn) pNOUVEAUDRI->depth = pScrn->depth; pNOUVEAUDRI->bpp = pScrn->bitsPerPixel; - pNOUVEAUDRI->front_offset = pNv->FB->offset - pNv->VRAMPhysical; + pNOUVEAUDRI->front_offset = pNv->FB->offset; pNOUVEAUDRI->front_pitch = pScrn->virtualX; /* back/depth buffers will likely be allocated on a per-drawable * basis, but these may be useful if we want to support shared back diff --git a/src/nv_driver.c b/src/nv_driver.c index acd8f42..61c89e3 100644 --- a/src/nv_driver.c +++ b/src/nv_driver.c @@ -832,7 +832,7 @@ NVAdjustFrame(int scrnIndex, int x, int y, int flags) NVFBLayout *pLayout = &pNv->CurrentLayout; startAddr = (((y*pLayout->displayWidth)+x)*(pLayout->bitsPerPixel/8)); - startAddr += (pNv->FB->offset - pNv->VRAMPhysical); + startAddr += pNv->FB->offset; NVSetStartAddress(pNv, startAddr); } diff --git a/src/nv_exa.c b/src/nv_exa.c index ed6901b..ae5a14a 100644 --- a/src/nv_exa.c +++ b/src/nv_exa.c @@ -291,7 +291,7 @@ static Bool NVDownloadFromScreen(PixmapPtr pSrc, NVDmaStart(pNv, NvSubMemFormat, MEMFORMAT_OFFSET_IN, 8); NVDmaNext (pNv, offset_in); - NVDmaNext (pNv, (uint32_t)(pNv->AGPScratch->offset - pNv->AGPPhysical)); + NVDmaNext (pNv, (uint32_t)pNv->AGPScratch->offset); NVDmaNext (pNv, pitch_in); NVDmaNext (pNv, dst_pitch); NVDmaNext (pNv, line_length); @@ -353,7 +353,7 @@ static Bool NVUploadToScreen(PixmapPtr pDst, NVDmaNext (pNv, 0); NVDmaStart(pNv, NvSubMemFormat, MEMFORMAT_OFFSET_IN, 8); - NVDmaNext (pNv, (uint32_t)(pNv->AGPScratch->offset - pNv->AGPPhysical)); + NVDmaNext (pNv, (uint32_t)pNv->AGPScratch->offset); NVDmaNext (pNv, offset_out); NVDmaNext (pNv, src_pitch); NVDmaNext (pNv, pitch_out); diff --git a/src/nv_hw.c b/src/nv_hw.c index 6cddf60..0dc78a1 100644 --- a/src/nv_hw.c +++ b/src/nv_hw.c @@ -940,7 +940,7 @@ void NVCalcStateExt ( &(state->arbitration0), &(state->arbitration1)); } - CursorStart = pNv->Cursor->offset - pNv->VRAMPhysical; + CursorStart = pNv->Cursor->offset; state->cursor0 = 0x80 | (CursorStart >> 17); state->cursor1 = (CursorStart >> 11) << 2; state->cursor2 = CursorStart >> 24; diff --git a/src/nv_mem.c b/src/nv_mem.c index 32dc25f..0ecd71a 100644 --- a/src/nv_mem.c +++ b/src/nv_mem.c @@ -32,6 +32,11 @@ NVAllocRec *NVAllocateMemory(NVPtr pNv, int type, int size) return NULL; } + if (mem->type & NOUVEAU_MEM_FB) + mem->offset -= pNv->VRAMPhysical; + else if (mem->type & NOUVEAU_MEM_AGP) + mem->offset -= pNv->AGPPhysical; + return mem; } diff --git a/src/nv_video.c b/src/nv_video.c index cf4f88d..3865142 100644 --- a/src/nv_video.c +++ b/src/nv_video.c @@ -917,7 +917,6 @@ NVPutImage(ScrnInfoPtr pScrnInfo, short src_x, short src_y, dst_start = pPriv->video_mem->map + (offset - (uint32_t)pPriv->video_mem->offset); - offset -= pNv->VRAMPhysical; /* We need to enlarge the copied rectangle by a pixel so the HW * filtering doesn't pick up junk laying outside of the source */ diff --git a/src/nv_xaa.c b/src/nv_xaa.c index 851e3bf..0d07e70 100644 --- a/src/nv_xaa.c +++ b/src/nv_xaa.c @@ -105,10 +105,6 @@ static const int NVPatternROP[16] = 0xFF }; -static CARD32 getOffset(NVPtr pNv, NVAllocRec *mem) { - return (mem->offset - pNv->VRAMPhysical); -} - void NVWaitVSync(NVPtr pNv) { @@ -418,7 +414,7 @@ NVSubsequentScanlineImageWriteRect( NVDmaStart(pNv, NvSubContextSurfaces, SURFACE_PITCH, 2); NVDmaNext (pNv, (_image_dstpitch << 16) | image_srcpitch); - NVDmaNext (pNv, getOffset(pNv, pNv->ScratchBuffer)); + NVDmaNext (pNv, pNv->ScratchBuffer->offset); } static void NVSubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno) @@ -437,7 +433,7 @@ static void NVSubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno) } else { NVDmaStart(pNv, NvSubContextSurfaces, SURFACE_PITCH, 2); NVDmaNext (pNv, _image_dstpitch | (_image_dstpitch << 16)); - NVDmaNext (pNv, getOffset(pNv, pNv->FB)); + NVDmaNext (pNv, pNv->FB->offset); } } |