Lines Matching refs:ram
32 struct nvkm_ram *ram; member
84 mutex_lock(&vram->ram->mutex); in nvkm_vram_dtor()
87 nvkm_mm_free(&vram->ram->vram, &node); in nvkm_vram_dtor()
89 mutex_unlock(&vram->ram->mutex); in nvkm_vram_dtor()
107 struct nvkm_ram *ram; in nvkm_ram_get() local
117 if (!device->fb || !(ram = device->fb->ram)) in nvkm_ram_get()
119 ram = device->fb->ram; in nvkm_ram_get()
120 mm = &ram->vram; in nvkm_ram_get()
125 vram->ram = ram; in nvkm_ram_get()
129 mutex_lock(&ram->mutex); in nvkm_ram_get()
137 mutex_unlock(&ram->mutex); in nvkm_ram_get()
146 mutex_unlock(&ram->mutex); in nvkm_ram_get()
151 nvkm_ram_init(struct nvkm_ram *ram) in nvkm_ram_init() argument
153 if (ram->func->init) in nvkm_ram_init()
154 return ram->func->init(ram); in nvkm_ram_init()
161 struct nvkm_ram *ram = *pram; in nvkm_ram_del() local
162 if (ram && !WARN_ON(!ram->func)) { in nvkm_ram_del()
163 if (ram->func->dtor) in nvkm_ram_del()
164 *pram = ram->func->dtor(ram); in nvkm_ram_del()
165 nvkm_mm_fini(&ram->vram); in nvkm_ram_del()
166 mutex_destroy(&ram->mutex); in nvkm_ram_del()
174 enum nvkm_ram_type type, u64 size, struct nvkm_ram *ram) in nvkm_ram_ctor() argument
196 ram->func = func; in nvkm_ram_ctor()
197 ram->fb = fb; in nvkm_ram_ctor()
198 ram->type = type; in nvkm_ram_ctor()
199 ram->size = size; in nvkm_ram_ctor()
200 mutex_init(&ram->mutex); in nvkm_ram_ctor()
202 if (!nvkm_mm_initialised(&ram->vram)) { in nvkm_ram_ctor()
203 ret = nvkm_mm_init(&ram->vram, NVKM_RAM_MM_NORMAL, 0, in nvkm_ram_ctor()