summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2016-11-29 19:01:41 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-02-07 17:54:02 -0500
commit7e403974d3584ab8880e42d422ee3afb7f49d6f3 (patch)
tree9103e53336d8ec70f81acab5d39c9da2107abd2e /drivers/gpu/nvgpu/gk20a/mm_gk20a.h
parent07f07981733135f648c53acfedf03b43045fed08 (diff)
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 <alexw@nvidia.com> Reviewed-on: http://git-master/r/1261886 Reviewed-by: Richard Zhao <rizhao@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.h1
1 files changed, 1 insertions, 0 deletions
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,
707 struct nvgpu_as_free_space_args *args); 707 struct nvgpu_as_free_space_args *args);
708int gk20a_vm_bind_channel(struct gk20a_as_share *as_share, 708int gk20a_vm_bind_channel(struct gk20a_as_share *as_share,
709 struct channel_gk20a *ch); 709 struct channel_gk20a *ch);
710int __gk20a_vm_bind_channel(struct vm_gk20a *vm, struct channel_gk20a *ch);
710 711
711/* batching eliminates redundant cache flushes and invalidates */ 712/* batching eliminates redundant cache flushes and invalidates */
712void gk20a_vm_mapping_batch_start(struct vm_gk20a_mapping_batch *batch); 713void gk20a_vm_mapping_batch_start(struct vm_gk20a_mapping_batch *batch);