2 * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
3 * Copyright (C) 2017 Linaro Ltd.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 and
7 * only version 2 as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
15 #ifndef __VENUS_HFI_CMDS_H__
16 #define __VENUS_HFI_CMDS_H__
21 #define HFI_CMD_SYS_INIT 0x10001
22 #define HFI_CMD_SYS_PC_PREP 0x10002
23 #define HFI_CMD_SYS_SET_RESOURCE 0x10003
24 #define HFI_CMD_SYS_RELEASE_RESOURCE 0x10004
25 #define HFI_CMD_SYS_SET_PROPERTY 0x10005
26 #define HFI_CMD_SYS_GET_PROPERTY 0x10006
27 #define HFI_CMD_SYS_SESSION_INIT 0x10007
28 #define HFI_CMD_SYS_SESSION_END 0x10008
29 #define HFI_CMD_SYS_SET_BUFFERS 0x10009
30 #define HFI_CMD_SYS_TEST_SSR 0x10101
32 #define HFI_CMD_SESSION_SET_PROPERTY 0x11001
33 #define HFI_CMD_SESSION_SET_BUFFERS 0x11002
34 #define HFI_CMD_SESSION_GET_SEQUENCE_HEADER 0x11003
36 #define HFI_CMD_SYS_SESSION_ABORT 0x210001
37 #define HFI_CMD_SYS_PING 0x210002
39 #define HFI_CMD_SESSION_LOAD_RESOURCES 0x211001
40 #define HFI_CMD_SESSION_START 0x211002
41 #define HFI_CMD_SESSION_STOP 0x211003
42 #define HFI_CMD_SESSION_EMPTY_BUFFER 0x211004
43 #define HFI_CMD_SESSION_FILL_BUFFER 0x211005
44 #define HFI_CMD_SESSION_SUSPEND 0x211006
45 #define HFI_CMD_SESSION_RESUME 0x211007
46 #define HFI_CMD_SESSION_FLUSH 0x211008
47 #define HFI_CMD_SESSION_GET_PROPERTY 0x211009
48 #define HFI_CMD_SESSION_PARSE_SEQUENCE_HEADER 0x21100a
49 #define HFI_CMD_SESSION_RELEASE_BUFFERS 0x21100b
50 #define HFI_CMD_SESSION_RELEASE_RESOURCES 0x21100c
51 #define HFI_CMD_SESSION_CONTINUE 0x21100d
52 #define HFI_CMD_SESSION_SYNC 0x21100e
55 struct hfi_sys_init_pkt {
56 struct hfi_pkt_hdr hdr;
60 struct hfi_sys_pc_prep_pkt {
61 struct hfi_pkt_hdr hdr;
64 struct hfi_sys_set_resource_pkt {
65 struct hfi_pkt_hdr hdr;
71 struct hfi_sys_release_resource_pkt {
72 struct hfi_pkt_hdr hdr;
77 struct hfi_sys_set_property_pkt {
78 struct hfi_pkt_hdr hdr;
83 struct hfi_sys_get_property_pkt {
84 struct hfi_pkt_hdr hdr;
89 struct hfi_sys_set_buffers_pkt {
90 struct hfi_pkt_hdr hdr;
97 struct hfi_sys_ping_pkt {
98 struct hfi_pkt_hdr hdr;
102 struct hfi_session_init_pkt {
103 struct hfi_session_hdr_pkt shdr;
108 struct hfi_session_end_pkt {
109 struct hfi_session_hdr_pkt shdr;
112 struct hfi_session_abort_pkt {
113 struct hfi_session_hdr_pkt shdr;
116 struct hfi_session_set_property_pkt {
117 struct hfi_session_hdr_pkt shdr;
122 struct hfi_session_set_buffers_pkt {
123 struct hfi_session_hdr_pkt shdr;
132 struct hfi_session_get_sequence_header_pkt {
133 struct hfi_session_hdr_pkt shdr;
138 struct hfi_session_load_resources_pkt {
139 struct hfi_session_hdr_pkt shdr;
142 struct hfi_session_start_pkt {
143 struct hfi_session_hdr_pkt shdr;
146 struct hfi_session_stop_pkt {
147 struct hfi_session_hdr_pkt shdr;
150 struct hfi_session_empty_buffer_compressed_pkt {
151 struct hfi_session_hdr_pkt shdr;
162 u32 extradata_buffer;
166 struct hfi_session_empty_buffer_uncompressed_plane0_pkt {
167 struct hfi_session_hdr_pkt shdr;
179 u32 extradata_buffer;
183 struct hfi_session_empty_buffer_uncompressed_plane1_pkt {
192 struct hfi_session_empty_buffer_uncompressed_plane2_pkt {
201 struct hfi_session_fill_buffer_pkt {
202 struct hfi_session_hdr_pkt shdr;
209 u32 extradata_buffer;
213 struct hfi_session_flush_pkt {
214 struct hfi_session_hdr_pkt shdr;
218 struct hfi_session_suspend_pkt {
219 struct hfi_session_hdr_pkt shdr;
222 struct hfi_session_resume_pkt {
223 struct hfi_session_hdr_pkt shdr;
226 struct hfi_session_get_property_pkt {
227 struct hfi_session_hdr_pkt shdr;
232 struct hfi_session_release_buffer_pkt {
233 struct hfi_session_hdr_pkt shdr;
242 struct hfi_session_release_resources_pkt {
243 struct hfi_session_hdr_pkt shdr;
246 struct hfi_session_parse_sequence_header_pkt {
247 struct hfi_session_hdr_pkt shdr;
257 struct hfi_sys_test_ssr_pkt {
258 struct hfi_pkt_hdr hdr;
262 void pkt_set_version(enum hfi_version version);
264 void pkt_sys_init(struct hfi_sys_init_pkt *pkt, u32 arch_type);
265 void pkt_sys_pc_prep(struct hfi_sys_pc_prep_pkt *pkt);
266 void pkt_sys_idle_indicator(struct hfi_sys_set_property_pkt *pkt, u32 enable);
267 void pkt_sys_power_control(struct hfi_sys_set_property_pkt *pkt, u32 enable);
268 int pkt_sys_set_resource(struct hfi_sys_set_resource_pkt *pkt, u32 id, u32 size,
269 u32 addr, void *cookie);
270 int pkt_sys_unset_resource(struct hfi_sys_release_resource_pkt *pkt, u32 id,
271 u32 size, void *cookie);
272 void pkt_sys_debug_config(struct hfi_sys_set_property_pkt *pkt, u32 mode,
274 void pkt_sys_coverage_config(struct hfi_sys_set_property_pkt *pkt, u32 mode);
275 void pkt_sys_ping(struct hfi_sys_ping_pkt *pkt, u32 cookie);
276 void pkt_sys_image_version(struct hfi_sys_get_property_pkt *pkt);
277 int pkt_sys_ssr_cmd(struct hfi_sys_test_ssr_pkt *pkt, u32 trigger_type);
278 int pkt_session_init(struct hfi_session_init_pkt *pkt, void *cookie,
279 u32 session_type, u32 codec);
280 void pkt_session_cmd(struct hfi_session_pkt *pkt, u32 pkt_type, void *cookie);
281 int pkt_session_set_buffers(struct hfi_session_set_buffers_pkt *pkt,
282 void *cookie, struct hfi_buffer_desc *bd);
283 int pkt_session_unset_buffers(struct hfi_session_release_buffer_pkt *pkt,
284 void *cookie, struct hfi_buffer_desc *bd);
285 int pkt_session_etb_decoder(struct hfi_session_empty_buffer_compressed_pkt *pkt,
286 void *cookie, struct hfi_frame_data *input_frame);
287 int pkt_session_etb_encoder(
288 struct hfi_session_empty_buffer_uncompressed_plane0_pkt *pkt,
289 void *cookie, struct hfi_frame_data *input_frame);
290 int pkt_session_ftb(struct hfi_session_fill_buffer_pkt *pkt,
291 void *cookie, struct hfi_frame_data *output_frame);
292 int pkt_session_parse_seq_header(
293 struct hfi_session_parse_sequence_header_pkt *pkt,
294 void *cookie, u32 seq_hdr, u32 seq_hdr_len);
295 int pkt_session_get_seq_hdr(struct hfi_session_get_sequence_header_pkt *pkt,
296 void *cookie, u32 seq_hdr, u32 seq_hdr_len);
297 int pkt_session_flush(struct hfi_session_flush_pkt *pkt, void *cookie,
299 int pkt_session_get_property(struct hfi_session_get_property_pkt *pkt,
300 void *cookie, u32 ptype);
301 int pkt_session_set_property(struct hfi_session_set_property_pkt *pkt,
302 void *cookie, u32 ptype, void *pdata);