summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-05-09 21:34:54 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-06 20:09:16 -0400
commitc21f5bca9ae81804130e30ea3e6f7a18d51203dc (patch)
treefb1a2d67532df19d70468610ad2a62c3464876c1 /drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c
parentc2b63150cd947557b8d17637258b988459b8e0ec (diff)
gpu: nvgpu: Remove extraneous VM init/deinit APIs
Support only VM pointers and ref-counting for maintaining VMs. This dramatically reduces the complexity of the APIs, avoids the API abuse that has existed, and ensures that future VM usage is consistent with current usage. Also remove the combined VM free/instance block deletion. Any place where this was done is now replaced with an explict free of the instance block and a nvgpu_vm_put(). JIRA NVGPU-12 JIRA NVGPU-30 Change-Id: Ib73e8d574ecc9abf6dad0b40a2c5795d6396cc8c Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1480227 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c
index f5176e98..452bcd11 100644
--- a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c
@@ -146,7 +146,7 @@ static int css_hw_enable_snapshot(struct channel_gk20a *ch,
146 if (snapshot_size < CSS_MIN_HW_SNAPSHOT_SIZE) 146 if (snapshot_size < CSS_MIN_HW_SNAPSHOT_SIZE)
147 snapshot_size = CSS_MIN_HW_SNAPSHOT_SIZE; 147 snapshot_size = CSS_MIN_HW_SNAPSHOT_SIZE;
148 148
149 ret = nvgpu_dma_alloc_map_sys(&g->mm.pmu.vm, snapshot_size, 149 ret = nvgpu_dma_alloc_map_sys(g->mm.pmu.vm, snapshot_size,
150 &data->hw_memdesc); 150 &data->hw_memdesc);
151 if (ret) 151 if (ret)
152 return ret; 152 return ret;
@@ -195,7 +195,7 @@ static int css_hw_enable_snapshot(struct channel_gk20a *ch,
195 195
196failed_allocation: 196failed_allocation:
197 if (data->hw_memdesc.size) { 197 if (data->hw_memdesc.size) {
198 nvgpu_dma_unmap_free(&g->mm.pmu.vm, &data->hw_memdesc); 198 nvgpu_dma_unmap_free(g->mm.pmu.vm, &data->hw_memdesc);
199 memset(&data->hw_memdesc, 0, sizeof(data->hw_memdesc)); 199 memset(&data->hw_memdesc, 0, sizeof(data->hw_memdesc));
200 } 200 }
201 data->hw_snapshot = NULL; 201 data->hw_snapshot = NULL;
@@ -223,7 +223,7 @@ static void css_hw_disable_snapshot(struct gr_gk20a *gr)
223 perf_pmasys_mem_block_valid_false_f() | 223 perf_pmasys_mem_block_valid_false_f() |
224 perf_pmasys_mem_block_target_f(0)); 224 perf_pmasys_mem_block_target_f(0));
225 225
226 nvgpu_dma_unmap_free(&g->mm.pmu.vm, &data->hw_memdesc); 226 nvgpu_dma_unmap_free(g->mm.pmu.vm, &data->hw_memdesc);
227 memset(&data->hw_memdesc, 0, sizeof(data->hw_memdesc)); 227 memset(&data->hw_memdesc, 0, sizeof(data->hw_memdesc));
228 data->hw_snapshot = NULL; 228 data->hw_snapshot = NULL;
229 229