summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2018-03-06 18:47:39 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-03-14 13:04:03 -0400
commitbf374b779fbb71280fafcefeb3bb3d68f047b304 (patch)
treed3f3d0eb4a95c89841b9a9346142b773ccd01a4b /drivers/gpu/nvgpu/include
parent76ad9e8366f5c73d1ea47d54cea043f8cd9fa23e (diff)
gpu: nvgpu: Pass correct va_allocated field in .gmmu_unmap()
When nvgpu maps an nvgpu_mem struct the nvgpu driver has a choice of either using a fixed or non-fixed mapping. For non-fixed mappings the GMMU APIs allocate a VA space for the caller. In that case the GMMU APIs must also free that VA range when nvgpu unmaps the nvgpu_mem. For fixed mappings the GMMU APIs must instead not manage the life time of the VA space. To support these two possibilities add a field to nvgpu_mem that specifies whether the GMMU APIs must or must not free the GPU VA range during the GMMU unmap operation. Also fix a case in the nvgpu vm_area code that would double free a VA allocation in some cases (sparse allocs). Change-Id: Idc32dbb8208fa7c1c05823e67b54707fea51c6b7 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1669920 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h
index be0fa6bf..302f7287 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h
@@ -140,6 +140,7 @@ struct nvgpu_mem {
140 size_t aligned_size; 140 size_t aligned_size;
141 u64 gpu_va; 141 u64 gpu_va;
142 bool skip_wmb; 142 bool skip_wmb;
143 bool free_gpu_va;
143 144
144 /* 145 /*
145 * Set when a nvgpu_mem struct is not a "real" nvgpu_mem struct. Instead 146 * Set when a nvgpu_mem struct is not a "real" nvgpu_mem struct. Instead