diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/ioctl_dbg.c | 17 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/ioctl_dbg.h | 26 |
2 files changed, 22 insertions, 21 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c index 383bdca9..3156837b 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/cdev.h> | 21 | #include <linux/cdev.h> |
22 | #include <linux/uaccess.h> | 22 | #include <linux/uaccess.h> |
23 | #include <linux/dma-buf.h> | 23 | #include <linux/dma-buf.h> |
24 | #include <linux/poll.h> | ||
24 | #include <uapi/linux/nvgpu.h> | 25 | #include <uapi/linux/nvgpu.h> |
25 | 26 | ||
26 | #include <nvgpu/kmem.h> | 27 | #include <nvgpu/kmem.h> |
@@ -40,6 +41,22 @@ | |||
40 | #include "platform_gk20a.h" | 41 | #include "platform_gk20a.h" |
41 | #include "ioctl_dbg.h" | 42 | #include "ioctl_dbg.h" |
42 | 43 | ||
44 | struct dbg_session_gk20a_linux { | ||
45 | struct device *dev; | ||
46 | struct dbg_session_gk20a dbg_s; | ||
47 | }; | ||
48 | |||
49 | struct dbg_session_channel_data_linux { | ||
50 | /* | ||
51 | * We have to keep a ref to the _file_, not the channel, because | ||
52 | * close(channel_fd) is synchronous and would deadlock if we had an | ||
53 | * open debug session fd holding a channel ref at that time. Holding a | ||
54 | * ref to the file makes close(channel_fd) just drop a kernel ref to | ||
55 | * the file; the channel will close when the last file ref is dropped. | ||
56 | */ | ||
57 | struct file *ch_f; | ||
58 | struct dbg_session_channel_data ch_data; | ||
59 | }; | ||
43 | /* turn seriously unwieldy names -> something shorter */ | 60 | /* turn seriously unwieldy names -> something shorter */ |
44 | #define REGOP_LINUX(x) NVGPU_DBG_GPU_REG_OP_##x | 61 | #define REGOP_LINUX(x) NVGPU_DBG_GPU_REG_OP_##x |
45 | 62 | ||
diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.h b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.h index bd76045b..2e188cc0 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.h +++ b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Tegra GK20A GPU Debugger Driver | 2 | * Tegra GK20A GPU Debugger Driver |
3 | * | 3 | * |
4 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms and conditions of the GNU General Public License, | 7 | * under the terms and conditions of the GNU General Public License, |
@@ -17,31 +17,15 @@ | |||
17 | */ | 17 | */ |
18 | #ifndef DBG_GPU_IOCTL_GK20A_H | 18 | #ifndef DBG_GPU_IOCTL_GK20A_H |
19 | #define DBG_GPU_IOCTL_GK20A_H | 19 | #define DBG_GPU_IOCTL_GK20A_H |
20 | #include <linux/poll.h> | ||
21 | 20 | ||
22 | #include "gk20a/dbg_gpu_gk20a.h" | 21 | struct inode; |
22 | struct file; | ||
23 | typedef struct poll_table_struct poll_table; | ||
23 | 24 | ||
24 | /* NVGPU_DBG_GPU_IOCTL_REG_OPS: the upper limit for the number | 25 | /* NVGPU_DBG_GPU_IOCTL_REG_OPS: the upper limit for the number |
25 | * of regops */ | 26 | * of regops */ |
26 | #define NVGPU_IOCTL_DBG_REG_OPS_LIMIT 1024 | 27 | #define NVGPU_IOCTL_DBG_REG_OPS_LIMIT 1024 |
27 | 28 | ||
28 | struct dbg_session_gk20a_linux { | ||
29 | struct device *dev; | ||
30 | struct dbg_session_gk20a dbg_s; | ||
31 | }; | ||
32 | |||
33 | struct dbg_session_channel_data_linux { | ||
34 | /* | ||
35 | * We have to keep a ref to the _file_, not the channel, because | ||
36 | * close(channel_fd) is synchronous and would deadlock if we had an | ||
37 | * open debug session fd holding a channel ref at that time. Holding a | ||
38 | * ref to the file makes close(channel_fd) just drop a kernel ref to | ||
39 | * the file; the channel will close when the last file ref is dropped. | ||
40 | */ | ||
41 | struct file *ch_f; | ||
42 | struct dbg_session_channel_data ch_data; | ||
43 | }; | ||
44 | |||
45 | /* module debug driver interface */ | 29 | /* module debug driver interface */ |
46 | int gk20a_dbg_gpu_dev_release(struct inode *inode, struct file *filp); | 30 | int gk20a_dbg_gpu_dev_release(struct inode *inode, struct file *filp); |
47 | int gk20a_dbg_gpu_dev_open(struct inode *inode, struct file *filp); | 31 | int gk20a_dbg_gpu_dev_open(struct inode *inode, struct file *filp); |
@@ -51,4 +35,4 @@ unsigned int gk20a_dbg_gpu_dev_poll(struct file *filep, poll_table *wait); | |||
51 | /* used by profiler driver interface */ | 35 | /* used by profiler driver interface */ |
52 | int gk20a_prof_gpu_dev_open(struct inode *inode, struct file *filp); | 36 | int gk20a_prof_gpu_dev_open(struct inode *inode, struct file *filp); |
53 | 37 | ||
54 | #endif \ No newline at end of file | 38 | #endif |