diff options
author | Ben Skeggs <skeggsb@gmail.com> | 2007-07-12 11:28:58 +1000 |
---|---|---|
committer | Ben Skeggs <skeggsb@gmail.com> | 2007-07-12 11:28:58 +1000 |
commit | c91dfdf329f946c8cc581f079359092629cf73dc (patch) | |
tree | 26f2abbee7a2ab96ab4f68d79ed168b78d0643f1 /src/nv_mem.c | |
parent | e6a16710033d189aa5d6b2e3b4a75f2dd9d05a5d (diff) | |
parent | 4cbd3a1d9dfe6d51648de36ce7ae3d02c920374e (diff) | |
download | xorg-driver-xf86-video-nouveau-nv50-branch.tar.gz |
Merge branch 'randr-1.2' into nv50-branchnv50-branch
Conflicts:
src/nv_driver.c
Diffstat (limited to 'src/nv_mem.c')
-rw-r--r-- | src/nv_mem.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/nv_mem.c b/src/nv_mem.c index 99cb8bc..44e3d39 100644 --- a/src/nv_mem.c +++ b/src/nv_mem.c @@ -22,21 +22,16 @@ NVAllocRec *NVAllocateMemory(NVPtr pNv, int type, int size) } mem->type = memalloc.flags; mem->size = memalloc.size; - mem->offset = memalloc.region_offset; + mem->offset = memalloc.offset; - if (drmMap(pNv->drm_fd, mem->offset, mem->size, &mem->map)) { - ErrorF("drmMap() failed. offset=0x%llx, size=%lld (%d)\n", - mem->offset, mem->size, errno); + if (drmMap(pNv->drm_fd, memalloc.map_handle, mem->size, &mem->map)) { + ErrorF("drmMap() failed. handle=0x%llx, size=%lld (%d)\n", + memalloc.map_handle, mem->size, errno); mem->map = NULL; NVFreeMemory(pNv, mem); 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; } @@ -53,11 +48,8 @@ void NVFreeMemory(NVPtr pNv, NVAllocRec *mem) } memfree.flags = mem->type; - memfree.region_offset = mem->offset; - if (mem->type & NOUVEAU_MEM_FB) - memfree.region_offset += pNv->VRAMPhysical; - else if (mem->type & NOUVEAU_MEM_AGP) - memfree.region_offset += pNv->AGPPhysical; + memfree.offset = mem->offset; + if (drmCommandWriteRead(pNv->drm_fd, DRM_NOUVEAU_MEM_FREE, &memfree, sizeof(memfree))) { |