summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2016-09-22 13:07:53 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-10-26 14:09:57 -0400
commit93eea1d72934b28db4707e5aa7ab4dab65d89551 (patch)
treedce26388540b15745ff57ee28c22d058f3602d27 /drivers/gpu/nvgpu/gk20a/mm_gk20a.c
parentf0fe1c2f0247cc4e2d786e879cb0c951ccb2181e (diff)
gpu: nvgpu: Move CE cleanup
Move the CE cleanup to before the FIFO cleanup. Since the CE closes a channel during its cleanup the FIFO needs to be initialized since the FIFO code maintains the vmalloc()'ed channels. Bug 1816516 Change-Id: Ia7a97059a12a0c2b52368ffe411e597f803e8e6e Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1225613 (cherry picked from commit 707bd2a6d4672c6a7b7a8b2e581ea3a606ed971d) Reviewed-on: http://git-master/r/1240106 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index 944a5b13..079e42ba 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -784,11 +784,25 @@ static void gk20a_vidmem_destroy(struct gk20a *g)
784#endif 784#endif
785} 785}
786 786
787static void gk20a_remove_mm_support(struct mm_gk20a *mm) 787static void gk20a_remove_mm_ce_support(struct mm_gk20a *mm)
788{ 788{
789 struct gk20a *g = gk20a_from_mm(mm); 789 struct gk20a *g = gk20a_from_mm(mm);
790 struct gk20a_platform *platform = gk20a_get_platform(g->dev); 790 struct gk20a_platform *platform = gk20a_get_platform(g->dev);
791 791
792 if (mm->vidmem.ce_ctx_id != ~0)
793 gk20a_ce_delete_context(g->dev, mm->vidmem.ce_ctx_id);
794
795 mm->vidmem.ce_ctx_id = ~0;
796
797 if (platform->has_ce)
798 gk20a_vm_remove_support_nofree(&mm->ce.vm);
799
800}
801
802static void gk20a_remove_mm_support(struct mm_gk20a *mm)
803{
804 struct gk20a *g = gk20a_from_mm(mm);
805
792 if (g->ops.mm.remove_bar2_vm) 806 if (g->ops.mm.remove_bar2_vm)
793 g->ops.mm.remove_bar2_vm(g); 807 g->ops.mm.remove_bar2_vm(g);
794 808
@@ -799,14 +813,6 @@ static void gk20a_remove_mm_support(struct mm_gk20a *mm)
799 gk20a_free_inst_block(gk20a_from_mm(mm), &mm->hwpm.inst_block); 813 gk20a_free_inst_block(gk20a_from_mm(mm), &mm->hwpm.inst_block);
800 gk20a_vm_remove_support_nofree(&mm->cde.vm); 814 gk20a_vm_remove_support_nofree(&mm->cde.vm);
801 815
802 if (mm->vidmem.ce_ctx_id != ~0)
803 gk20a_ce_delete_context(g->dev, mm->vidmem.ce_ctx_id);
804
805 mm->vidmem.ce_ctx_id = ~0;
806
807 if (platform->has_ce)
808 gk20a_vm_remove_support_nofree(&mm->ce.vm);
809
810 gk20a_vidmem_destroy(g); 816 gk20a_vidmem_destroy(g);
811} 817}
812 818
@@ -1034,6 +1040,7 @@ int gk20a_init_mm_setup_sw(struct gk20a *g)
1034 /* set vm_alloc_share op here as gk20a_as_alloc_share needs it */ 1040 /* set vm_alloc_share op here as gk20a_as_alloc_share needs it */
1035 g->ops.mm.vm_alloc_share = gk20a_vm_alloc_share; 1041 g->ops.mm.vm_alloc_share = gk20a_vm_alloc_share;
1036 mm->remove_support = gk20a_remove_mm_support; 1042 mm->remove_support = gk20a_remove_mm_support;
1043 mm->remove_ce_support = gk20a_remove_mm_ce_support;
1037 1044
1038 mm->sw_ready = true; 1045 mm->sw_ready = true;
1039 1046