diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2017-03-30 03:17:01 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-04-03 17:04:04 -0400 |
commit | 2119213467a9e70a7e6cbf78d9b8954b27898716 (patch) | |
tree | 23c01192a4839db00998353f1495b58e90c79e17 /drivers/gpu/nvgpu/gk20a | |
parent | 7aa2f44e8b53dcd29ccb58a32f299819fca83bf6 (diff) |
gpu: nvgpu: use NO_KERNEL_MAPPING for default vidmem
Commit 8f3875393e7a6bd0fc03afdb1fa99b7e33b71576 ("abstract away dma
alloc attrs") added an implicit NVGPU_DMA_NO_KERNEL_MAPPING for the
explicit vidmem buffer allocation path. The default allocation api that
chooses vidmem or sysmem based on available support still passed a zero
flag and produced a warning when the flag should have been there. Force
the NO_KERNEL_MAPPING flag on currently via the default-allocator api.
Commit 8a15e02ca92b83aa5a216ea9cd42680373212ecd ("gpu: nvgpu: add
NO_KERNEL_MAPPING for alloc_map_vid") did the same for flagless
alloc-and-map calls but this default alloc-only call got overlooked.
Also, store the flags in the mem_desc during allocation, just like in
the sysmem allocator, to be checked during freeing.
Bug 1896734
Bug 1853519
Change-Id: I4b4182b4fd52298bdd2a77197c095a23d2a67c4a
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1331252
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 709f2fd2..9a2dbeb9 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -2735,7 +2735,15 @@ int gk20a_gmmu_alloc_flags(struct gk20a *g, unsigned long flags, size_t size, | |||
2735 | struct mem_desc *mem) | 2735 | struct mem_desc *mem) |
2736 | { | 2736 | { |
2737 | if (g->mm.vidmem_is_vidmem) { | 2737 | if (g->mm.vidmem_is_vidmem) { |
2738 | int err = gk20a_gmmu_alloc_flags_vid(g, flags, size, mem); | 2738 | /* |
2739 | * Force the no-kernel-mapping flag on because we don't support | ||
2740 | * the lack of it for vidmem - the user should not care when | ||
2741 | * using gk20a_gmmu_alloc_map and it's vidmem, or if there's a | ||
2742 | * difference, the user should use the flag explicitly anyway. | ||
2743 | */ | ||
2744 | int err = gk20a_gmmu_alloc_flags_vid(g, | ||
2745 | flags | NVGPU_DMA_NO_KERNEL_MAPPING, | ||
2746 | size, mem); | ||
2739 | 2747 | ||
2740 | if (!err) | 2748 | if (!err) |
2741 | return 0; | 2749 | return 0; |
@@ -3012,6 +3020,7 @@ int gk20a_gmmu_alloc_flags_vid_at(struct gk20a *g, unsigned long flags, | |||
3012 | mem->size = size; | 3020 | mem->size = size; |
3013 | mem->aperture = APERTURE_VIDMEM; | 3021 | mem->aperture = APERTURE_VIDMEM; |
3014 | mem->allocator = vidmem_alloc; | 3022 | mem->allocator = vidmem_alloc; |
3023 | mem->flags = flags; | ||
3015 | 3024 | ||
3016 | nvgpu_init_list_node(&mem->clear_list_entry); | 3025 | nvgpu_init_list_node(&mem->clear_list_entry); |
3017 | 3026 | ||