diff options
author | Peter Daifuku <pdaifuku@nvidia.com> | 2017-10-06 19:27:14 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-10-13 18:20:18 -0400 |
commit | 57fb527a7e33384341fc18f1f918d5a8225057f5 (patch) | |
tree | 23bb49f879ac495834237c99564f0589d637f07e /drivers/gpu/nvgpu/vgpu/dbg_vgpu.c | |
parent | 3d343c9eeaa3415851d1c71b8815eb7dc2677b5a (diff) |
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 <pdaifuku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1574616
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/dbg_vgpu.c')
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/dbg_vgpu.c | 29 |
1 files changed, 8 insertions, 21 deletions
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 @@ | |||
27 | #include "gk20a/channel_gk20a.h" | 27 | #include "gk20a/channel_gk20a.h" |
28 | #include "gk20a/dbg_gpu_gk20a.h" | 28 | #include "gk20a/dbg_gpu_gk20a.h" |
29 | #include "vgpu.h" | 29 | #include "vgpu.h" |
30 | #include "dbg_vgpu.h" | ||
30 | 31 | ||
31 | #include <nvgpu/bug.h> | 32 | #include <nvgpu/bug.h> |
32 | 33 | ||
33 | static int vgpu_exec_regops(struct dbg_session_gk20a *dbg_s, | 34 | int vgpu_exec_regops(struct dbg_session_gk20a *dbg_s, |
34 | struct nvgpu_dbg_gpu_reg_op *ops, | 35 | struct nvgpu_dbg_gpu_reg_op *ops, |
35 | u64 num_ops) | 36 | u64 num_ops) |
36 | { | 37 | { |
@@ -76,7 +77,7 @@ fail: | |||
76 | return err; | 77 | return err; |
77 | } | 78 | } |
78 | 79 | ||
79 | static int vgpu_dbg_set_powergate(struct dbg_session_gk20a *dbg_s, __u32 mode) | 80 | int vgpu_dbg_set_powergate(struct dbg_session_gk20a *dbg_s, __u32 mode) |
80 | { | 81 | { |
81 | struct tegra_vgpu_cmd_msg msg; | 82 | struct tegra_vgpu_cmd_msg msg; |
82 | struct tegra_vgpu_set_powergate_params *p = &msg.params.set_powergate; | 83 | 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) | |||
124 | return err; | 125 | return err; |
125 | } | 126 | } |
126 | 127 | ||
127 | static bool vgpu_check_and_set_global_reservation( | 128 | bool vgpu_check_and_set_global_reservation( |
128 | struct dbg_session_gk20a *dbg_s, | 129 | struct dbg_session_gk20a *dbg_s, |
129 | struct dbg_profiler_object_data *prof_obj) | 130 | struct dbg_profiler_object_data *prof_obj) |
130 | { | 131 | { |
@@ -144,7 +145,7 @@ static bool vgpu_check_and_set_global_reservation( | |||
144 | return false; | 145 | return false; |
145 | } | 146 | } |
146 | 147 | ||
147 | static bool vgpu_check_and_set_context_reservation( | 148 | bool vgpu_check_and_set_context_reservation( |
148 | struct dbg_session_gk20a *dbg_s, | 149 | struct dbg_session_gk20a *dbg_s, |
149 | struct dbg_profiler_object_data *prof_obj) | 150 | struct dbg_profiler_object_data *prof_obj) |
150 | { | 151 | { |
@@ -167,7 +168,7 @@ static bool vgpu_check_and_set_context_reservation( | |||
167 | return false; | 168 | return false; |
168 | } | 169 | } |
169 | 170 | ||
170 | static void vgpu_release_profiler_reservation( | 171 | void vgpu_release_profiler_reservation( |
171 | struct dbg_session_gk20a *dbg_s, | 172 | struct dbg_session_gk20a *dbg_s, |
172 | struct dbg_profiler_object_data *prof_obj) | 173 | struct dbg_profiler_object_data *prof_obj) |
173 | { | 174 | { |
@@ -205,26 +206,12 @@ static int vgpu_sendrecv_perfbuf_cmd(struct gk20a *g, u64 offset, u32 size) | |||
205 | return err; | 206 | return err; |
206 | } | 207 | } |
207 | 208 | ||
208 | static int vgpu_perfbuffer_enable(struct gk20a *g, u64 offset, u32 size) | 209 | int vgpu_perfbuffer_enable(struct gk20a *g, u64 offset, u32 size) |
209 | { | 210 | { |
210 | return vgpu_sendrecv_perfbuf_cmd(g, offset, size); | 211 | return vgpu_sendrecv_perfbuf_cmd(g, offset, size); |
211 | } | 212 | } |
212 | 213 | ||
213 | static int vgpu_perfbuffer_disable(struct gk20a *g) | 214 | int vgpu_perfbuffer_disable(struct gk20a *g) |
214 | { | 215 | { |
215 | return vgpu_sendrecv_perfbuf_cmd(g, 0, 0); | 216 | return vgpu_sendrecv_perfbuf_cmd(g, 0, 0); |
216 | } | 217 | } |
217 | |||
218 | void vgpu_init_dbg_session_ops(struct gpu_ops *gops) | ||
219 | { | ||
220 | gops->dbg_session_ops.exec_reg_ops = vgpu_exec_regops; | ||
221 | gops->dbg_session_ops.dbg_set_powergate = vgpu_dbg_set_powergate; | ||
222 | gops->dbg_session_ops.check_and_set_global_reservation = | ||
223 | vgpu_check_and_set_global_reservation; | ||
224 | gops->dbg_session_ops.check_and_set_context_reservation = | ||
225 | vgpu_check_and_set_context_reservation; | ||
226 | gops->dbg_session_ops.release_profiler_reservation = | ||
227 | vgpu_release_profiler_reservation; | ||
228 | gops->dbg_session_ops.perfbuffer_enable = vgpu_perfbuffer_enable; | ||
229 | gops->dbg_session_ops.perfbuffer_disable = vgpu_perfbuffer_disable; | ||
230 | } | ||