summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2015-01-14 11:54:26 -0500
committerDan Willemsen <dwillemsen@nvidia.com>2015-04-04 21:08:16 -0400
commitf3a920cb01d1517db5432c8062b660d6b60eb4de (patch)
treebc366a7df51745ea2d6b740395403cf2add2ebef /drivers/gpu/nvgpu/gk20a/gk20a.c
parent8d1ab756ed8a7f4d3138dc5da9d2de9f52915261 (diff)
gpu: nvgpu: Refactor page mapping code
Pass always the directory structure to mm functions instead of pointers to members to it. Also split update_gmmu_ptes_locked() into smaller functions, and turn the hard coded MMU levels (PDE, PTE) into run-time parameters. Change-Id: I315ef7aebbea1e61156705361f2e2a63b5fb7bf1 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/672485 Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index 57d5f09a..76237fae 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GK20A Graphics 2 * GK20A Graphics
3 * 3 *
4 * Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2011-2015, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -1789,7 +1789,8 @@ int gk20a_init_gpu_characteristics(struct gk20a *g)
1789 1789
1790 gpu->big_page_size = g->mm.pmu.vm.big_page_size; 1790 gpu->big_page_size = g->mm.pmu.vm.big_page_size;
1791 gpu->compression_page_size = g->ops.fb.compression_page_size(g); 1791 gpu->compression_page_size = g->ops.fb.compression_page_size(g);
1792 gpu->pde_coverage_bit_count = g->mm.pmu.vm.pde_stride_shift; 1792 gpu->pde_coverage_bit_count =
1793 gk20a_mm_pde_coverage_bit_count(&g->mm.pmu.vm);
1793 1794
1794 gpu->available_big_page_sizes = gpu->big_page_size; 1795 gpu->available_big_page_sizes = gpu->big_page_size;
1795 if (g->ops.mm.get_big_page_sizes) 1796 if (g->ops.mm.get_big_page_sizes)
@@ -1798,7 +1799,7 @@ int gk20a_init_gpu_characteristics(struct gk20a *g)
1798 gpu->flags = NVGPU_GPU_FLAGS_SUPPORT_PARTIAL_MAPPINGS 1799 gpu->flags = NVGPU_GPU_FLAGS_SUPPORT_PARTIAL_MAPPINGS
1799 | NVGPU_GPU_FLAGS_SUPPORT_SYNC_FENCE_FDS; 1800 | NVGPU_GPU_FLAGS_SUPPORT_SYNC_FENCE_FDS;
1800 1801
1801 if (g->ops.mm.set_sparse) 1802 if (g->ops.mm.support_sparse && g->ops.mm.support_sparse(g))
1802 gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_SPARSE_ALLOCS; 1803 gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_SPARSE_ALLOCS;
1803 1804
1804 if (IS_ENABLED(CONFIG_TEGRA_GK20A) && 1805 if (IS_ENABLED(CONFIG_TEGRA_GK20A) &&