From 0853109c9994d1375a10d13ae254690a4a4c9610 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Thu, 7 Sep 2017 16:45:07 -0700 Subject: gpu: nvgpu: Refactoring nvgpu_vm functions Refactor the last nvgpu_vm functions from the mm_gk20a.c code. This removes some usages of dma_buf from the mm_gk20a.c code, too, which helps make mm_gk20a.c less Linux specific. Also delete some header files that are no longer necessary in gk20a/mm_gk20a.c which are Linux specific. The mm_gk20a.c code is now quite close to being Linux free. JIRA NVGPU-30 JIRA NVGPU-138 Change-Id: I72b370bd85a7b029768b0fb4827d6abba42007c3 Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/1566629 Reviewed-by: Konsta Holtta GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gm20b/hal_gm20b.c | 2 ++ drivers/gpu/nvgpu/gm20b/mm_gm20b.c | 10 ++++++++++ drivers/gpu/nvgpu/gm20b/mm_gm20b.h | 2 ++ 3 files changed, 14 insertions(+) (limited to 'drivers/gpu/nvgpu/gm20b') diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c index 50cc759a..e146d3ca 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c @@ -443,6 +443,8 @@ static const struct gpu_ops gm20b_ops = { .is_bar1_supported = gm20b_mm_is_bar1_supported, .init_inst_block = gk20a_init_inst_block, .mmu_fault_pending = gk20a_fifo_mmu_fault_pending, + .get_kind_invalid = gm20b_get_kind_invalid, + .get_kind_pitch = gm20b_get_kind_pitch, }, .therm = { .init_therm_setup_hw = gm20b_init_therm_setup_hw, diff --git a/drivers/gpu/nvgpu/gm20b/mm_gm20b.c b/drivers/gpu/nvgpu/gm20b/mm_gm20b.c index dc332075..5cd7706d 100644 --- a/drivers/gpu/nvgpu/gm20b/mm_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/mm_gm20b.c @@ -74,3 +74,13 @@ u64 gm20b_gpu_phys_addr(struct gk20a *g, { return phys; } + +u32 gm20b_get_kind_invalid(void) +{ + return gmmu_pte_kind_invalid_v(); +} + +u32 gm20b_get_kind_pitch(void) +{ + return gmmu_pte_kind_pitch_v(); +} diff --git a/drivers/gpu/nvgpu/gm20b/mm_gm20b.h b/drivers/gpu/nvgpu/gm20b/mm_gm20b.h index 602e18dc..af67845a 100644 --- a/drivers/gpu/nvgpu/gm20b/mm_gm20b.h +++ b/drivers/gpu/nvgpu/gm20b/mm_gm20b.h @@ -38,4 +38,6 @@ bool gm20b_mm_is_bar1_supported(struct gk20a *g); int gm20b_mm_mmu_vpr_info_fetch(struct gk20a *g); u64 gm20b_gpu_phys_addr(struct gk20a *g, struct nvgpu_gmmu_attrs *attrs, u64 phys); +u32 gm20b_get_kind_invalid(void); +u32 gm20b_get_kind_pitch(void); #endif -- cgit v1.2.2