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/gk20a/fecs_trace_gk20a.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c index 7fd1793c..12d7dcb9 100644 --- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "ctxsw_trace_gk20a.h" #include "fecs_trace_gk20a.h" @@ -93,7 +94,7 @@ static inline u64 gk20a_fecs_trace_record_ts_timestamp_v(u64 ts) static u32 gk20a_fecs_trace_fecs_context_ptr(struct gk20a *g, struct channel_gk20a *ch) { - return (u32) (gk20a_mm_inst_block_addr(g, &ch->inst_block) >> 12LL); + return (u32) (nvgpu_inst_block_addr(g, &ch->inst_block) >> 12LL); } static inline int gk20a_fecs_trace_num_ts(void) @@ -633,12 +634,12 @@ int gk20a_fecs_trace_bind_channel(struct gk20a *g, gk20a_dbg(gpu_dbg_fn|gpu_dbg_ctxsw, "chid=%d context_ptr=%x inst_block=%llx", ch->chid, context_ptr, - gk20a_mm_inst_block_addr(g, &ch->inst_block)); + nvgpu_inst_block_addr(g, &ch->inst_block)); if (!trace) return -ENOMEM; - pa = gk20a_mm_inst_block_addr(g, &trace->trace_buf); + pa = nvgpu_inst_block_addr(g, &trace->trace_buf); if (!pa) return -ENOMEM; aperture = nvgpu_aperture_mask(g, &trace->trace_buf, -- cgit v1.2.2