From 9f5f029ae291ebbfef9f1e08b39875fa47c44982 Mon Sep 17 00:00:00 2001 From: Sami Kiminki Date: Thu, 2 Nov 2017 21:28:42 +0200 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1590961 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/linux/vm.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/include') 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; struct vm_gk20a_mapping_batch; struct nvgpu_vm_area; -u64 nvgpu_vm_map_linux(struct vm_gk20a *vm, +int nvgpu_vm_map_linux(struct vm_gk20a *vm, struct dma_buf *dmabuf, u64 offset_align, u32 flags, @@ -60,7 +60,8 @@ u64 nvgpu_vm_map_linux(struct vm_gk20a *vm, int rw_flag, u64 buffer_offset, u64 mapping_size, - struct vm_gk20a_mapping_batch *mapping_batch); + struct vm_gk20a_mapping_batch *mapping_batch, + u64 *gpu_va); /* * Notes: -- cgit v1.2.2