summaryrefslogtreecommitdiff
path: root/drivers/media/platform/qcom/venus/hfi_msgs.h
blob: 14d9a3979b14758b1f95bb6513cc58103991110f (plain)
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
/*
 * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
 * Copyright (C) 2017 Linaro Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that 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.
 *
 */
#ifndef __VENUS_HFI_MSGS_H__
#define __VENUS_HFI_MSGS_H__

/* message calls */
#define HFI_MSG_SYS_INIT			0x20001
#define HFI_MSG_SYS_PC_PREP			0x20002
#define HFI_MSG_SYS_RELEASE_RESOURCE		0x20003
#define HFI_MSG_SYS_DEBUG			0x20004
#define HFI_MSG_SYS_SESSION_INIT		0x20006
#define HFI_MSG_SYS_SESSION_END			0x20007
#define HFI_MSG_SYS_IDLE			0x20008
#define HFI_MSG_SYS_COV				0x20009
#define HFI_MSG_SYS_PROPERTY_INFO		0x2000a

#define HFI_MSG_EVENT_NOTIFY			0x21001
#define HFI_MSG_SESSION_GET_SEQUENCE_HEADER	0x21002

#define HFI_MSG_SYS_PING_ACK			0x220002
#define HFI_MSG_SYS_SESSION_ABORT		0x220004

#define HFI_MSG_SESSION_LOAD_RESOURCES		0x221001
#define HFI_MSG_SESSION_START			0x221002
#define HFI_MSG_SESSION_STOP			0x221003
#define HFI_MSG_SESSION_SUSPEND			0x221004
#define HFI_MSG_SESSION_RESUME			0x221005
#define HFI_MSG_SESSION_FLUSH			0x221006
#define HFI_MSG_SESSION_EMPTY_BUFFER		0x221007
#define HFI_MSG_SESSION_FILL_BUFFER		0x221008
#define HFI_MSG_SESSION_PROPERTY_INFO		0x221009
#define HFI_MSG_SESSION_RELEASE_RESOURCES	0x22100a
#define HFI_MSG_SESSION_PARSE_SEQUENCE_HEADER	0x22100b
#define HFI_MSG_SESSION_RELEASE_BUFFERS		0x22100c

#define HFI_PICTURE_I				0x00000001
#define HFI_PICTURE_P				0x00000002
#define HFI_PICTURE_B				0x00000004
#define HFI_PICTURE_IDR				0x00000008
#define HFI_FRAME_NOTCODED			0x7f002000
#define HFI_FRAME_YUV				0x7f004000
#define HFI_UNUSED_PICT				0x10000000

/* message packets */
struct hfi_msg_event_notify_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 event_id;
	u32 event_data1;
	u32 event_data2;
	u32 ext_event_data[1];
};

struct hfi_msg_event_release_buffer_ref_pkt {
	u32 packet_buffer;
	u32 extradata_buffer;
	u32 output_tag;
};

struct hfi_msg_sys_init_done_pkt {
	struct hfi_pkt_hdr hdr;
	u32 error_type;
	u32 num_properties;
	u32 data[1];
};

struct hfi_msg_sys_pc_prep_done_pkt {
	struct hfi_pkt_hdr hdr;
	u32 error_type;
};

struct hfi_msg_sys_release_resource_done_pkt {
	struct hfi_pkt_hdr hdr;
	u32 resource_handle;
	u32 error_type;
};

struct hfi_msg_session_init_done_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 error_type;
	u32 num_properties;
	u32 data[1];
};

struct hfi_msg_session_end_done_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 error_type;
};

struct hfi_msg_session_get_sequence_hdr_done_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 error_type;
	u32 header_len;
	u32 sequence_header;
};

struct hfi_msg_sys_session_abort_done_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 error_type;
};

struct hfi_msg_sys_idle_pkt {
	struct hfi_pkt_hdr hdr;
};

struct hfi_msg_sys_ping_ack_pkt {
	struct hfi_pkt_hdr hdr;
	u32 client_data;
};

struct hfi_msg_sys_property_info_pkt {
	struct hfi_pkt_hdr hdr;
	u32 num_properties;
	u32 data[1];
};

struct hfi_msg_session_load_resources_done_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 error_type;
};

struct hfi_msg_session_start_done_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 error_type;
};

struct hfi_msg_session_stop_done_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 error_type;
};

struct hfi_msg_session_suspend_done_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 error_type;
};

struct hfi_msg_session_resume_done_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 error_type;
};

struct hfi_msg_session_flush_done_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 error_type;
	u32 flush_type;
};

struct hfi_msg_session_empty_buffer_done_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 error_type;
	u32 offset;
	u32 filled_len;
	u32 input_tag;
	u32 packet_buffer;
	u32 extradata_buffer;
	u32 data[0];
};

struct hfi_msg_session_fbd_compressed_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 time_stamp_hi;
	u32 time_stamp_lo;
	u32 error_type;
	u32 flags;
	u32 mark_target;
	u32 mark_data;
	u32 stats;
	u32 offset;
	u32 alloc_len;
	u32 filled_len;
	u32 input_tag;
	u32 output_tag;
	u32 picture_type;
	u32 packet_buffer;
	u32 extradata_buffer;
	u32 data[0];
};

struct hfi_msg_session_fbd_uncompressed_plane0_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 stream_id;
	u32 view_id;
	u32 error_type;
	u32 time_stamp_hi;
	u32 time_stamp_lo;
	u32 flags;
	u32 mark_target;
	u32 mark_data;
	u32 stats;
	u32 alloc_len;
	u32 filled_len;
	u32 offset;
	u32 frame_width;
	u32 frame_height;
	u32 start_x_coord;
	u32 start_y_coord;
	u32 input_tag;
	u32 input_tag2;
	u32 output_tag;
	u32 picture_type;
	u32 packet_buffer;
	u32 extradata_buffer;
	u32 data[0];
};

struct hfi_msg_session_fbd_uncompressed_plane1_pkt {
	u32 flags;
	u32 alloc_len;
	u32 filled_len;
	u32 offset;
	u32 packet_buffer2;
	u32 data[0];
};

struct hfi_msg_session_fbd_uncompressed_plane2_pkt {
	u32 flags;
	u32 alloc_len;
	u32 filled_len;
	u32 offset;
	u32 packet_buffer3;
	u32 data[0];
};

struct hfi_msg_session_parse_sequence_header_done_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 error_type;
	u32 num_properties;
	u32 data[1];
};

struct hfi_msg_session_property_info_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 num_properties;
	u32 data[1];
};

struct hfi_msg_session_release_resources_done_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 error_type;
};

struct hfi_msg_session_release_buffers_done_pkt {
	struct hfi_session_hdr_pkt shdr;
	u32 error_type;
	u32 num_buffers;
	u32 buffer_info[1];
};

struct hfi_msg_sys_debug_pkt {
	struct hfi_pkt_hdr hdr;
	u32 msg_type;
	u32 msg_size;
	u32 time_stamp_hi;
	u32 time_stamp_lo;
	u8 msg_data[1];
};

struct hfi_msg_sys_coverage_pkt {
	struct hfi_pkt_hdr hdr;
	u32 msg_size;
	u32 time_stamp_hi;
	u32 time_stamp_lo;
	u8 msg_data[1];
};

struct venus_core;
struct hfi_pkt_hdr;

void hfi_process_watchdog_timeout(struct venus_core *core);
u32 hfi_process_msg_packet(struct venus_core *core, struct hfi_pkt_hdr *hdr);

#endif