summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu')
-rw-r--r--drivers/gpu/nvgpu/vgpu/mm_vgpu.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
index c36b135c..bfaacff5 100644
--- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
@@ -267,7 +267,7 @@ u64 vgpu_bar1_map(struct gk20a *g, struct sg_table **sgt, u64 size)
267 267
268/* address space interfaces for the gk20a module */ 268/* address space interfaces for the gk20a module */
269static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share, 269static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share,
270 u32 big_page_size) 270 u32 big_page_size, u32 flags)
271{ 271{
272 struct gk20a_as *as = as_share->as; 272 struct gk20a_as *as = as_share->as;
273 struct gk20a *g = gk20a_from_as(as); 273 struct gk20a *g = gk20a_from_as(as);
@@ -280,6 +280,8 @@ static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share,
280 kernel_vma_start, kernel_vma_limit; 280 kernel_vma_start, kernel_vma_limit;
281 char name[32]; 281 char name[32];
282 int err, i; 282 int err, i;
283 const bool userspace_managed =
284 (flags & NVGPU_GPU_IOCTL_ALLOC_AS_FLAGS_USERSPACE_MANAGED) != 0;
283 285
284 /* note: keep the page sizes sorted lowest to highest here */ 286 /* note: keep the page sizes sorted lowest to highest here */
285 u32 gmmu_page_sizes[gmmu_nr_page_sizes] = { 287 u32 gmmu_page_sizes[gmmu_nr_page_sizes] = {
@@ -290,6 +292,12 @@ static int vgpu_vm_alloc_share(struct gk20a_as_share *as_share,
290 292
291 gk20a_dbg_fn(""); 293 gk20a_dbg_fn("");
292 294
295 if (userspace_managed) {
296 gk20a_err(dev_from_gk20a(g),
297 "userspace-managed address spaces not yet supported");
298 return -ENOSYS;
299 }
300
293 big_page_size = gmmu_page_sizes[gmmu_page_size_big]; 301 big_page_size = gmmu_page_sizes[gmmu_page_size_big];
294 302
295 vm = kzalloc(sizeof(*vm), GFP_KERNEL); 303 vm = kzalloc(sizeof(*vm), GFP_KERNEL);