diff options
author | Alex Waterman <alexw@nvidia.com> | 2017-11-16 15:56:53 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-11-17 19:17:20 -0500 |
commit | 35ae4194a05d47aa6d79353428f81f2ca47ce90f (patch) | |
tree | 73c7f15348e1f5deb411392f41e339572b797bb4 /drivers/gpu/nvgpu/common/mm/vm_area.c | |
parent | b42fb7ba26b565f93118fbdd9e17b42ee6144c5e (diff) |
gpu: nvgpu: Add translation for NVGPU MM flags
Add a translation layer to convert from the NVGPU_AS_* flags to
to new set of NVGPU_VM_MAP_* and NVGPU_VM_AREA_ALLOC_* flags.
This allows the common MM code to not depend on the UAPI header
defined for Linux.
In addition to this change a couple of other small changes were
made:
1. Deprecate, print a warning, and ignore usage of the
NVGPU_AS_MAP_BUFFER_FLAGS_MAPPABLE_COMPBITS flag.
2. Move the t19x IO coherence flag from the t19x UAPI header
to the regular UAPI header.
JIRA NVGPU-293
Change-Id: I146402b0e8617294374e63e78f8826c57cd3b291
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1599802
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm/vm_area.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/vm_area.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/vm_area.c b/drivers/gpu/nvgpu/common/mm/vm_area.c index b6286c43..5ed2626f 100644 --- a/drivers/gpu/nvgpu/common/mm/vm_area.c +++ b/drivers/gpu/nvgpu/common/mm/vm_area.c | |||
@@ -20,8 +20,6 @@ | |||
20 | * DEALINGS IN THE SOFTWARE. | 20 | * DEALINGS IN THE SOFTWARE. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <uapi/linux/nvgpu.h> | ||
24 | |||
25 | #include <nvgpu/vm.h> | 23 | #include <nvgpu/vm.h> |
26 | #include <nvgpu/vm_area.h> | 24 | #include <nvgpu/vm_area.h> |
27 | 25 | ||
@@ -121,7 +119,7 @@ int nvgpu_vm_area_alloc(struct vm_gk20a *vm, u32 pages, u32 page_size, | |||
121 | goto clean_up_err; | 119 | goto clean_up_err; |
122 | 120 | ||
123 | vma = vm->vma[pgsz_idx]; | 121 | vma = vm->vma[pgsz_idx]; |
124 | if (flags & NVGPU_AS_ALLOC_SPACE_FLAGS_FIXED_OFFSET) | 122 | if (flags & NVGPU_VM_AREA_ALLOC_FIXED_OFFSET) |
125 | vaddr_start = nvgpu_alloc_fixed(vma, *addr, | 123 | vaddr_start = nvgpu_alloc_fixed(vma, *addr, |
126 | (u64)pages * | 124 | (u64)pages * |
127 | (u64)page_size, | 125 | (u64)page_size, |
@@ -143,7 +141,7 @@ int nvgpu_vm_area_alloc(struct vm_gk20a *vm, u32 pages, u32 page_size, | |||
143 | 141 | ||
144 | nvgpu_mutex_acquire(&vm->update_gmmu_lock); | 142 | nvgpu_mutex_acquire(&vm->update_gmmu_lock); |
145 | 143 | ||
146 | if (flags & NVGPU_AS_ALLOC_SPACE_FLAGS_SPARSE) { | 144 | if (flags & NVGPU_VM_AREA_ALLOC_SPARSE) { |
147 | u64 map_addr = g->ops.mm.gmmu_map(vm, vaddr_start, | 145 | u64 map_addr = g->ops.mm.gmmu_map(vm, vaddr_start, |
148 | NULL, | 146 | NULL, |
149 | 0, | 147 | 0, |