summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/acr_gp106.c
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2017-03-14 07:47:04 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-21 18:01:47 -0400
commit8f3875393e7a6bd0fc03afdb1fa99b7e33b71576 (patch)
tree7ee7b2da741fae7d06eeb367db2b14d8f78f0f55 /drivers/gpu/nvgpu/gp106/acr_gp106.c
parent79658ac5cb22cc68a2d24d964379a606086c8b39 (diff)
gpu: nvgpu: abstract away dma alloc attrs
Don't use enum dma_attr in the gk20a_gmmu_alloc_attr* functions, but define nvgpu-internal flags for no kernel mapping, force contiguous, and read only modes. Store the flags in the allocated struct mem_desc and only use gk20a_gmmu_free, remove gk20a_gmmu_free_attr. This helps in OS abstraction. Rename the notion of attr to flags. Add implicit NVGPU_DMA_NO_KERNEL_MAPPING to all vidmem buffers allocated via gk20a_gmmu_alloc_vid for consistency. Fix a bug in gk20a_gmmu_alloc_map_attr that dropped the attr parameter accidentally. Bug 1853519 Change-Id: I1ff67dff9fc425457ae445ce4976a780eb4dcc9f Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/1321101 Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/acr_gp106.c')
-rw-r--r--drivers/gpu/nvgpu/gp106/acr_gp106.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gp106/acr_gp106.c b/drivers/gpu/nvgpu/gp106/acr_gp106.c
index f5228136..afb9ebe2 100644
--- a/drivers/gpu/nvgpu/gp106/acr_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/acr_gp106.c
@@ -109,12 +109,14 @@ static int gp106_alloc_blob_space(struct gk20a *g,
109 * Even though this mem_desc wouldn't be used, the wpr region needs to 109 * Even though this mem_desc wouldn't be used, the wpr region needs to
110 * be reserved in the allocator. 110 * be reserved in the allocator.
111 */ 111 */
112 err = gk20a_gmmu_alloc_attr_vid_at(g, 0, wpr_inf.size, 112 err = gk20a_gmmu_alloc_flags_vid_at(g,
113 &g->acr.wpr_dummy, wpr_inf.wpr_base); 113 NVGPU_DMA_NO_KERNEL_MAPPING, wpr_inf.size,
114 &g->acr.wpr_dummy, wpr_inf.wpr_base);
114 if (err) 115 if (err)
115 return err; 116 return err;
116 117
117 return gk20a_gmmu_alloc_attr_vid_at(g, 0, wpr_inf.size, mem, 118 return gk20a_gmmu_alloc_flags_vid_at(g,
119 NVGPU_DMA_NO_KERNEL_MAPPING, wpr_inf.size, mem,
118 wpr_inf.nonwpr_base); 120 wpr_inf.nonwpr_base);
119} 121}
120 122