summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c
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/vgpu/dbg_vgpu.c
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/vgpu/dbg_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/dbg_vgpu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c b/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c
index ef12c3fd..a9533e03 100644
--- a/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c
@@ -26,7 +26,7 @@ static int vgpu_exec_regops(struct dbg_session_gk20a *dbg_s,
26 struct nvgpu_dbg_gpu_reg_op *ops, 26 struct nvgpu_dbg_gpu_reg_op *ops,
27 u64 num_ops) 27 u64 num_ops)
28{ 28{
29 struct channel_gk20a *ch = dbg_s->ch; 29 struct channel_gk20a *ch;
30 struct gk20a_platform *platform = gk20a_get_platform(dbg_s->g->dev); 30 struct gk20a_platform *platform = gk20a_get_platform(dbg_s->g->dev);
31 struct tegra_vgpu_cmd_msg msg; 31 struct tegra_vgpu_cmd_msg msg;
32 struct tegra_vgpu_reg_ops_params *p = &msg.params.reg_ops; 32 struct tegra_vgpu_reg_ops_params *p = &msg.params.reg_ops;
@@ -55,6 +55,7 @@ static int vgpu_exec_regops(struct dbg_session_gk20a *dbg_s,
55 55
56 msg.cmd = TEGRA_VGPU_CMD_REG_OPS; 56 msg.cmd = TEGRA_VGPU_CMD_REG_OPS;
57 msg.handle = platform->virt_handle; 57 msg.handle = platform->virt_handle;
58 ch = nvgpu_dbg_gpu_get_session_channel(dbg_s);
58 p->handle = ch ? ch->virt_ctx : 0; 59 p->handle = ch ? ch->virt_ctx : 0;
59 p->num_ops = num_ops; 60 p->num_ops = num_ops;
60 p->is_profiler = dbg_s->is_profiler; 61 p->is_profiler = dbg_s->is_profiler;