From 2a285d0607a20694476399f5719e74dbc26fcd58 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Fri, 6 Oct 2017 11:30:29 -0700 Subject: gpu: nvgpu: Cleanup generic MM code in gk20a/mm_gk20a.c Move much of the remaining generic MM code to a new common location: common/mm/mm.c. Also add a corresponding header. This mostly consists of init and cleanup code to handle the common MM data structures like the VIDMEM code, address spaces for various engines, etc. A few more indepth changes were made as well. 1. alloc_inst_block() has been added to the MM HAL. This used to be defined directly in the gk20a code but it used a register. As a result, if this register hypothetically changes in the future, it would need to become a HAL anyway. This path preempts that and for now just defines all HALs to use the gk20a version. 2. Rename as much as possible: global functions are, for the most part, prepended with nvgpu (there are a few exceptions which I have yet to decide what to do with). Functions that are static are renamed to be as consistent with their functionality as possible since in some cases function effect and function name have diverged. JIRA NVGPU-30 Change-Id: Ic948f1ecc2f7976eba4bb7169a44b7226bb7c0b5 Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/1574499 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gm20b/bus_gm20b.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gm20b/bus_gm20b.c') diff --git a/drivers/gpu/nvgpu/gm20b/bus_gm20b.c b/drivers/gpu/nvgpu/gm20b/bus_gm20b.c index b8d42f7a..34c8d4b7 100644 --- a/drivers/gpu/nvgpu/gm20b/bus_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/bus_gm20b.c @@ -24,6 +24,7 @@ #include #include +#include #include "bus_gm20b.h" #include "gk20a/gk20a.h" @@ -35,8 +36,8 @@ int gm20b_bus_bar1_bind(struct gk20a *g, struct nvgpu_mem *bar1_inst) { struct nvgpu_timeout timeout; int err = 0; - u64 iova = gk20a_mm_inst_block_addr(g, bar1_inst); - u32 ptr_v = (u32)(iova >> bar1_instance_block_shift_gk20a()); + u64 iova = nvgpu_inst_block_addr(g, bar1_inst); + u32 ptr_v = (u32)(iova >> bus_bar1_block_ptr_shift_v()); gk20a_dbg_info("bar1 inst block ptr: 0x%08x", ptr_v); -- cgit v1.2.2