From 57fb527a7e33384341fc18f1f918d5a8225057f5 Mon Sep 17 00:00:00 2001 From: Peter Daifuku Date: Fri, 6 Oct 2017 16:27:14 -0700 Subject: gpu: nvgpu: vgpu: flatten out vgpu hal Instead of calling the native HAL init function then adding multiple layers of modification for VGPU, flatten out the sequence so that all entry points are set statically and visible in a single file. JIRA ESRM-30 Change-Id: Ie424abb48bce5038874851d399baac5e4bb7d27c Signed-off-by: Peter Daifuku Reviewed-on: https://git-master.nvidia.com/r/1574616 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/vgpu/dbg_vgpu.c | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'drivers/gpu/nvgpu/vgpu/dbg_vgpu.c') diff --git a/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c b/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c index 416b8903..6e8ab561 100644 --- a/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c @@ -27,10 +27,11 @@ #include "gk20a/channel_gk20a.h" #include "gk20a/dbg_gpu_gk20a.h" #include "vgpu.h" +#include "dbg_vgpu.h" #include -static int vgpu_exec_regops(struct dbg_session_gk20a *dbg_s, +int vgpu_exec_regops(struct dbg_session_gk20a *dbg_s, struct nvgpu_dbg_gpu_reg_op *ops, u64 num_ops) { @@ -76,7 +77,7 @@ fail: return err; } -static int vgpu_dbg_set_powergate(struct dbg_session_gk20a *dbg_s, __u32 mode) +int vgpu_dbg_set_powergate(struct dbg_session_gk20a *dbg_s, __u32 mode) { struct tegra_vgpu_cmd_msg msg; struct tegra_vgpu_set_powergate_params *p = &msg.params.set_powergate; @@ -124,7 +125,7 @@ static int vgpu_sendrecv_prof_cmd(struct dbg_session_gk20a *dbg_s, u32 mode) return err; } -static bool vgpu_check_and_set_global_reservation( +bool vgpu_check_and_set_global_reservation( struct dbg_session_gk20a *dbg_s, struct dbg_profiler_object_data *prof_obj) { @@ -144,7 +145,7 @@ static bool vgpu_check_and_set_global_reservation( return false; } -static bool vgpu_check_and_set_context_reservation( +bool vgpu_check_and_set_context_reservation( struct dbg_session_gk20a *dbg_s, struct dbg_profiler_object_data *prof_obj) { @@ -167,7 +168,7 @@ static bool vgpu_check_and_set_context_reservation( return false; } -static void vgpu_release_profiler_reservation( +void vgpu_release_profiler_reservation( struct dbg_session_gk20a *dbg_s, struct dbg_profiler_object_data *prof_obj) { @@ -205,26 +206,12 @@ static int vgpu_sendrecv_perfbuf_cmd(struct gk20a *g, u64 offset, u32 size) return err; } -static int vgpu_perfbuffer_enable(struct gk20a *g, u64 offset, u32 size) +int vgpu_perfbuffer_enable(struct gk20a *g, u64 offset, u32 size) { return vgpu_sendrecv_perfbuf_cmd(g, offset, size); } -static int vgpu_perfbuffer_disable(struct gk20a *g) +int vgpu_perfbuffer_disable(struct gk20a *g) { return vgpu_sendrecv_perfbuf_cmd(g, 0, 0); } - -void vgpu_init_dbg_session_ops(struct gpu_ops *gops) -{ - gops->dbg_session_ops.exec_reg_ops = vgpu_exec_regops; - gops->dbg_session_ops.dbg_set_powergate = vgpu_dbg_set_powergate; - gops->dbg_session_ops.check_and_set_global_reservation = - vgpu_check_and_set_global_reservation; - gops->dbg_session_ops.check_and_set_context_reservation = - vgpu_check_and_set_context_reservation; - gops->dbg_session_ops.release_profiler_reservation = - vgpu_release_profiler_reservation; - gops->dbg_session_ops.perfbuffer_enable = vgpu_perfbuffer_enable; - gops->dbg_session_ops.perfbuffer_disable = vgpu_perfbuffer_disable; -} -- cgit v1.2.2