summaryrefslogtreecommitdiffstats
path: root/include/uapi
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 /include/uapi
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 'include/uapi')
-rw-r--r--include/uapi/linux/nvgpu.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h
index 89871b53..36616913 100644
--- a/include/uapi/linux/nvgpu.h
+++ b/include/uapi/linux/nvgpu.h
@@ -496,8 +496,7 @@ struct nvgpu_gpu_get_gpu_time_args {
496 * Binding/attaching a debugger session to an nvgpu channel 496 * Binding/attaching a debugger session to an nvgpu channel
497 * 497 *
498 * The 'channel_fd' given here is the fd used to allocate the 498 * The 'channel_fd' given here is the fd used to allocate the
499 * gpu channel context. To detach/unbind the debugger session 499 * gpu channel context.
500 * use a channel_fd of -1.
501 * 500 *
502 */ 501 */
503struct nvgpu_dbg_gpu_bind_channel_args { 502struct nvgpu_dbg_gpu_bind_channel_args {
@@ -510,6 +509,8 @@ struct nvgpu_dbg_gpu_bind_channel_args {
510 509
511/* 510/*
512 * Register operations 511 * Register operations
512 * All operations are targeted towards first channel
513 * attached to debug session
513 */ 514 */
514/* valid op values */ 515/* valid op values */
515#define NVGPU_DBG_GPU_REG_OP_READ_32 (0x00000000) 516#define NVGPU_DBG_GPU_REG_OP_READ_32 (0x00000000)
@@ -722,9 +723,23 @@ struct nvgpu_dbg_gpu_write_single_sm_error_state_args {
722#define NVGPU_DBG_GPU_IOCTL_WRITE_SINGLE_SM_ERROR_STATE \ 723#define NVGPU_DBG_GPU_IOCTL_WRITE_SINGLE_SM_ERROR_STATE \
723 _IOW(NVGPU_DBG_GPU_IOCTL_MAGIC, 16, struct nvgpu_dbg_gpu_write_single_sm_error_state_args) 724 _IOW(NVGPU_DBG_GPU_IOCTL_MAGIC, 16, struct nvgpu_dbg_gpu_write_single_sm_error_state_args)
724 725
726/*
727 * Unbinding/detaching a debugger session from a nvgpu channel
728 *
729 * The 'channel_fd' given here is the fd used to allocate the
730 * gpu channel context.
731 */
732struct nvgpu_dbg_gpu_unbind_channel_args {
733 __u32 channel_fd; /* in */
734 __u32 _pad0[1];
735};
736
737#define NVGPU_DBG_GPU_IOCTL_UNBIND_CHANNEL \
738 _IOW(NVGPU_DBG_GPU_IOCTL_MAGIC, 17, struct nvgpu_dbg_gpu_unbind_channel_args)
739
725 740
726#define NVGPU_DBG_GPU_IOCTL_LAST \ 741#define NVGPU_DBG_GPU_IOCTL_LAST \
727 _IOC_NR(NVGPU_DBG_GPU_IOCTL_WRITE_SINGLE_SM_ERROR_STATE) 742 _IOC_NR(NVGPU_DBG_GPU_IOCTL_UNBIND_CHANNEL)
728 743
729#define NVGPU_DBG_GPU_IOCTL_MAX_ARG_SIZE \ 744#define NVGPU_DBG_GPU_IOCTL_MAX_ARG_SIZE \
730 sizeof(struct nvgpu_dbg_gpu_perfbuf_map_args) 745 sizeof(struct nvgpu_dbg_gpu_perfbuf_map_args)