summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-08-29 15:59:40 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-09-12 18:54:46 -0400
commit72f40c211eca854f713530e68f789d4a7c3bb9fa (patch)
tree5378f6b8103c1ea902077ecfa2a56f6a353589fd /drivers/gpu/nvgpu/include
parentb79c165fd74f8269000f33691d8a480359e71585 (diff)
gpu: nvgpu: page align DMA allocs
Explicitly page align DMA memory allocations. Non-page aligned DMA allocs can lead to nvgpu_mem structs that have a size that's not page aligned. Those allocs, in some cases, can cause vGPU maps to return an error. More generally DMA allocs in Linux are never going to not be page aligned both in size and address. So might as well page align the alloc size to make code else where in the driver more simple. To imlpement this an aligned_size field has been added to struct nvgpu_mem. This field has the real page aligned size of the allocation. The original size is still saved in size. Change-Id: Ie08cfc4f39d5f97db84a54b8e314ad1fa53b72be Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1547902 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@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 5aa09f3d..f3be65c2 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_mem.h
@@ -50,6 +50,7 @@ struct nvgpu_mem {
50 */ 50 */
51 enum nvgpu_aperture aperture; 51 enum nvgpu_aperture aperture;
52 size_t size; 52 size_t size;
53 size_t aligned_size;
53 u64 gpu_va; 54 u64 gpu_va;
54 bool skip_wmb; 55 bool skip_wmb;
55 56