summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
diff options
context:
space:
mode:
authorRichard Zhao <rizhao@nvidia.com>2015-11-16 13:26:23 -0500
committerVladislav Buzov <vbuzov@nvidia.com>2015-11-23 17:31:02 -0500
commit1246629c19485d9a9e6fc2c2e7d1f86f65b9516d (patch)
treeb17a44c7d47ffe20ef0d6e4e6bec8acbec9ba5ad /drivers/gpu/nvgpu/gk20a/mm_gk20a.c
parent8ec63298789a0912b9cbd90ee47c76f0701f0dca (diff)
gpu: nvgpu: abstract set mmu debug mode
Add new operaton g->ops.mm.set_debug_mode and let other places that set debug mode call this callback. It's preparing for adding vgpu set mmu debug mode hook. JIRA VFND-1005 Bug 1594604 Change-Id: I1d227a0c0f96adb0035ae16ae1f4fbfa739bf0a7 Signed-off-by: Richard Zhao <rizhao@nvidia.com> Reviewed-on: http://git-master/r/833497 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Vladislav Buzov <vbuzov@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index 86b9f045..4c31d5e4 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -3723,6 +3723,24 @@ bool gk20a_mm_mmu_debug_mode_enabled(struct gk20a *g)
3723 fb_mmu_debug_ctrl_debug_enabled_v(); 3723 fb_mmu_debug_ctrl_debug_enabled_v();
3724} 3724}
3725 3725
3726static void gk20a_mm_mmu_set_debug_mode(struct gk20a *g, bool enable)
3727{
3728 u32 reg_val, debug_ctrl;
3729
3730 reg_val = gk20a_readl(g, fb_mmu_debug_ctrl_r());
3731 if (enable) {
3732 debug_ctrl = fb_mmu_debug_ctrl_debug_enabled_f();
3733 g->mmu_debug_ctrl = true;
3734 } else {
3735 debug_ctrl = fb_mmu_debug_ctrl_debug_disabled_f();
3736 g->mmu_debug_ctrl = false;
3737 }
3738
3739 reg_val = set_field(reg_val,
3740 fb_mmu_debug_ctrl_debug_m(), debug_ctrl);
3741 gk20a_writel(g, fb_mmu_debug_ctrl_r(), reg_val);
3742}
3743
3726u32 gk20a_mm_get_physical_addr_bits(struct gk20a *g) 3744u32 gk20a_mm_get_physical_addr_bits(struct gk20a *g)
3727{ 3745{
3728 return 34; 3746 return 34;
@@ -3769,6 +3787,7 @@ clean_up:
3769void gk20a_init_mm(struct gpu_ops *gops) 3787void gk20a_init_mm(struct gpu_ops *gops)
3770{ 3788{
3771 gops->mm.is_debug_mode_enabled = gk20a_mm_mmu_debug_mode_enabled; 3789 gops->mm.is_debug_mode_enabled = gk20a_mm_mmu_debug_mode_enabled;
3790 gops->mm.set_debug_mode = gk20a_mm_mmu_set_debug_mode;
3772 gops->mm.gmmu_map = gk20a_locked_gmmu_map; 3791 gops->mm.gmmu_map = gk20a_locked_gmmu_map;
3773 gops->mm.gmmu_unmap = gk20a_locked_gmmu_unmap; 3792 gops->mm.gmmu_unmap = gk20a_locked_gmmu_unmap;
3774 gops->mm.vm_remove = gk20a_vm_remove_support; 3793 gops->mm.vm_remove = gk20a_vm_remove_support;