summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index f46f7a81..ff9bb5e2 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -2276,6 +2276,26 @@ err_kfree:
2276#endif 2276#endif
2277} 2277}
2278 2278
2279int gk20a_vidmem_get_space(struct gk20a *g, u64 *space)
2280{
2281#if defined(CONFIG_GK20A_VIDMEM)
2282 struct gk20a_allocator *allocator = &g->mm.vidmem.allocator;
2283
2284 gk20a_dbg_fn("");
2285
2286 if (!gk20a_alloc_initialized(allocator))
2287 return -ENOSYS;
2288
2289 mutex_lock(&g->mm.vidmem.clear_list_mutex);
2290 *space = gk20a_alloc_space(allocator) +
2291 atomic64_read(&g->mm.vidmem.bytes_pending);
2292 mutex_unlock(&g->mm.vidmem.clear_list_mutex);
2293 return 0;
2294#else
2295 return -ENOSYS;
2296#endif
2297}
2298
2279static u64 gk20a_mm_get_align(struct gk20a *g, struct scatterlist *sgl, 2299static u64 gk20a_mm_get_align(struct gk20a *g, struct scatterlist *sgl,
2280 enum gk20a_aperture aperture) 2300 enum gk20a_aperture aperture)
2281{ 2301{