From b3a85df53ba844626e477451313ecb2097a34fd0 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 13 Mar 2015 10:57:19 -0700 Subject: gpu: nvgpu: SMMU bypass Improve GMMU mapping code to cope with discontiguous buffers. Add debugfs entry that allows bypassing SMMU and disabling big pages. Bug 1605769 Change-Id: I14d32c62293a16ff8c7195377c75a85fa8061083 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/717503 Reviewed-by: Deepak Nibade Reviewed-on: http://git-master/r/737533 Reviewed-by: Alexander Van Brunt Tested-by: Alexander Van Brunt Reviewed-by: Automatic_Commit_Validation_User --- drivers/gpu/nvgpu/gk20a/gk20a.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index f3a333f3..f6c9f901 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -1482,6 +1482,8 @@ static int gk20a_probe(struct platform_device *dev) spin_lock_init(&gk20a->debugfs_lock); gk20a->mm.ltc_enabled = true; gk20a->mm.ltc_enabled_debug = true; + gk20a->mm.bypass_smmu = platform->bypass_smmu; + gk20a->mm.disable_bigpage = platform->disable_bigpage; gk20a->debugfs_ltc_enabled = debugfs_create_bool("ltc_enabled", S_IRUGO|S_IWUSR, platform->debugfs, @@ -1496,6 +1498,16 @@ static int gk20a_probe(struct platform_device *dev) S_IRUGO|S_IWUSR, platform->debugfs, &gk20a->timeouts_enabled); + gk20a->debugfs_bypass_smmu = + debugfs_create_bool("bypass_smmu", + S_IRUGO|S_IWUSR, + platform->debugfs, + &gk20a->mm.bypass_smmu); + gk20a->debugfs_disable_bigpage = + debugfs_create_bool("disable_bigpage", + S_IRUGO|S_IWUSR, + platform->debugfs, + &gk20a->mm.disable_bigpage); gk20a_pmu_debugfs_init(dev); gk20a_cde_debugfs_init(dev); #endif @@ -1929,9 +1941,14 @@ int gk20a_init_gpu_characteristics(struct gk20a *g) gpu->pde_coverage_bit_count = gk20a_mm_pde_coverage_bit_count(&g->mm.pmu.vm); - gpu->available_big_page_sizes = gpu->big_page_size; - if (g->ops.mm.get_big_page_sizes) - gpu->available_big_page_sizes |= g->ops.mm.get_big_page_sizes(); + if (g->mm.disable_bigpage) { + gpu->big_page_size = 0; + gpu->available_big_page_sizes = 0; + } else { + gpu->available_big_page_sizes = gpu->big_page_size; + if (g->ops.mm.get_big_page_sizes) + gpu->available_big_page_sizes |= g->ops.mm.get_big_page_sizes(); + } gpu->flags = NVGPU_GPU_FLAGS_SUPPORT_PARTIAL_MAPPINGS | NVGPU_GPU_FLAGS_SUPPORT_SYNC_FENCE_FDS; -- cgit v1.2.2