diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index d0cf7f9b2..fa883fdac 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile @@ -238,10 +238,10 @@ nvgpu-y += \ common/fifo/tsg.o \ common/ecc.o \ common/ce2.o \ + common/debugger.o \ gk20a/gk20a.o \ gk20a/ce2_gk20a.o \ gk20a/fifo_gk20a.o \ - gk20a/dbg_gpu_gk20a.o \ gk20a/regops_gk20a.o \ gk20a/gr_gk20a.o \ gk20a/mm_gk20a.o \ diff --git a/drivers/gpu/nvgpu/Makefile.sources b/drivers/gpu/nvgpu/Makefile.sources index 652c4af19..c4acab398 100644 --- a/drivers/gpu/nvgpu/Makefile.sources +++ b/drivers/gpu/nvgpu/Makefile.sources @@ -95,6 +95,7 @@ srcs := os/posix/nvgpu.c \ common/io_common.c \ common/ecc.c \ common/ce2.c \ + common/debugger.c \ common/vbios/bios.c \ common/falcon/falcon.c \ common/falcon/falcon_queue.c \ @@ -156,7 +157,6 @@ srcs := os/posix/nvgpu.c \ common/ptimer/ptimer_gk20a.c \ gk20a/ce2_gk20a.c \ gk20a/fifo_gk20a.c \ - gk20a/dbg_gpu_gk20a.c \ gk20a/regops_gk20a.c \ gk20a/gr_gk20a.c \ gk20a/mm_gk20a.c \ diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/common/debugger.c similarity index 95% rename from drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c rename to drivers/gpu/nvgpu/common/debugger.c index 3e09df61b..3bbd43e0a 100644 --- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c +++ b/drivers/gpu/nvgpu/common/debugger.c @@ -32,11 +32,10 @@ #include #include #include +#include +#include -#include "gk20a.h" -#include "gr_gk20a.h" -#include "dbg_gpu_gk20a.h" -#include "regops_gk20a.h" +#include "gk20a/gr_gk20a.h" /* * API to get first channel from the list of all channels @@ -65,7 +64,7 @@ nvgpu_dbg_gpu_get_session_channel(struct dbg_session_gk20a *dbg_s) return ch; } -void gk20a_dbg_gpu_post_events(struct channel_gk20a *ch) +void nvgpu_dbg_gpu_post_events(struct channel_gk20a *ch) { struct dbg_session_data *session_data; struct dbg_session_gk20a *dbg_s; @@ -94,7 +93,7 @@ void gk20a_dbg_gpu_post_events(struct channel_gk20a *ch) nvgpu_mutex_release(&ch->dbg_s_lock); } -bool gk20a_dbg_gpu_broadcast_stop_trigger(struct channel_gk20a *ch) +bool nvgpu_dbg_gpu_broadcast_stop_trigger(struct channel_gk20a *ch) { struct dbg_session_data *session_data; struct dbg_session_gk20a *dbg_s; @@ -122,7 +121,7 @@ bool gk20a_dbg_gpu_broadcast_stop_trigger(struct channel_gk20a *ch) return broadcast; } -int gk20a_dbg_gpu_clear_broadcast_stop_trigger(struct channel_gk20a *ch) +int nvgpu_dbg_gpu_clear_broadcast_stop_trigger(struct channel_gk20a *ch) { struct dbg_session_data *session_data; struct dbg_session_gk20a *dbg_s; @@ -164,7 +163,7 @@ u32 nvgpu_set_powergate_locked(struct dbg_session_gk20a *dbg_s, * the global pg disabled refcount is zero */ if (g->dbg_powergating_disabled_refcount == 0) { - err = g->ops.dbg_session_ops.dbg_set_powergate(dbg_s, + err = g->ops.debugger.dbg_set_powergate(dbg_s, mode); } @@ -178,7 +177,7 @@ u32 nvgpu_set_powergate_locked(struct dbg_session_gk20a *dbg_s, return err; } -int dbg_set_powergate(struct dbg_session_gk20a *dbg_s, bool disable_powergate) +int nvgpu_dbg_set_powergate(struct dbg_session_gk20a *dbg_s, bool disable_powergate) { int err = 0; struct gk20a *g = dbg_s->g; diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c index 86d3569f7..c76aae9ea 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -47,7 +48,6 @@ #include #include -#include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/fence_gk20a.h" static void free_channel(struct fifo_gk20a *f, struct channel_gk20a *c); diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index b3d51bf16..a46d09e6c 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -45,7 +45,6 @@ #include "gk20a.h" #include "gk20a/ce2_gk20a.h" -#include "dbg_gpu_gk20a.h" #include "pstate/pstate.h" void __nvgpu_check_gpu_state(struct gk20a *g) diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index fba878d49..ea9f15413 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -50,7 +51,6 @@ #include "gr_ctx_gk20a.h" #include "gr_pri_gk20a.h" #include "regops_gk20a.h" -#include "dbg_gpu_gk20a.h" #include #include diff --git a/drivers/gpu/nvgpu/gk20a/regops_gk20a.c b/drivers/gpu/nvgpu/gk20a/regops_gk20a.c index 512edf31f..34783e7f5 100644 --- a/drivers/gpu/nvgpu/gk20a/regops_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/regops_gk20a.c @@ -24,9 +24,9 @@ #include "gk20a.h" #include "gr_gk20a.h" -#include "dbg_gpu_gk20a.h" #include "regops_gk20a.h" +#include #include #include #include diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c index 6837faffd..a4227bfdc 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -46,7 +47,6 @@ #include "common/perf/perf_gm20b.h" #include "gk20a/ce2_gk20a.h" -#include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/fifo_gk20a.h" #include "gk20a/mm_gk20a.h" #include "gk20a/flcn_gk20a.h" @@ -604,10 +604,8 @@ static const struct gpu_ops gm20b_ops = { .show_dump = gk20a_debug_show_dump, }, .debugger = { - .post_events = gk20a_dbg_gpu_post_events, - }, - .dbg_session_ops = { - .dbg_set_powergate = dbg_set_powergate, + .post_events = nvgpu_dbg_gpu_post_events, + .dbg_set_powergate = nvgpu_dbg_set_powergate, .check_and_set_global_reservation = nvgpu_check_and_set_global_reservation, .check_and_set_context_reservation = @@ -710,7 +708,6 @@ int gm20b_init_hal(struct gk20a *g) gops->regops = gm20b_ops.regops; gops->mc = gm20b_ops.mc; - gops->dbg_session_ops = gm20b_ops.dbg_session_ops; gops->perf = gm20b_ops.perf; gops->perfbuf = gm20b_ops.perfbuf; gops->debug = gm20b_ops.debug; diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index 46af94368..2f93a4a36 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c @@ -47,7 +47,6 @@ #include "gk20a/fifo_gk20a.h" #include "gk20a/fecs_trace_gk20a.h" #include "gk20a/mm_gk20a.h" -#include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/flcn_gk20a.h" #include "gk20a/regops_gk20a.h" #include "gk20a/pmu_gk20a.h" @@ -95,6 +94,7 @@ #include #include #include +#include #include #include #include @@ -732,10 +732,8 @@ static const struct gpu_ops gp106_ops = { .show_dump = gk20a_debug_show_dump, }, .debugger = { - .post_events = gk20a_dbg_gpu_post_events, - }, - .dbg_session_ops = { - .dbg_set_powergate = dbg_set_powergate, + .post_events = nvgpu_dbg_gpu_post_events, + .dbg_set_powergate = nvgpu_dbg_set_powergate, .check_and_set_global_reservation = nvgpu_check_and_set_global_reservation, .check_and_set_context_reservation = @@ -873,7 +871,6 @@ int gp106_init_hal(struct gk20a *g) gops->mc = gp106_ops.mc; gops->debug = gp106_ops.debug; gops->debugger = gp106_ops.debugger; - gops->dbg_session_ops = gp106_ops.dbg_session_ops; gops->perf = gp106_ops.perf; gops->perfbuf = gp106_ops.perfbuf; gops->bus = gp106_ops.bus; diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index 9bc439b7c..356be6db4 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -36,7 +37,6 @@ #include #include "gk20a/gr_gk20a.h" -#include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/regops_gk20a.h" #include "gm20b/gr_gm20b.h" @@ -1893,13 +1893,13 @@ int gr_gp10b_pre_process_sm_exception(struct gk20a *g, "CILP: starting wait for LOCKED_DOWN on gpc %d tpc %d\n", gpc, tpc); - if (gk20a_dbg_gpu_broadcast_stop_trigger(fault_ch)) { + if (nvgpu_dbg_gpu_broadcast_stop_trigger(fault_ch)) { nvgpu_log(g, gpu_dbg_fn | gpu_dbg_gpu_dbg, "CILP: Broadcasting STOP_TRIGGER from gpc %d tpc %d\n", gpc, tpc); g->ops.gr.suspend_all_sms(g, global_mask, false); - gk20a_dbg_gpu_clear_broadcast_stop_trigger(fault_ch); + nvgpu_dbg_gpu_clear_broadcast_stop_trigger(fault_ch); } else { nvgpu_log(g, gpu_dbg_fn | gpu_dbg_gpu_dbg, "CILP: STOP_TRIGGER from gpc %d tpc %d\n", diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c index 5887d4006..3f2d27754 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -55,7 +56,6 @@ #include "gk20a/fifo_gk20a.h" #include "gk20a/fecs_trace_gk20a.h" #include "gk20a/mm_gk20a.h" -#include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/flcn_gk20a.h" #include "gk20a/regops_gk20a.h" #include "gk20a/pmu_gk20a.h" @@ -666,10 +666,8 @@ static const struct gpu_ops gp10b_ops = { .show_dump = gk20a_debug_show_dump, }, .debugger = { - .post_events = gk20a_dbg_gpu_post_events, - }, - .dbg_session_ops = { - .dbg_set_powergate = dbg_set_powergate, + .post_events = nvgpu_dbg_gpu_post_events, + .dbg_set_powergate = nvgpu_dbg_set_powergate, .check_and_set_global_reservation = nvgpu_check_and_set_global_reservation, .check_and_set_context_reservation = @@ -771,7 +769,6 @@ int gp10b_init_hal(struct gk20a *g) gops->mc = gp10b_ops.mc; gops->debug = gp10b_ops.debug; gops->debugger = gp10b_ops.debugger; - gops->dbg_session_ops = gp10b_ops.dbg_session_ops; gops->perf = gp10b_ops.perf; gops->perfbuf = gp10b_ops.perfbuf; gops->bus = gp10b_ops.bus; diff --git a/drivers/gpu/nvgpu/gv100/hal_gv100.c b/drivers/gpu/nvgpu/gv100/hal_gv100.c index 8b996e490..5bb1a067a 100644 --- a/drivers/gpu/nvgpu/gv100/hal_gv100.c +++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c @@ -54,7 +54,6 @@ #include "gk20a/fifo_gk20a.h" #include "gk20a/fecs_trace_gk20a.h" -#include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/flcn_gk20a.h" #include "gk20a/regops_gk20a.h" #include "gk20a/mm_gk20a.h" @@ -113,6 +112,7 @@ #include #include #include +#include #include #include #include @@ -849,10 +849,8 @@ static const struct gpu_ops gv100_ops = { .show_dump = gk20a_debug_show_dump, }, .debugger = { - .post_events = gk20a_dbg_gpu_post_events, - }, - .dbg_session_ops = { - .dbg_set_powergate = dbg_set_powergate, + .post_events = nvgpu_dbg_gpu_post_events, + .dbg_set_powergate = nvgpu_dbg_set_powergate, .check_and_set_global_reservation = nvgpu_check_and_set_global_reservation, .check_and_set_context_reservation = @@ -1007,7 +1005,6 @@ int gv100_init_hal(struct gk20a *g) gops->mc = gv100_ops.mc; gops->debug = gv100_ops.debug; gops->debugger = gv100_ops.debugger; - gops->dbg_session_ops = gv100_ops.dbg_session_ops; gops->perf = gv100_ops.perf; gops->perfbuf = gv100_ops.perfbuf; gops->bus = gv100_ops.bus; diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c index e266f571e..55bfa7e7a 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -39,7 +40,6 @@ #include #include "gk20a/gr_gk20a.h" -#include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/regops_gk20a.h" #include "gk20a/gr_pri_gk20a.h" @@ -2409,7 +2409,7 @@ int gr_gv11b_pre_process_sm_exception(struct gk20a *g, "gpc %d tpc %d sm %d", gpc, tpc, sm); - if (gk20a_dbg_gpu_broadcast_stop_trigger(fault_ch)) { + if (nvgpu_dbg_gpu_broadcast_stop_trigger(fault_ch)) { nvgpu_log(g, gpu_dbg_fn | gpu_dbg_gpu_dbg, "CILP: Broadcasting STOP_TRIGGER from " "gpc %d tpc %d sm %d", @@ -2417,7 +2417,7 @@ int gr_gv11b_pre_process_sm_exception(struct gk20a *g, g->ops.gr.suspend_all_sms(g, global_mask, false); - gk20a_dbg_gpu_clear_broadcast_stop_trigger(fault_ch); + nvgpu_dbg_gpu_clear_broadcast_stop_trigger(fault_ch); } else { nvgpu_log(g, gpu_dbg_fn | gpu_dbg_gpu_dbg, "CILP: STOP_TRIGGER from " diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index f91e16baf..3613f529b 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c @@ -49,7 +49,6 @@ #include "gk20a/fifo_gk20a.h" #include "gk20a/fecs_trace_gk20a.h" #include "gk20a/mm_gk20a.h" -#include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/flcn_gk20a.h" #include "gk20a/regops_gk20a.h" #include "gk20a/pmu_gk20a.h" @@ -93,6 +92,7 @@ #include #include #include +#include #include #include #include @@ -790,10 +790,8 @@ static const struct gpu_ops gv11b_ops = { .show_dump = gk20a_debug_show_dump, }, .debugger = { - .post_events = gk20a_dbg_gpu_post_events, - }, - .dbg_session_ops = { - .dbg_set_powergate = dbg_set_powergate, + .post_events = nvgpu_dbg_gpu_post_events, + .dbg_set_powergate = nvgpu_dbg_set_powergate, .check_and_set_global_reservation = nvgpu_check_and_set_global_reservation, .check_and_set_context_reservation = @@ -893,7 +891,6 @@ int gv11b_init_hal(struct gk20a *g) gops->mc = gv11b_ops.mc; gops->debug = gv11b_ops.debug; gops->debugger = gv11b_ops.debugger; - gops->dbg_session_ops = gv11b_ops.dbg_session_ops; gops->perf = gv11b_ops.perf; gops->perfbuf = gv11b_ops.perfbuf; gops->bus = gv11b_ops.bus; diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/debugger.h similarity index 92% rename from drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.h rename to drivers/gpu/nvgpu/include/nvgpu/debugger.h index 6d04aea19..76c6667ff 100644 --- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/debugger.h @@ -21,8 +21,8 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ -#ifndef DBG_GPU_H -#define DBG_GPU_H +#ifndef NVGPU_DEBUGGER_H +#define NVGPU_DEBUGGER_H #include #include @@ -32,9 +32,6 @@ struct gk20a; struct channel_gk20a; struct dbg_session_gk20a; -/* used by the interrupt handler to post events */ -void gk20a_dbg_gpu_post_events(struct channel_gk20a *fault_ch); - struct channel_gk20a * nvgpu_dbg_gpu_get_session_channel(struct dbg_session_gk20a *dbg_s); @@ -117,10 +114,13 @@ dbg_profiler_object_data_from_prof_obj_entry(struct nvgpu_list_node *node) ((uintptr_t)node - offsetof(struct dbg_profiler_object_data, prof_obj_entry)); }; -bool gk20a_dbg_gpu_broadcast_stop_trigger(struct channel_gk20a *ch); -int gk20a_dbg_gpu_clear_broadcast_stop_trigger(struct channel_gk20a *ch); +/* used by the interrupt handler to post events */ +void nvgpu_dbg_gpu_post_events(struct channel_gk20a *fault_ch); -int dbg_set_powergate(struct dbg_session_gk20a *dbg_s, bool disable_powergate); +bool nvgpu_dbg_gpu_broadcast_stop_trigger(struct channel_gk20a *ch); +int nvgpu_dbg_gpu_clear_broadcast_stop_trigger(struct channel_gk20a *ch); + +int nvgpu_dbg_set_powergate(struct dbg_session_gk20a *dbg_s, bool disable_powergate); bool nvgpu_check_and_set_global_reservation( struct dbg_session_gk20a *dbg_s, struct dbg_profiler_object_data *prof_obj); @@ -142,4 +142,4 @@ u32 nvgpu_set_powergate_locked(struct dbg_session_gk20a *dbg_s, /* This mode says that the pms in Mode-E (stream out) are to be context switched. */ #define NVGPU_DBG_HWPM_CTXSW_MODE_STREAM_OUT_CTXSW (0x00000002) -#endif /* DBG_GPU_GK20A_H */ +#endif /* NVGPU_DEBUGGER_H */ diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h index 4a9adb8a9..aaed89f73 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h @@ -626,9 +626,6 @@ struct gpu_ops { void (*blcg_xbar_load_gating_prod)(struct gk20a *g, bool prod); void (*pg_gr_load_gating_prod)(struct gk20a *g, bool prod); } clock_gating; - struct { - void (*post_events)(struct channel_gk20a *ch); - } debugger; struct { int (*setup_sw)(struct gk20a *g); int (*init_fifo_setup_hw)(struct gk20a *g); @@ -1195,6 +1192,7 @@ struct gpu_ops { struct gk20a_debug_output *o); } debug; struct { + void (*post_events)(struct channel_gk20a *ch); int (*dbg_set_powergate)(struct dbg_session_gk20a *dbg_s, bool disable_powergate); bool (*check_and_set_global_reservation)( @@ -1206,7 +1204,7 @@ struct gpu_ops { void (*release_profiler_reservation)( struct dbg_session_gk20a *dbg_s, struct dbg_profiler_object_data *prof_obj); - } dbg_session_ops; + } debugger; struct { void (*enable_membuf)(struct gk20a *g, u32 size, u64 buf_addr, struct nvgpu_mem *inst_block); diff --git a/drivers/gpu/nvgpu/os/linux/ioctl.c b/drivers/gpu/nvgpu/os/linux/ioctl.c index 562500a64..849d35cac 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl.c @@ -22,8 +22,6 @@ #include #include -#include "gk20a/dbg_gpu_gk20a.h" - #include "ioctl_channel.h" #include "ioctl_ctrl.h" #include "ioctl_as.h" diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_channel.c b/drivers/gpu/nvgpu/os/linux/ioctl_channel.c index 8957237fe..74a037079 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_channel.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_channel.c @@ -38,7 +38,6 @@ #include #include -#include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/fence_gk20a.h" #include "platform_gk20a.h" diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c index 6dc33388f..96ee35b7c 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -38,7 +39,6 @@ #include "gk20a/gr_gk20a.h" #include "gk20a/regops_gk20a.h" -#include "gk20a/dbg_gpu_gk20a.h" #include "os_linux.h" #include "platform_gk20a.h" #include "ioctl_dbg.h" @@ -214,7 +214,7 @@ int gk20a_dbg_gpu_dev_release(struct inode *inode, struct file *filp) dbg_profiler_object_data, prof_obj_entry) { if (prof_obj->session_id == dbg_s->id) { if (prof_obj->has_reservation) - g->ops.dbg_session_ops. + g->ops.debugger. release_profiler_reservation(dbg_s, prof_obj); nvgpu_list_del(&prof_obj->prof_obj_entry); nvgpu_kfree(g, prof_obj); @@ -469,7 +469,7 @@ static int dbg_unbind_single_channel_gk20a(struct dbg_session_gk20a *dbg_s, if ((prof_obj->session_id == dbg_s->id) && (prof_obj->ch->chid == chid)) { if (prof_obj->has_reservation) { - g->ops.dbg_session_ops. + g->ops.debugger. release_profiler_reservation(dbg_s, prof_obj); } nvgpu_list_del(&prof_obj->prof_obj_entry); @@ -1189,7 +1189,7 @@ static int nvgpu_ioctl_free_profiler_object( break; } if (prof_obj->has_reservation) - g->ops.dbg_session_ops. + g->ops.debugger. release_profiler_reservation(dbg_s, prof_obj); nvgpu_list_del(&prof_obj->prof_obj_entry); nvgpu_kfree(g, prof_obj); @@ -1645,7 +1645,7 @@ static int nvgpu_profiler_reserve_release(struct dbg_session_gk20a *dbg_s, } if (prof_obj->has_reservation) - g->ops.dbg_session_ops.release_profiler_reservation(dbg_s, prof_obj); + g->ops.debugger.release_profiler_reservation(dbg_s, prof_obj); else { nvgpu_err(g, "No reservation found"); err = -EINVAL; @@ -1691,7 +1691,7 @@ static int nvgpu_profiler_reserve_acquire(struct dbg_session_gk20a *dbg_s, /* Global reservations are only allowed if there are no other * global or per-context reservations currently held */ - if (!g->ops.dbg_session_ops.check_and_set_global_reservation( + if (!g->ops.debugger.check_and_set_global_reservation( dbg_s, my_prof_obj)) { nvgpu_err(g, "global reserve: have existing reservation"); @@ -1721,7 +1721,7 @@ static int nvgpu_profiler_reserve_acquire(struct dbg_session_gk20a *dbg_s, } } - if (!g->ops.dbg_session_ops.check_and_set_context_reservation( + if (!g->ops.debugger.check_and_set_context_reservation( dbg_s, my_prof_obj)) { /* Another guest OS has the global reservation */ nvgpu_err(g, @@ -1745,7 +1745,7 @@ static int nvgpu_profiler_reserve_acquire(struct dbg_session_gk20a *dbg_s, } } - if (!g->ops.dbg_session_ops.check_and_set_context_reservation( + if (!g->ops.debugger.check_and_set_context_reservation( dbg_s, my_prof_obj)) { /* Another guest OS has the global reservation */ nvgpu_err(g, diff --git a/drivers/gpu/nvgpu/os/posix/stubs.c b/drivers/gpu/nvgpu/os/posix/stubs.c index 279f4daa4..348910340 100644 --- a/drivers/gpu/nvgpu/os/posix/stubs.c +++ b/drivers/gpu/nvgpu/os/posix/stubs.c @@ -27,8 +27,8 @@ #include #include +#include -#include "gk20a/dbg_gpu_gk20a.h" void nvgpu_dbg_session_post_event(struct dbg_session_gk20a *dbg_s) { diff --git a/drivers/gpu/nvgpu/tu104/hal_tu104.c b/drivers/gpu/nvgpu/tu104/hal_tu104.c index 94230a1ba..6849e947c 100644 --- a/drivers/gpu/nvgpu/tu104/hal_tu104.c +++ b/drivers/gpu/nvgpu/tu104/hal_tu104.c @@ -58,7 +58,6 @@ #include "gk20a/gk20a.h" #include "gk20a/fifo_gk20a.h" #include "gk20a/fecs_trace_gk20a.h" -#include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/flcn_gk20a.h" #include "gk20a/regops_gk20a.h" #include "gk20a/mm_gk20a.h" @@ -126,6 +125,7 @@ #include #include #include +#include #include #include #include @@ -826,10 +826,8 @@ static const struct gpu_ops tu104_ops = { .show_dump = gk20a_debug_show_dump, }, .debugger = { - .post_events = gk20a_dbg_gpu_post_events, - }, - .dbg_session_ops = { - .dbg_set_powergate = dbg_set_powergate, + .post_events = nvgpu_dbg_gpu_post_events, + .dbg_set_powergate = nvgpu_dbg_set_powergate, .check_and_set_global_reservation = nvgpu_check_and_set_global_reservation, .check_and_set_context_reservation = @@ -979,7 +977,6 @@ int tu104_init_hal(struct gk20a *g) gops->mc = tu104_ops.mc; gops->debug = tu104_ops.debug; gops->debugger = tu104_ops.debugger; - gops->dbg_session_ops = tu104_ops.dbg_session_ops; gops->perf = tu104_ops.perf; gops->perfbuf = tu104_ops.perfbuf; gops->bus = tu104_ops.bus; diff --git a/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c b/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c index ca8d2872f..13bc72ff9 100644 --- a/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c @@ -23,11 +23,11 @@ #include #include #include +#include #include #include #include "gk20a/gk20a.h" -#include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/regops_gk20a.h" #include "dbg_vgpu.h" diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c index f1a3c8713..88cef12c4 100644 --- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c +++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c @@ -49,7 +49,6 @@ #include "vgpu_fuse_gp10b.h" #include "gk20a/flcn_gk20a.h" -#include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/pmu_gk20a.h" #include "gp10b/mm_gp10b.h" @@ -67,6 +66,7 @@ #include "gm20b/pmu_gm20b.h" #include "gm20b/mm_gm20b.h" +#include #include #include #include @@ -503,9 +503,7 @@ static const struct gpu_ops vgpu_gp10b_ops = { .show_dump = NULL, }, .debugger = { - .post_events = gk20a_dbg_gpu_post_events, - }, - .dbg_session_ops = { + .post_events = nvgpu_dbg_gpu_post_events, .dbg_set_powergate = vgpu_dbg_set_powergate, .check_and_set_global_reservation = vgpu_check_and_set_global_reservation, @@ -596,7 +594,6 @@ int vgpu_gp10b_init_hal(struct gk20a *g) gops->mc = vgpu_gp10b_ops.mc; gops->debug = vgpu_gp10b_ops.debug; gops->debugger = vgpu_gp10b_ops.debugger; - gops->dbg_session_ops = vgpu_gp10b_ops.dbg_session_ops; gops->perfbuf = vgpu_gp10b_ops.perfbuf; gops->bus = vgpu_gp10b_ops.bus; gops->ptimer = vgpu_gp10b_ops.ptimer; diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c index 9fafa52f7..7213c18de 100644 --- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,6 @@ #include "gr_vgpu.h" #include "gk20a/gk20a.h" -#include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/fecs_trace_gk20a.h" #include diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c index b9cf88d66..e373a6a71 100644 --- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c +++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c @@ -54,7 +54,6 @@ #include "vgpu/gp10b/vgpu_gr_gp10b.h" #include -#include "gk20a/dbg_gpu_gk20a.h" #include #include @@ -84,6 +83,7 @@ #include +#include #include #include @@ -575,9 +575,7 @@ static const struct gpu_ops vgpu_gv11b_ops = { .show_dump = NULL, }, .debugger = { - .post_events = gk20a_dbg_gpu_post_events, - }, - .dbg_session_ops = { + .post_events = nvgpu_dbg_gpu_post_events, .dbg_set_powergate = vgpu_dbg_set_powergate, .check_and_set_global_reservation = vgpu_check_and_set_global_reservation, @@ -663,7 +661,6 @@ int vgpu_gv11b_init_hal(struct gk20a *g) gops->mc = vgpu_gv11b_ops.mc; gops->debug = vgpu_gv11b_ops.debug; gops->debugger = vgpu_gv11b_ops.debugger; - gops->dbg_session_ops = vgpu_gv11b_ops.dbg_session_ops; gops->perfbuf = vgpu_gv11b_ops.perfbuf; gops->bus = vgpu_gv11b_ops.bus; gops->ptimer = vgpu_gv11b_ops.ptimer;