From 8aa0370005a81a7e26ae7c86585626d3261aa4d3 Mon Sep 17 00:00:00 2001 From: Sunny He Date: Wed, 26 Jul 2017 11:14:21 -0700 Subject: gpu: nvgpu: gv11b: Reorg fecs_trace HAL init Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the fecs_trace sub-module of the gpu_ops struct. Perform HAL function assignments in hal_gxxxx.c through the population of a chip-specific copy of gpu_ops. Jira NVGPU-74 Change-Id: I43932a8eac2a9f791e967a8ed736f76350889a51 Signed-off-by: Sunny He Reviewed-on: https://git-master.nvidia.com/r/1527420 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.c | 31 ------------------------------ drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.h | 23 ---------------------- drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 24 +++++++++++++++++++++-- 3 files changed, 22 insertions(+), 56 deletions(-) delete mode 100644 drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.c delete mode 100644 drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.h (limited to 'drivers/gpu/nvgpu/gv11b') diff --git a/drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.c b/drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.c deleted file mode 100644 index 92357980..00000000 --- a/drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * GV11B GPU FECS traces - * - * Copyright (c) 2016, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#include "gp10b/fecs_trace_gp10b.h" - -#include "gv11b/fecs_trace_gv11b.h" - -#ifdef CONFIG_GK20A_CTXSW_TRACE -int gv11b_init_fecs_trace_ops(struct gpu_ops *ops) -{ - gp10b_init_fecs_trace_ops(ops); - return 0; -} -#else -int gv11b_init_fecs_trace_ops(struct gpu_ops *ops) -{ - return 0; -} -#endif /* CONFIG_GK20A_CTXSW_TRACE */ diff --git a/drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.h b/drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.h deleted file mode 100644 index 607d715b..00000000 --- a/drivers/gpu/nvgpu/gv11b/fecs_trace_gv11b.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * GV11B GPU FECS traces - * - * Copyright (c) 2016, 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, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#ifndef _NVGPU_FECS_TRACE_GV11B_H_ -#define _NVGPU_FECS_TRACE_GV11B_H_ - -struct gpu_ops; - -int gv11b_init_fecs_trace_ops(struct gpu_ops *); - -#endif diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index f5191da7..04712409 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c @@ -21,6 +21,8 @@ #include "gk20a/gk20a.h" #include "gk20a/fifo_gk20a.h" +#include "gk20a/ctxsw_trace_gk20a.h" +#include "gk20a/fecs_trace_gk20a.h" #include "gk20a/css_gr_gk20a.h" #include "gk20a/mc_gk20a.h" #include "gk20a/dbg_gpu_gk20a.h" @@ -37,12 +39,12 @@ #include "gp10b/ce_gp10b.h" #include "gp10b/priv_ring_gp10b.h" #include "gp10b/fifo_gp10b.h" +#include "gp10b/fecs_trace_gp10b.h" #include "hal_gv11b.h" #include "gr_gv11b.h" #include "mc_gv11b.h" #include "ltc_gv11b.h" -#include "fecs_trace_gv11b.h" #include "gv11b.h" #include "ce_gv11b.h" #include "gr_ctx_gv11b.h" @@ -286,6 +288,24 @@ static const struct gpu_ops gv11b_ops = { .get_netlist_name = gr_gv11b_get_netlist_name, .is_fw_defined = gr_gv11b_is_firmware_defined, }, +#ifdef CONFIG_GK20A_CTXSW_TRACE + .fecs_trace = { + .alloc_user_buffer = gk20a_ctxsw_dev_ring_alloc, + .free_user_buffer = gk20a_ctxsw_dev_ring_free, + .mmap_user_buffer = gk20a_ctxsw_dev_mmap_buffer, + .init = gk20a_fecs_trace_init, + .deinit = gk20a_fecs_trace_deinit, + .enable = gk20a_fecs_trace_enable, + .disable = gk20a_fecs_trace_disable, + .is_enabled = gk20a_fecs_trace_is_enabled, + .reset = gk20a_fecs_trace_reset, + .flush = gp10b_fecs_trace_flush, + .poll = gk20a_fecs_trace_poll, + .bind_channel = gk20a_fecs_trace_bind_channel, + .unbind_channel = gk20a_fecs_trace_unbind_channel, + .max_entries = gk20a_gr_max_entries, + }, +#endif /* CONFIG_GK20A_CTXSW_TRACE */ .mc = { .intr_enable = mc_gv11b_intr_enable, .intr_unit_config = mc_gp10b_intr_unit_config, @@ -354,6 +374,7 @@ int gv11b_init_hal(struct gk20a *g) gops->clock_gating = gv11b_ops.clock_gating; gops->fifo = gv11b_ops.fifo; gops->gr_ctx = gv11b_ops.gr_ctx; + gops->fecs_trace = gv11b_ops.fecs_trace; gops->mc = gv11b_ops.mc; gops->debug = gv11b_ops.debug; gops->dbg_session_ops = gv11b_ops.dbg_session_ops; @@ -375,7 +396,6 @@ int gv11b_init_hal(struct gk20a *g) __nvgpu_set_enabled(g, NVGPU_SEC_SECUREGPCCS, false); gv11b_init_gr(g); - gv11b_init_fecs_trace_ops(gops); gv11b_init_fb(gops); gv11b_init_mm(gops); gv11b_init_pmu_ops(g); -- cgit v1.2.2