From 8a15e02ca92b83aa5a216ea9cd42680373212ecd Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Mon, 27 Mar 2017 11:00:14 +0300 Subject: 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 Reviewed-on: http://git-master/r/1328953 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c') 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, size_t size, struct mem_desc *mem) { if (vm->mm->vidmem_is_vidmem) { - int err = gk20a_gmmu_alloc_map_flags_vid(vm, flags, size, mem); + /* + * Force the no-kernel-mapping flag on because we don't support + * the lack of it for vidmem - the user should not care when + * using gk20a_gmmu_alloc_map and it's vidmem, or if there's a + * difference, the user should use the flag explicitly anyway. + */ + int err = gk20a_gmmu_alloc_map_flags_vid(vm, + flags | NVGPU_DMA_NO_KERNEL_MAPPING, + size, mem); if (!err) return 0; @@ -3361,7 +3369,8 @@ fail_free: int gk20a_gmmu_alloc_map_vid(struct vm_gk20a *vm, size_t size, struct mem_desc *mem) { - return gk20a_gmmu_alloc_map_flags_vid(vm, 0, size, mem); + return gk20a_gmmu_alloc_map_flags_vid(vm, + NVGPU_DMA_NO_KERNEL_MAPPING, size, mem); } int gk20a_gmmu_alloc_map_flags_vid(struct vm_gk20a *vm, unsigned long flags, -- cgit v1.2.2