aboutsummaryrefslogtreecommitdiff
path: root/shared-core/nouveau_mem.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@nisroch.keine.ath.cx>2008-06-23 01:24:11 +1000
committerBen Skeggs <skeggsb@nisroch.keine.ath.cx>2008-06-23 01:24:11 +1000
commit89cf2ee2e5b3930b36f2347f35933fc29bc42518 (patch)
treee83a5931993af21c71840a61cf4f1702adf3964c /shared-core/nouveau_mem.c
parentb9ed0f995077f69ae806aae2e83085738ea5e651 (diff)
nv50: use same dma object for fb/tt access
We depend on the VM fully now for memory protection, separate DMA objects for VRAM and GART are unneccesary. However, until the next interface break (soon) a client can't depend on the objects being the same and must still call NV_OBJ_SET_DMA_* methods appropriately.
Diffstat (limited to 'shared-core/nouveau_mem.c')
-rw-r--r--shared-core/nouveau_mem.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/shared-core/nouveau_mem.c b/shared-core/nouveau_mem.c
index 5511e5b6..207d7860 100644
--- a/shared-core/nouveau_mem.c
+++ b/shared-core/nouveau_mem.c
@@ -754,6 +754,7 @@ int
nouveau_ioctl_mem_alloc(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
+ struct drm_nouveau_private *dev_priv = dev->dev_private;
struct drm_nouveau_mem_alloc *alloc = data;
struct mem_block *block;
@@ -770,10 +771,15 @@ nouveau_ioctl_mem_alloc(struct drm_device *dev, void *data,
alloc->offset=block->start;
alloc->flags=block->flags;
+ if (dev_priv->card_type >= NV_50 && alloc->flags & NOUVEAU_MEM_FB)
+ alloc->offset += 512*1024*1024;
+
return 0;
}
-int nouveau_ioctl_mem_free(struct drm_device *dev, void *data, struct drm_file *file_priv)
+int
+nouveau_ioctl_mem_free(struct drm_device *dev, void *data,
+ struct drm_file *file_priv)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct drm_nouveau_mem_free *memfree = data;
@@ -781,6 +787,9 @@ int nouveau_ioctl_mem_free(struct drm_device *dev, void *data, struct drm_file *
NOUVEAU_CHECK_INITIALISED_WITH_RETURN;
+ if (dev_priv->card_type >= NV_50 && memfree->flags & NOUVEAU_MEM_FB)
+ memfree->offset -= 512*1024*1024;
+
block=NULL;
if (memfree->flags & NOUVEAU_MEM_FB)
block = find_block(dev_priv->fb_heap, memfree->offset);