diff options
author | Sami Kiminki <skiminki@nvidia.com> | 2017-11-02 15:28:42 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-11-03 14:55:30 -0400 |
commit | 9f5f029ae291ebbfef9f1e08b39875fa47c44982 (patch) | |
tree | 24220a5d15cd838131fd477d077d76eb96baef2c /drivers/gpu/nvgpu/include/nvgpu | |
parent | fe1e09d473044f7caaf8b834a094f4784bc5f5e1 (diff) |
gpu: nvgpu: Return error code properly from nvgpu_vm_map_linux
The function nvgpu_vm_map_linux() used to return GPU VA on successful
map or 0 when things didn't go smoothly. However, this scheme does not
propagate the actual map error back to the userspace.
So, modify the function a bit: return error and return the GPU VA via
pointer on success.
Bug 1705731
Change-Id: I2174b5fbaf64dcb00f9567dab1c583d6ddfa5d78
Signed-off-by: Sami Kiminki <skiminki@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1590961
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/linux/vm.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h b/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h index 596a3b62..d810f95f 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h +++ b/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h | |||
@@ -38,7 +38,7 @@ struct vm_gk20a; | |||
38 | struct vm_gk20a_mapping_batch; | 38 | struct vm_gk20a_mapping_batch; |
39 | struct nvgpu_vm_area; | 39 | struct nvgpu_vm_area; |
40 | 40 | ||
41 | u64 nvgpu_vm_map_linux(struct vm_gk20a *vm, | 41 | int nvgpu_vm_map_linux(struct vm_gk20a *vm, |
42 | struct dma_buf *dmabuf, | 42 | struct dma_buf *dmabuf, |
43 | u64 offset_align, | 43 | u64 offset_align, |
44 | u32 flags, | 44 | u32 flags, |
@@ -60,7 +60,8 @@ u64 nvgpu_vm_map_linux(struct vm_gk20a *vm, | |||
60 | int rw_flag, | 60 | int rw_flag, |
61 | u64 buffer_offset, | 61 | u64 buffer_offset, |
62 | u64 mapping_size, | 62 | u64 mapping_size, |
63 | struct vm_gk20a_mapping_batch *mapping_batch); | 63 | struct vm_gk20a_mapping_batch *mapping_batch, |
64 | u64 *gpu_va); | ||
64 | 65 | ||
65 | /* | 66 | /* |
66 | * Notes: | 67 | * Notes: |