]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/blob - drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.h
27084c0dbf6e94986138b8963453b50ff602b96f
[sojka/nv-tegra/linux-3.10.git] / drivers / gpu / nvgpu / gk20a / dbg_gpu_gk20a.h
1 /*
2  * Tegra GK20A GPU Debugger Driver
3  *
4  * Copyright (c) 2013-2014, NVIDIA CORPORATION.  All rights reserved.
5  *
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,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 #ifndef DBG_GPU_GK20A_H
19 #define DBG_GPU_GK20A_H
20 #include <linux/poll.h>
21
22 /* module debug driver interface */
23 int gk20a_dbg_gpu_dev_release(struct inode *inode, struct file *filp);
24 int gk20a_dbg_gpu_dev_open(struct inode *inode, struct file *filp);
25 long gk20a_dbg_gpu_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
26 unsigned int gk20a_dbg_gpu_dev_poll(struct file *filep, poll_table *wait);
27
28 /* used by profiler driver interface */
29 int gk20a_prof_gpu_dev_open(struct inode *inode, struct file *filp);
30
31 /* used by the interrupt handler to post events */
32 void gk20a_dbg_gpu_post_events(struct channel_gk20a *fault_ch);
33
34 struct dbg_gpu_session_ops {
35         int (*exec_reg_ops)(struct dbg_session_gk20a *dbg_s,
36                             struct nvgpu_dbg_gpu_reg_op *ops,
37                             u64 num_ops);
38 };
39
40 struct dbg_gpu_session_events {
41         wait_queue_head_t wait_queue;
42         bool events_enabled;
43         int num_pending_events;
44 };
45
46 struct dbg_session_gk20a {
47         /* dbg session id used for trace/prints */
48         int id;
49
50         /* profiler session, if any */
51         bool is_profiler;
52
53         /* power enabled or disabled */
54         bool is_pg_disabled;
55
56         /*
57          * There can be different versions of the whitelists
58          * between both global and per-context sets; as well
59          * as between debugger and profiler interfaces.
60          */
61         struct regops_whitelist *global;
62         struct regops_whitelist *per_context;
63
64         /* gpu module vagaries */
65         struct device             *dev;
66         struct platform_device    *pdev;
67         struct gk20a              *g;
68
69         /* bound channel, if any */
70         struct file          *ch_f;
71         struct channel_gk20a *ch;
72
73         /* session operations */
74         struct dbg_gpu_session_ops *ops;
75
76         /* event support */
77         struct dbg_gpu_session_events dbg_events;
78         struct list_head dbg_s_list_node;
79 };
80
81 extern struct dbg_gpu_session_ops dbg_gpu_session_ops_gk20a;
82
83 #endif /* DBG_GPU_GK20A_H */