summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.h
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2016-03-29 05:31:25 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-04-19 11:07:34 -0400
commitdfac8ce70464413c0e3748634c57d49950e71933 (patch)
tree35d17f9d35aadf134bbff98ee41e8d7664f442da /drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.h
parentc651adbeaacf063b856ef8126b74661b54066477 (diff)
gpu: nvgpu: support binding multiple channels to a debug session
We currently bind only one channel to a debug session But some use cases might need multiple channels bound to same debug session Add this support by adding a list of channels to debug session. List structure is implemented as struct dbg_session_channel_data List node dbg_s_list_node is currently defined in struct dbg_session_gk20a. But this is inefficient when we need to add debug session to multiple channels Hence add new reference structure dbg_session_data to store dbg_session pointer and list entry For each NVGPU_DBG_GPU_IOCTL_BIND_CHANNEL call, create two reference structure dbg_session_channel_data for channel and dbg_session_data for debug session and bind them together Define API nvgpu_dbg_gpu_get_session_channel() which will get first channel in the list of debug session Use this API wherever we refer to channel bound to debug session Remove dbg_sessions define in struct gk20a since it is not being used anywhere Add new API NVGPU_DBG_GPU_IOCTL_UNBIND_CHANNEL to support unbinding of channel from debug sesssion Bug 200156699 Change-Id: I3bfa6f9cd5b90e7254a75c7e64ac893739776b7f Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1120331 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.h b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.h
index 0ff6cfb3..d569a6cd 100644
--- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.h
@@ -31,6 +31,9 @@ int gk20a_prof_gpu_dev_open(struct inode *inode, struct file *filp);
31/* used by the interrupt handler to post events */ 31/* used by the interrupt handler to post events */
32void gk20a_dbg_gpu_post_events(struct channel_gk20a *fault_ch); 32void gk20a_dbg_gpu_post_events(struct channel_gk20a *fault_ch);
33 33
34struct channel_gk20a *
35nvgpu_dbg_gpu_get_session_channel(struct dbg_session_gk20a *dbg_s);
36
34struct dbg_gpu_session_ops { 37struct dbg_gpu_session_ops {
35 int (*exec_reg_ops)(struct dbg_session_gk20a *dbg_s, 38 int (*exec_reg_ops)(struct dbg_session_gk20a *dbg_s,
36 struct nvgpu_dbg_gpu_reg_op *ops, 39 struct nvgpu_dbg_gpu_reg_op *ops,
@@ -68,22 +71,37 @@ struct dbg_session_gk20a {
68 struct device *dev; 71 struct device *dev;
69 struct gk20a *g; 72 struct gk20a *g;
70 73
71 /* bound channel, if any */ 74 /* list of bound channels, if any */
72 struct file *ch_f; 75 struct list_head ch_list;
73 struct channel_gk20a *ch; 76 struct mutex ch_list_lock;
74 77
75 /* session operations */ 78 /* session operations */
76 struct dbg_gpu_session_ops *ops; 79 struct dbg_gpu_session_ops *ops;
77 80
78 /* event support */ 81 /* event support */
79 struct dbg_gpu_session_events dbg_events; 82 struct dbg_gpu_session_events dbg_events;
80 struct list_head dbg_s_list_node;
81 83
82 bool broadcast_stop_trigger; 84 bool broadcast_stop_trigger;
83}; 85};
84 86
87struct dbg_session_data {
88 struct dbg_session_gk20a *dbg_s;
89 struct list_head dbg_s_entry;
90};
91
92struct dbg_session_channel_data {
93 struct file *ch_f;
94 int channel_fd;
95 int chid;
96 struct list_head ch_entry;
97 struct dbg_session_data *session_data;
98};
99
85extern struct dbg_gpu_session_ops dbg_gpu_session_ops_gk20a; 100extern struct dbg_gpu_session_ops dbg_gpu_session_ops_gk20a;
86 101
102int dbg_unbind_single_channel_gk20a(struct dbg_session_gk20a *dbg_s,
103 struct dbg_session_channel_data *ch_data);
104
87bool gk20a_dbg_gpu_broadcast_stop_trigger(struct channel_gk20a *ch); 105bool gk20a_dbg_gpu_broadcast_stop_trigger(struct channel_gk20a *ch);
88int gk20a_dbg_gpu_clear_broadcast_stop_trigger(struct channel_gk20a *ch); 106int gk20a_dbg_gpu_clear_broadcast_stop_trigger(struct channel_gk20a *ch);
89 107