1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
/*
* Tegra Host Virtualization Interfaces to Server
*
* Copyright (c) 2014-2018, NVIDIA Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __TEGRA_VHOST_H
#define __TEGRA_VHOST_H
enum {
/* Must start at 1, 0 is used for VGPU */
TEGRA_VHOST_MODULE_HOST = 1,
TEGRA_VHOST_MODULE_VIC,
TEGRA_VHOST_MODULE_VI,
TEGRA_VHOST_MODULE_ISP,
TEGRA_VHOST_MODULE_MSENC,
TEGRA_VHOST_MODULE_NVDEC,
TEGRA_VHOST_MODULE_NVJPG,
TEGRA_VHOST_MODULE_NVENC1,
TEGRA_VHOST_MODULE_NVDEC1,
TEGRA_VHOST_MODULE_VI_THI,
TEGRA_VHOST_MODULE_ISP_THI,
TEGRA_VHOST_MODULE_NVCSI,
};
enum {
TEGRA_VHOST_QUEUE_CMD = 0,
TEGRA_VHOST_QUEUE_PB,
TEGRA_VHOST_QUEUE_INTR,
/* See also TEGRA_VGPU_QUEUE_* in tegra_vgpu.h */
};
enum {
TEGRA_VHOST_CMD_CONNECT = 0,
TEGRA_VHOST_CMD_DISCONNECT,
TEGRA_VHOST_CMD_ABORT,
TEGRA_VHOST_CMD_SYNCPT_WRITE,
TEGRA_VHOST_CMD_SYNCPT_READ,
TEGRA_VHOST_CMD_SYNCPT_CPU_INCR,
TEGRA_VHOST_CMD_WAITBASE_WRITE,
TEGRA_VHOST_CMD_WAITBASE_READ,
TEGRA_VHOST_CMD_MUTEX_TRY_LOCK,
TEGRA_VHOST_CMD_MUTEX_UNLOCK,
TEGRA_VHOST_CMD_SYNCPT_ENABLE_INTR,
TEGRA_VHOST_CMD_SYNCPT_DISABLE_INTR,
TEGRA_VHOST_CMD_SYNCPT_DISABLE_INTR_ALL,
TEGRA_VHOST_CMD_SYNCPT_GET_RANGE,
TEGRA_VHOST_CMD_CHANNEL_ALLOC_CLIENTID,
TEGRA_VHOST_CMD_HOST1X_CDMA_SUBMIT,
TEGRA_VHOST_CMD_HOST1X_REGRDWR,
TEGRA_VHOST_CMD_SUSPEND,
TEGRA_VHOST_CMD_RESUME,
TEGRA_VHOST_CMD_PROD_APPLY, /* WAR */
TEGRA_VHOST_CMD_CIL_SW_RESET, /* WAR */
};
struct tegra_vhost_connect_params {
u32 module;
u64 handle;
};
struct tegra_vhost_syncpt_params {
u32 id;
u32 val;
};
struct tegra_vhost_syncpt_range_params {
u32 base;
u32 size;
};
struct tegra_vhost_waitbase_params {
u32 id;
u32 val;
};
struct tegra_vhost_mutex_params {
u32 id;
u32 locked;
u32 owner;
};
struct tegra_vhost_syncpt_intr_params {
u32 id;
u32 thresh;
};
struct tegra_vhost_channel_clientid_params {
u32 moduleid;
u32 clientid;
};
struct tegra_vhost_channel_submit_params {
u32 clientid;
u32 job_id;
u32 num_entries;
u32 num_syncpts;
u32 timeout;
};
#define REGRDWR_ARRAY_SIZE (u32)4
struct tegra_vhost_channel_regrdwr_params {
u32 moduleid;
u32 count;
u32 write;
u32 regs[REGRDWR_ARRAY_SIZE];
};
struct tegra_vhost_prod_apply_params {
u32 phy_mode;
};
struct tegra_vhost_cil_sw_reset_params {
u32 lanes;
u32 enable;
};
struct tegra_vhost_cmd_msg {
u32 cmd;
int ret;
u64 handle;
union {
struct tegra_vhost_connect_params connect;
struct tegra_vhost_syncpt_params syncpt;
struct tegra_vhost_syncpt_range_params syncpt_range;
struct tegra_vhost_waitbase_params waitbase;
struct tegra_vhost_mutex_params mutex;
struct tegra_vhost_syncpt_intr_params syncpt_intr;
struct tegra_vhost_channel_clientid_params clientid;
struct tegra_vhost_channel_submit_params cdma_submit;
struct tegra_vhost_channel_regrdwr_params regrdwr;
struct tegra_vhost_prod_apply_params prod_apply;
struct tegra_vhost_cil_sw_reset_params cil_sw_reset;
} params;
};
enum {
TEGRA_VHOST_EVENT_SYNCPT_INTR = 0,
TEGRA_VHOST_EVENT_CHAN_TIMEOUT_INTR,
TEGRA_VHOST_EVENT_ABORT
};
struct tegra_vhost_syncpt_intr_info {
u32 id;
u32 thresh;
};
struct tegra_vhost_chan_timeout_intr_info {
u32 module_id;
u32 client_id;
u32 job_id_start;
u32 job_id_end;
};
struct tegra_vhost_intr_msg {
unsigned int event;
union {
struct tegra_vhost_syncpt_intr_info syncpt_intr;
struct tegra_vhost_chan_timeout_intr_info chan_timeout;
} info;
};
#define TEGRA_VHOST_QUEUE_SIZES \
sizeof(struct tegra_vhost_cmd_msg), \
4096, \
sizeof(struct tegra_vhost_intr_msg)
#endif
|