summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv50_instmem.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-12-06 15:28:54 +1000
committerBen Skeggs <bskeggs@redhat.com>2010-12-08 13:48:20 +1000
commit60d2a88ae896ae51c76f8b15c2f4b762d5b00864 (patch)
treee136aee905d35f8936036fd01af1ca29526fcc67 /drivers/gpu/drm/nouveau/nv50_instmem.c
parent34cf01bc4b8021cef62cbd79224577c13d01b106 (diff)
downloadblackbird-op-linux-60d2a88ae896ae51c76f8b15c2f4b762d5b00864.tar.gz
blackbird-op-linux-60d2a88ae896ae51c76f8b15c2f4b762d5b00864.zip
drm/nouveau: kick vram functions out into an "engine"
NVC0 will be able to share some of nv50's paths this way. This also makes it the card-specific vram code responsible for deciding if a given set of tile_flags is valid, rather than duplicating the allowed types in nv50_vram.c and nouveau_gem.c Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_instmem.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv50_instmem.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_instmem.c b/drivers/gpu/drm/nouveau/nv50_instmem.c
index e2efd6f22ffb..38f30270cb9f 100644
--- a/drivers/gpu/drm/nouveau/nv50_instmem.c
+++ b/drivers/gpu/drm/nouveau/nv50_instmem.c
@@ -312,6 +312,7 @@ nv50_instmem_get(struct nouveau_gpuobj *gpuobj, u32 size, u32 align)
{
struct drm_device *dev = gpuobj->dev;
struct drm_nouveau_private *dev_priv = dev->dev_private;
+ struct nouveau_vram_engine *vram = &dev_priv->engine.vram;
struct nv50_gpuobj_node *node = NULL;
int ret;
@@ -323,7 +324,7 @@ nv50_instmem_get(struct nouveau_gpuobj *gpuobj, u32 size, u32 align)
size = (size + 4095) & ~4095;
align = max(align, (u32)4096);
- ret = nv50_vram_new(dev, size, align, 0, 0, &node->vram);
+ ret = vram->get(dev, size, align, 0, 0, &node->vram);
if (ret) {
kfree(node);
return ret;
@@ -336,7 +337,7 @@ nv50_instmem_get(struct nouveau_gpuobj *gpuobj, u32 size, u32 align)
NV_MEM_ACCESS_RW | NV_MEM_ACCESS_SYS,
&node->chan_vma);
if (ret) {
- nv50_vram_del(dev, &node->vram);
+ vram->put(dev, &node->vram);
kfree(node);
return ret;
}
@@ -354,6 +355,8 @@ void
nv50_instmem_put(struct nouveau_gpuobj *gpuobj)
{
struct drm_device *dev = gpuobj->dev;
+ struct drm_nouveau_private *dev_priv = dev->dev_private;
+ struct nouveau_vram_engine *vram = &dev_priv->engine.vram;
struct nv50_gpuobj_node *node;
node = gpuobj->node;
@@ -363,7 +366,7 @@ nv50_instmem_put(struct nouveau_gpuobj *gpuobj)
nouveau_vm_unmap(&node->chan_vma);
nouveau_vm_put(&node->chan_vma);
}
- nv50_vram_del(dev, &node->vram);
+ vram->put(dev, &node->vram);
kfree(node);
}
OpenPOWER on IntegriCloud