From a8bd154f7907c7054f8668c5995c1b5a7f748edc Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Tue, 17 Oct 2017 15:54:31 -0700 Subject: gpu: nvgpu: Remove user_mapped from mapped_buf Remove the always true field 'user_mapped' from the mapped_buf struct. All mapped_bufs are mapped by a user request since they always originate from a dma_buf (for Linux, that is). As such there is a fair amount of logic that could be deleted. Linux specific: the own_mem_ref field was also be deleted. The logic of only storing a dma_buf ref when the buffer is mapped for the first time by a user is easy: when the mapped buffer is found in the map cache release the outstanding dma_buf ref taken earlier on in the map path. If the map cache does not have the buffer simply let the higher level map code keep the dma_buf ref. The dma_buf ref is released when the nvgpu_vm_unmap_system() call-back is called by the unmap path. JIRA NVGPU-30 JIRA NVGPU-71 Change-Id: I229d136713812a7332bdadd5ebacd85d983bbbf0 Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/1583983 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/linux/vm.h | 1 - drivers/gpu/nvgpu/include/nvgpu/vm.h | 3 +-- 2 files changed, 1 insertion(+), 3 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 3d9f9ea6..3794706c 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h +++ b/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h @@ -72,7 +72,6 @@ u64 nvgpu_vm_map_linux(struct vm_gk20a *vm, */ s16 incompr_kind, - bool user_mapped, int rw_flag, u64 buffer_offset, u64 mapping_size, diff --git a/drivers/gpu/nvgpu/include/nvgpu/vm.h b/drivers/gpu/nvgpu/include/nvgpu/vm.h index 84c7e0c7..7370a8e3 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/vm.h +++ b/drivers/gpu/nvgpu/include/nvgpu/vm.h @@ -96,8 +96,7 @@ struct nvgpu_mapped_buf { struct dma_buf *dmabuf; struct sg_table *sgt; struct nvgpu_ref ref; - u32 user_mapped; - bool own_mem_ref; + u32 pgsz_idx; u32 ctag_offset; u32 ctag_lines; -- cgit v1.2.2