diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2015-10-09 06:36:08 -0400 |
---|---|---|
committer | Konsta Holtta <kholtta@nvidia.com> | 2015-11-11 02:19:45 -0500 |
commit | 411c3a9a4f7451a8f6fe3b533bfd77d3f46f7387 (patch) | |
tree | 1f27481b796e139f7ecb67375b3af55719b10c6a /drivers/gpu | |
parent | 84523485399e29abeb4e89c064b4591985aeea91 (diff) |
gpu: nvgpu: use a separate big vm for cde
Allocate a separate VM for CDE channels instead of using the system
(PMU) vm, and make it much bigger than the PMU's to fit the maximum
number of CDE channels there.
Bug 1566740
Change-Id: I4f487c40c9ec79cc9ffb880b0ecd3f47eb450336
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/815149
Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/cde_gk20a.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 19 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 3 |
3 files changed, 24 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c index 6d8633a7..01fca058 100644 --- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c | |||
@@ -1194,8 +1194,8 @@ static int gk20a_cde_load(struct gk20a_cde_ctx *cde_ctx) | |||
1194 | } | 1194 | } |
1195 | 1195 | ||
1196 | /* bind the channel to the vm */ | 1196 | /* bind the channel to the vm */ |
1197 | gk20a_vm_get(&g->mm.pmu.vm); | 1197 | gk20a_vm_get(&g->mm.cde.vm); |
1198 | ch->vm = &g->mm.pmu.vm; | 1198 | ch->vm = &g->mm.cde.vm; |
1199 | err = channel_gk20a_commit_va(ch); | 1199 | err = channel_gk20a_commit_va(ch); |
1200 | if (err) { | 1200 | if (err) { |
1201 | gk20a_warn(&cde_ctx->pdev->dev, "cde: could not bind vm"); | 1201 | gk20a_warn(&cde_ctx->pdev->dev, "cde: could not bind vm"); |
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 15fd32d3..7876af63 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -105,6 +105,7 @@ static int update_gmmu_ptes_locked(struct vm_gk20a *vm, | |||
105 | static int __must_check gk20a_init_system_vm(struct mm_gk20a *mm); | 105 | static int __must_check gk20a_init_system_vm(struct mm_gk20a *mm); |
106 | static int __must_check gk20a_init_bar1_vm(struct mm_gk20a *mm); | 106 | static int __must_check gk20a_init_bar1_vm(struct mm_gk20a *mm); |
107 | static int __must_check gk20a_init_hwpm(struct mm_gk20a *mm); | 107 | static int __must_check gk20a_init_hwpm(struct mm_gk20a *mm); |
108 | static int __must_check gk20a_init_cde_vm(struct mm_gk20a *mm); | ||
108 | 109 | ||
109 | 110 | ||
110 | struct gk20a_dmabuf_priv { | 111 | struct gk20a_dmabuf_priv { |
@@ -344,6 +345,7 @@ static void gk20a_remove_mm_support(struct mm_gk20a *mm) | |||
344 | gk20a_remove_vm(&mm->bar1.vm, &mm->bar1.inst_block); | 345 | gk20a_remove_vm(&mm->bar1.vm, &mm->bar1.inst_block); |
345 | gk20a_remove_vm(&mm->pmu.vm, &mm->pmu.inst_block); | 346 | gk20a_remove_vm(&mm->pmu.vm, &mm->pmu.inst_block); |
346 | gk20a_free_inst_block(gk20a_from_mm(mm), &mm->hwpm.inst_block); | 347 | gk20a_free_inst_block(gk20a_from_mm(mm), &mm->hwpm.inst_block); |
348 | gk20a_vm_remove_support_nofree(&mm->cde.vm); | ||
347 | } | 349 | } |
348 | 350 | ||
349 | int gk20a_init_mm_setup_sw(struct gk20a *g) | 351 | int gk20a_init_mm_setup_sw(struct gk20a *g) |
@@ -386,6 +388,10 @@ int gk20a_init_mm_setup_sw(struct gk20a *g) | |||
386 | if (err) | 388 | if (err) |
387 | return err; | 389 | return err; |
388 | 390 | ||
391 | err = gk20a_init_cde_vm(mm); | ||
392 | if (err) | ||
393 | return err; | ||
394 | |||
389 | /* set vm_alloc_share op here as gk20a_as_alloc_share needs it */ | 395 | /* set vm_alloc_share op here as gk20a_as_alloc_share needs it */ |
390 | g->ops.mm.vm_alloc_share = gk20a_vm_alloc_share; | 396 | g->ops.mm.vm_alloc_share = gk20a_vm_alloc_share; |
391 | mm->remove_support = gk20a_remove_mm_support; | 397 | mm->remove_support = gk20a_remove_mm_support; |
@@ -3268,6 +3274,19 @@ static int gk20a_init_hwpm(struct mm_gk20a *mm) | |||
3268 | return 0; | 3274 | return 0; |
3269 | } | 3275 | } |
3270 | 3276 | ||
3277 | static int gk20a_init_cde_vm(struct mm_gk20a *mm) | ||
3278 | { | ||
3279 | struct vm_gk20a *vm = &mm->cde.vm; | ||
3280 | struct gk20a *g = gk20a_from_mm(mm); | ||
3281 | u32 big_page_size = gk20a_get_platform(g->dev)->default_big_page_size; | ||
3282 | |||
3283 | return gk20a_init_vm(mm, vm, big_page_size, | ||
3284 | SZ_4K * 16, | ||
3285 | NV_MM_DEFAULT_KERNEL_SIZE, | ||
3286 | NV_MM_DEFAULT_KERNEL_SIZE + NV_MM_DEFAULT_USER_SIZE, | ||
3287 | false, "cde"); | ||
3288 | } | ||
3289 | |||
3271 | void gk20a_mm_init_pdb(struct gk20a *g, void *inst_ptr, u64 pdb_addr) | 3290 | void gk20a_mm_init_pdb(struct gk20a *g, void *inst_ptr, u64 pdb_addr) |
3272 | { | 3291 | { |
3273 | u32 pdb_addr_lo = u64_lo32(pdb_addr >> ram_in_base_shift_v()); | 3292 | u32 pdb_addr_lo = u64_lo32(pdb_addr >> ram_in_base_shift_v()); |
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index 9e373d8e..7bbaf283 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h | |||
@@ -318,6 +318,9 @@ struct mm_gk20a { | |||
318 | struct mem_desc inst_block; | 318 | struct mem_desc inst_block; |
319 | } hwpm; | 319 | } hwpm; |
320 | 320 | ||
321 | struct { | ||
322 | struct vm_gk20a vm; | ||
323 | } cde; | ||
321 | 324 | ||
322 | struct mutex l2_op_lock; | 325 | struct mutex l2_op_lock; |
323 | #ifdef CONFIG_ARCH_TEGRA_18x_SOC | 326 | #ifdef CONFIG_ARCH_TEGRA_18x_SOC |