diff options
author | Alex Waterman <alexw@nvidia.com> | 2016-11-29 19:01:41 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-02-07 17:54:02 -0500 |
commit | 7e403974d3584ab8880e42d422ee3afb7f49d6f3 (patch) | |
tree | 9103e53336d8ec70f81acab5d39c9da2107abd2e /drivers/gpu/nvgpu/vgpu/mm_vgpu.c | |
parent | 07f07981733135f648c53acfedf03b43045fed08 (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/vgpu/mm_vgpu.c')
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/mm_vgpu.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c index 76631b96..f97acd47 100644 --- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c | |||
@@ -446,6 +446,9 @@ static int vgpu_vm_bind_channel(struct gk20a_as_share *as_share, | |||
446 | err = -ENOMEM; | 446 | err = -ENOMEM; |
447 | } | 447 | } |
448 | 448 | ||
449 | if (ch->vm) | ||
450 | gk20a_vm_get(ch->vm); | ||
451 | |||
449 | return err; | 452 | return err; |
450 | } | 453 | } |
451 | 454 | ||