From f3a920cb01d1517db5432c8062b660d6b60eb4de Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 14 Jan 2015 08:54:26 -0800 Subject: 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 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/672485 Reviewed-by: Automatic_Commit_Validation_User --- drivers/gpu/nvgpu/gk20a/gk20a.c | 7 ++++--- 1 file changed, 4 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 57d5f09a..76237fae 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -1,7 +1,7 @@ /* * GK20A Graphics * - * Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2015, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -1789,7 +1789,8 @@ int gk20a_init_gpu_characteristics(struct gk20a *g) gpu->big_page_size = g->mm.pmu.vm.big_page_size; gpu->compression_page_size = g->ops.fb.compression_page_size(g); - gpu->pde_coverage_bit_count = g->mm.pmu.vm.pde_stride_shift; + 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) @@ -1798,7 +1799,7 @@ int gk20a_init_gpu_characteristics(struct gk20a *g) gpu->flags = NVGPU_GPU_FLAGS_SUPPORT_PARTIAL_MAPPINGS | NVGPU_GPU_FLAGS_SUPPORT_SYNC_FENCE_FDS; - if (g->ops.mm.set_sparse) + if (g->ops.mm.support_sparse && g->ops.mm.support_sparse(g)) gpu->flags |= NVGPU_GPU_FLAGS_SUPPORT_SPARSE_ALLOCS; if (IS_ENABLED(CONFIG_TEGRA_GK20A) && -- cgit v1.2.2