summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/mm/vm.c
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/common/mm/vm.c
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/common/mm/vm.c')
-rw-r--r--drivers/gpu/nvgpu/common/mm/vm.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/vm.c b/drivers/gpu/nvgpu/common/mm/vm.c
index 3d10ff48..2ce62e75 100644
--- a/drivers/gpu/nvgpu/common/mm/vm.c
+++ b/drivers/gpu/nvgpu/common/mm/vm.c
@@ -672,11 +672,9 @@ int nvgpu_vm_get_buffers(struct vm_gk20a *vm,
672 nvgpu_rbtree_enum_start(0, &node, vm->mapped_buffers); 672 nvgpu_rbtree_enum_start(0, &node, vm->mapped_buffers);
673 while (node) { 673 while (node) {
674 mapped_buffer = mapped_buffer_from_rbtree_node(node); 674 mapped_buffer = mapped_buffer_from_rbtree_node(node);
675 if (mapped_buffer->user_mapped) { 675 buffer_list[i] = mapped_buffer;
676 buffer_list[i] = mapped_buffer; 676 nvgpu_ref_get(&mapped_buffer->ref);
677 nvgpu_ref_get(&mapped_buffer->ref); 677 i++;
678 i++;
679 }
680 nvgpu_rbtree_enum_next(&node, node); 678 nvgpu_rbtree_enum_next(&node, node);
681 } 679 }
682 680