summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2015-03-13 13:57:19 -0400
committerAlexander Van Brunt <avanbrunt@nvidia.com>2015-05-05 16:59:01 -0400
commitb3a85df53ba844626e477451313ecb2097a34fd0 (patch)
treefcaa92b11163942cc3ae902805727653633680cd /drivers/gpu/nvgpu/gk20a/gk20a.c
parent4425e9ebcf85443773a15891ba40242d714426a1 (diff)
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 <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/717503 Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/737533 Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com> Tested-by: Alexander Van Brunt <avanbrunt@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c23
1 files changed, 20 insertions, 3 deletions
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)
1482 spin_lock_init(&gk20a->debugfs_lock); 1482 spin_lock_init(&gk20a->debugfs_lock);
1483 gk20a->mm.ltc_enabled = true; 1483 gk20a->mm.ltc_enabled = true;
1484 gk20a->mm.ltc_enabled_debug = true; 1484 gk20a->mm.ltc_enabled_debug = true;
1485 gk20a->mm.bypass_smmu = platform->bypass_smmu;
1486 gk20a->mm.disable_bigpage = platform->disable_bigpage;
1485 gk20a->debugfs_ltc_enabled = 1487 gk20a->debugfs_ltc_enabled =
1486 debugfs_create_bool("ltc_enabled", S_IRUGO|S_IWUSR, 1488 debugfs_create_bool("ltc_enabled", S_IRUGO|S_IWUSR,
1487 platform->debugfs, 1489 platform->debugfs,
@@ -1496,6 +1498,16 @@ static int gk20a_probe(struct platform_device *dev)
1496 S_IRUGO|S_IWUSR, 1498 S_IRUGO|S_IWUSR,
1497 platform->debugfs, 1499 platform->debugfs,
1498 &gk20a->timeouts_enabled); 1500 &gk20a->timeouts_enabled);
1501 gk20a->debugfs_bypass_smmu =
1502 debugfs_create_bool("bypass_smmu",
1503 S_IRUGO|S_IWUSR,
1504 platform->debugfs,
1505 &gk20a->mm.bypass_smmu);
1506 gk20a->debugfs_disable_bigpage =
1507 debugfs_create_bool("disable_bigpage",
1508 S_IRUGO|S_IWUSR,
1509 platform->debugfs,
1510 &gk20a->mm.disable_bigpage);
1499 gk20a_pmu_debugfs_init(dev); 1511 gk20a_pmu_debugfs_init(dev);
1500 gk20a_cde_debugfs_init(dev); 1512 gk20a_cde_debugfs_init(dev);
1501#endif 1513#endif
@@ -1929,9 +1941,14 @@ int gk20a_init_gpu_characteristics(struct gk20a *g)
1929 gpu->pde_coverage_bit_count = 1941 gpu->pde_coverage_bit_count =
1930 gk20a_mm_pde_coverage_bit_count(&g->mm.pmu.vm); 1942 gk20a_mm_pde_coverage_bit_count(&g->mm.pmu.vm);
1931 1943
1932 gpu->available_big_page_sizes = gpu->big_page_size; 1944 if (g->mm.disable_bigpage) {
1933 if (g->ops.mm.get_big_page_sizes) 1945 gpu->big_page_size = 0;
1934 gpu->available_big_page_sizes |= g->ops.mm.get_big_page_sizes(); 1946 gpu->available_big_page_sizes = 0;
1947 } else {
1948 gpu->available_big_page_sizes = gpu->big_page_size;
1949 if (g->ops.mm.get_big_page_sizes)
1950 gpu->available_big_page_sizes |= g->ops.mm.get_big_page_sizes();
1951 }
1935 1952
1936 gpu->flags = NVGPU_GPU_FLAGS_SUPPORT_PARTIAL_MAPPINGS 1953 gpu->flags = NVGPU_GPU_FLAGS_SUPPORT_PARTIAL_MAPPINGS
1937 | NVGPU_GPU_FLAGS_SUPPORT_SYNC_FENCE_FDS; 1954 | NVGPU_GPU_FLAGS_SUPPORT_SYNC_FENCE_FDS;