aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvc0_vram.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvc0_vram.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvc0_vram.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/gpu/drm/nouveau/nvc0_vram.c b/drivers/gpu/drm/nouveau/nvc0_vram.c
index b2ef210ae54d..6d777a2a04dd 100644
--- a/drivers/gpu/drm/nouveau/nvc0_vram.c
+++ b/drivers/gpu/drm/nouveau/nvc0_vram.c
@@ -58,46 +58,46 @@ nvc0_vram_flags_valid(struct drm_device *dev, u32 tile_flags)
58 58
59int 59int
60nvc0_vram_new(struct drm_device *dev, u64 size, u32 align, u32 ncmin, 60nvc0_vram_new(struct drm_device *dev, u64 size, u32 align, u32 ncmin,
61 u32 type, struct nouveau_vram **pvram) 61 u32 type, struct nouveau_mem **pmem)
62{ 62{
63 struct drm_nouveau_private *dev_priv = dev->dev_private; 63 struct drm_nouveau_private *dev_priv = dev->dev_private;
64 struct ttm_bo_device *bdev = &dev_priv->ttm.bdev; 64 struct ttm_bo_device *bdev = &dev_priv->ttm.bdev;
65 struct ttm_mem_type_manager *man = &bdev->man[TTM_PL_VRAM]; 65 struct ttm_mem_type_manager *man = &bdev->man[TTM_PL_VRAM];
66 struct nouveau_mm *mm = man->priv; 66 struct nouveau_mm *mm = man->priv;
67 struct nouveau_mm_node *r; 67 struct nouveau_mm_node *r;
68 struct nouveau_vram *vram; 68 struct nouveau_mem *mem;
69 int ret; 69 int ret;
70 70
71 size >>= 12; 71 size >>= 12;
72 align >>= 12; 72 align >>= 12;
73 ncmin >>= 12; 73 ncmin >>= 12;
74 74
75 vram = kzalloc(sizeof(*vram), GFP_KERNEL); 75 mem = kzalloc(sizeof(*mem), GFP_KERNEL);
76 if (!vram) 76 if (!mem)
77 return -ENOMEM; 77 return -ENOMEM;
78 78
79 INIT_LIST_HEAD(&vram->regions); 79 INIT_LIST_HEAD(&mem->regions);
80 vram->dev = dev_priv->dev; 80 mem->dev = dev_priv->dev;
81 vram->memtype = type; 81 mem->memtype = type;
82 vram->size = size; 82 mem->size = size;
83 83
84 mutex_lock(&mm->mutex); 84 mutex_lock(&mm->mutex);
85 do { 85 do {
86 ret = nouveau_mm_get(mm, 1, size, ncmin, align, &r); 86 ret = nouveau_mm_get(mm, 1, size, ncmin, align, &r);
87 if (ret) { 87 if (ret) {
88 mutex_unlock(&mm->mutex); 88 mutex_unlock(&mm->mutex);
89 nv50_vram_del(dev, &vram); 89 nv50_vram_del(dev, &mem);
90 return ret; 90 return ret;
91 } 91 }
92 92
93 list_add_tail(&r->rl_entry, &vram->regions); 93 list_add_tail(&r->rl_entry, &mem->regions);
94 size -= r->length; 94 size -= r->length;
95 } while (size); 95 } while (size);
96 mutex_unlock(&mm->mutex); 96 mutex_unlock(&mm->mutex);
97 97
98 r = list_first_entry(&vram->regions, struct nouveau_mm_node, rl_entry); 98 r = list_first_entry(&mem->regions, struct nouveau_mm_node, rl_entry);
99 vram->offset = (u64)r->offset << 12; 99 mem->offset = (u64)r->offset << 12;
100 *pvram = vram; 100 *pmem = mem;
101 return 0; 101 return 0;
102} 102}
103 103