summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2017-03-27 04:00:14 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-27 16:56:38 -0400
commit8a15e02ca92b83aa5a216ea9cd42680373212ecd (patch)
tree6daa8f14a887d22faf4ef62475b4062e743fd78a /drivers/gpu/nvgpu/gk20a/mm_gk20a.c
parentb45a67934faeba042dbf6ebe47c520db3ef4090d (diff)
gpu: nvgpu: add NO_KERNEL_MAPPING for alloc_map_vid
Commit 8f3875393e7a6bd0fc03afdb1fa99b7e33b71576 ("abstract away dma alloc attrs") added an implicit NVGPU_DMA_NO_KERNEL_MAPPING for the function that allocates vidmem buffers, but the functions gk20a_gmmu_alloc_map_vid and gk20a_gmmu_alloc_map got overlooked and use no flags which now triggers a warning. Make those cases alloc the vidmem buffer with the no kernel mapping flag as it should have been, because kernel mappings of vidmem are not supported. Bug 1853519 Change-Id: I9f29c9d310f97c9bd5f279674decf61efb3e75ea Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/1328953 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index c31f8482..1beff9b9 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -3316,7 +3316,15 @@ int gk20a_gmmu_alloc_map_flags(struct vm_gk20a *vm, unsigned long flags,
3316 size_t size, struct mem_desc *mem) 3316 size_t size, struct mem_desc *mem)
3317{ 3317{
3318 if (vm->mm->vidmem_is_vidmem) { 3318 if (vm->mm->vidmem_is_vidmem) {
3319 int err = gk20a_gmmu_alloc_map_flags_vid(vm, flags, size, mem); 3319 /*
3320 * Force the no-kernel-mapping flag on because we don't support
3321 * the lack of it for vidmem - the user should not care when
3322 * using gk20a_gmmu_alloc_map and it's vidmem, or if there's a
3323 * difference, the user should use the flag explicitly anyway.
3324 */
3325 int err = gk20a_gmmu_alloc_map_flags_vid(vm,
3326 flags | NVGPU_DMA_NO_KERNEL_MAPPING,
3327 size, mem);
3320 3328
3321 if (!err) 3329 if (!err)
3322 return 0; 3330 return 0;
@@ -3361,7 +3369,8 @@ fail_free:
3361int gk20a_gmmu_alloc_map_vid(struct vm_gk20a *vm, size_t size, 3369int gk20a_gmmu_alloc_map_vid(struct vm_gk20a *vm, size_t size,
3362 struct mem_desc *mem) 3370 struct mem_desc *mem)
3363{ 3371{
3364 return gk20a_gmmu_alloc_map_flags_vid(vm, 0, size, mem); 3372 return gk20a_gmmu_alloc_map_flags_vid(vm,
3373 NVGPU_DMA_NO_KERNEL_MAPPING, size, mem);
3365} 3374}
3366 3375
3367int gk20a_gmmu_alloc_map_flags_vid(struct vm_gk20a *vm, unsigned long flags, 3376int gk20a_gmmu_alloc_map_flags_vid(struct vm_gk20a *vm, unsigned long flags,