diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 25 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 5 |
3 files changed, 24 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 70eb0a7e..606dbc1f 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -696,6 +696,9 @@ void gk20a_remove_support(struct device *dev) | |||
696 | if (g->gr.remove_support) | 696 | if (g->gr.remove_support) |
697 | g->gr.remove_support(&g->gr); | 697 | g->gr.remove_support(&g->gr); |
698 | 698 | ||
699 | if (g->mm.remove_ce_support) | ||
700 | g->mm.remove_ce_support(&g->mm); | ||
701 | |||
699 | if (g->fifo.remove_support) | 702 | if (g->fifo.remove_support) |
700 | g->fifo.remove_support(&g->fifo); | 703 | g->fifo.remove_support(&g->fifo); |
701 | 704 | ||
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 | ||
787 | static void gk20a_remove_mm_support(struct mm_gk20a *mm) | 787 | static 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 | |||
802 | static 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 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index b2cca072..1a9bee5f 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h | |||
@@ -376,6 +376,11 @@ struct mm_gk20a { | |||
376 | #ifdef CONFIG_ARCH_TEGRA_18x_SOC | 376 | #ifdef CONFIG_ARCH_TEGRA_18x_SOC |
377 | struct mem_desc bar2_desc; | 377 | struct mem_desc bar2_desc; |
378 | #endif | 378 | #endif |
379 | /* | ||
380 | * Separate function to cleanup the CE since it requires a channel to | ||
381 | * be closed which must happen before fifo cleanup. | ||
382 | */ | ||
383 | void (*remove_ce_support)(struct mm_gk20a *mm); | ||
379 | void (*remove_support)(struct mm_gk20a *mm); | 384 | void (*remove_support)(struct mm_gk20a *mm); |
380 | bool sw_ready; | 385 | bool sw_ready; |
381 | int physical_bits; | 386 | int physical_bits; |