From 7e403974d3584ab8880e42d422ee3afb7f49d6f3 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Tue, 29 Nov 2016 16:01:41 -0800 Subject: gpu: nvgpu: Simplify ref-counting on VMs Simplify ref-counting on VMs: take a ref when a VM is bound to a channel and drop a ref when a channel is freed. Previously ref-counts were scattered over the driver. Also the CE and CDE code would bind channels with custom rolled code. This was because the gk20a_vm_bind_channel() function took an as_share as the VM argument (the VM was then inferred from that as_share). However, it is trivial to abtract that bit out and allow a central bind channel function that just takes a VM and a channel. Bug 1846718 Change-Id: I156aab259f6c7a2fa338408c6c4a3a464cd44a0c Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1261886 Reviewed-by: Richard Zhao Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index 665aea42..f3dffa46 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h @@ -707,6 +707,7 @@ int gk20a_vm_free_space(struct gk20a_as_share *as_share, struct nvgpu_as_free_space_args *args); int gk20a_vm_bind_channel(struct gk20a_as_share *as_share, struct channel_gk20a *ch); +int __gk20a_vm_bind_channel(struct vm_gk20a *vm, struct channel_gk20a *ch); /* batching eliminates redundant cache flushes and invalidates */ void gk20a_vm_mapping_batch_start(struct vm_gk20a_mapping_batch *batch); -- cgit v1.2.2