summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-10-17 18:54:31 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-11-01 22:06:27 -0400
commita8bd154f7907c7054f8668c5995c1b5a7f748edc (patch)
treec218183ea2b815141d3aa2eedbf3928610612ab1 /drivers/gpu/nvgpu/include
parentd13c256d5ee11da1664377481543005142d9bd30 (diff)
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 <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1583983 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/linux/vm.h1
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/vm.h3
2 files changed, 1 insertions, 3 deletions
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,
72 */ 72 */
73 s16 incompr_kind, 73 s16 incompr_kind,
74 74
75 bool user_mapped,
76 int rw_flag, 75 int rw_flag,
77 u64 buffer_offset, 76 u64 buffer_offset,
78 u64 mapping_size, 77 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 {
96 struct dma_buf *dmabuf; 96 struct dma_buf *dmabuf;
97 struct sg_table *sgt; 97 struct sg_table *sgt;
98 struct nvgpu_ref ref; 98 struct nvgpu_ref ref;
99 u32 user_mapped; 99
100 bool own_mem_ref;
101 u32 pgsz_idx; 100 u32 pgsz_idx;
102 u32 ctag_offset; 101 u32 ctag_offset;
103 u32 ctag_lines; 102 u32 ctag_lines;