1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
4 * Copyright (C) 2017 Linaro Ltd.
6 #ifndef __VENUS_HFI_CMDS_H__
7 #define __VENUS_HFI_CMDS_H__
12 #define HFI_CMD_SYS_INIT 0x10001
13 #define HFI_CMD_SYS_PC_PREP 0x10002
14 #define HFI_CMD_SYS_SET_RESOURCE 0x10003
15 #define HFI_CMD_SYS_RELEASE_RESOURCE 0x10004
16 #define HFI_CMD_SYS_SET_PROPERTY 0x10005
17 #define HFI_CMD_SYS_GET_PROPERTY 0x10006
18 #define HFI_CMD_SYS_SESSION_INIT 0x10007
19 #define HFI_CMD_SYS_SESSION_END 0x10008
20 #define HFI_CMD_SYS_SET_BUFFERS 0x10009
21 #define HFI_CMD_SYS_TEST_SSR 0x10101
23 #define HFI_CMD_SESSION_SET_PROPERTY 0x11001
24 #define HFI_CMD_SESSION_SET_BUFFERS 0x11002
25 #define HFI_CMD_SESSION_GET_SEQUENCE_HEADER 0x11003
27 #define HFI_CMD_SYS_SESSION_ABORT 0x210001
28 #define HFI_CMD_SYS_PING 0x210002
30 #define HFI_CMD_SESSION_LOAD_RESOURCES 0x211001
31 #define HFI_CMD_SESSION_START 0x211002
32 #define HFI_CMD_SESSION_STOP 0x211003
33 #define HFI_CMD_SESSION_EMPTY_BUFFER 0x211004
34 #define HFI_CMD_SESSION_FILL_BUFFER 0x211005
35 #define HFI_CMD_SESSION_SUSPEND 0x211006
36 #define HFI_CMD_SESSION_RESUME 0x211007
37 #define HFI_CMD_SESSION_FLUSH 0x211008
38 #define HFI_CMD_SESSION_GET_PROPERTY 0x211009
39 #define HFI_CMD_SESSION_PARSE_SEQUENCE_HEADER 0x21100a
40 #define HFI_CMD_SESSION_RELEASE_BUFFERS 0x21100b
41 #define HFI_CMD_SESSION_RELEASE_RESOURCES 0x21100c
42 #define HFI_CMD_SESSION_CONTINUE 0x21100d
43 #define HFI_CMD_SESSION_SYNC 0x21100e
46 struct hfi_sys_init_pkt {
47 struct hfi_pkt_hdr hdr;
51 struct hfi_sys_pc_prep_pkt {
52 struct hfi_pkt_hdr hdr;
55 struct hfi_sys_set_resource_pkt {
56 struct hfi_pkt_hdr hdr;
62 struct hfi_sys_release_resource_pkt {
63 struct hfi_pkt_hdr hdr;
68 struct hfi_sys_set_property_pkt {
69 struct hfi_pkt_hdr hdr;
74 struct hfi_sys_get_property_pkt {
75 struct hfi_pkt_hdr hdr;
80 struct hfi_sys_set_buffers_pkt {
81 struct hfi_pkt_hdr hdr;
88 struct hfi_sys_ping_pkt {
89 struct hfi_pkt_hdr hdr;
93 struct hfi_session_init_pkt {
94 struct hfi_session_hdr_pkt shdr;
99 struct hfi_session_end_pkt {
100 struct hfi_session_hdr_pkt shdr;
103 struct hfi_session_abort_pkt {
104 struct hfi_session_hdr_pkt shdr;
107 struct hfi_session_set_property_pkt {
108 struct hfi_session_hdr_pkt shdr;
113 struct hfi_session_set_buffers_pkt {
114 struct hfi_session_hdr_pkt shdr;
123 struct hfi_session_get_sequence_header_pkt {
124 struct hfi_session_hdr_pkt shdr;
129 struct hfi_session_load_resources_pkt {
130 struct hfi_session_hdr_pkt shdr;
133 struct hfi_session_start_pkt {
134 struct hfi_session_hdr_pkt shdr;
137 struct hfi_session_stop_pkt {
138 struct hfi_session_hdr_pkt shdr;
141 struct hfi_session_empty_buffer_compressed_pkt {
142 struct hfi_session_hdr_pkt shdr;
153 u32 extradata_buffer;
157 struct hfi_session_empty_buffer_uncompressed_plane0_pkt {
158 struct hfi_session_hdr_pkt shdr;
170 u32 extradata_buffer;
174 struct hfi_session_empty_buffer_uncompressed_plane1_pkt {
183 struct hfi_session_empty_buffer_uncompressed_plane2_pkt {
192 struct hfi_session_fill_buffer_pkt {
193 struct hfi_session_hdr_pkt shdr;
200 u32 extradata_buffer;
204 struct hfi_session_flush_pkt {
205 struct hfi_session_hdr_pkt shdr;
209 struct hfi_session_suspend_pkt {
210 struct hfi_session_hdr_pkt shdr;
213 struct hfi_session_resume_pkt {
214 struct hfi_session_hdr_pkt shdr;
217 struct hfi_session_get_property_pkt {
218 struct hfi_session_hdr_pkt shdr;
223 struct hfi_session_release_buffer_pkt {
224 struct hfi_session_hdr_pkt shdr;
233 struct hfi_session_release_resources_pkt {
234 struct hfi_session_hdr_pkt shdr;
237 struct hfi_session_parse_sequence_header_pkt {
238 struct hfi_session_hdr_pkt shdr;
245 u8 data[] __counted_by(buf_size);
248 struct hfi_sys_test_ssr_pkt {
249 struct hfi_pkt_hdr hdr;
253 void pkt_set_version(enum hfi_version version);
255 void pkt_sys_init(struct hfi_sys_init_pkt *pkt, u32 arch_type);
256 void pkt_sys_pc_prep(struct hfi_sys_pc_prep_pkt *pkt);
257 void pkt_sys_idle_indicator(struct hfi_sys_set_property_pkt *pkt, u32 enable);
258 void pkt_sys_power_control(struct hfi_sys_set_property_pkt *pkt, u32 enable);
259 void pkt_sys_ubwc_config(struct hfi_sys_set_property_pkt *pkt, const struct hfi_ubwc_config *hfi);
260 int pkt_sys_set_resource(struct hfi_sys_set_resource_pkt *pkt, u32 id, u32 size,
261 u32 addr, void *cookie);
262 int pkt_sys_unset_resource(struct hfi_sys_release_resource_pkt *pkt, u32 id,
263 u32 size, void *cookie);
264 void pkt_sys_debug_config(struct hfi_sys_set_property_pkt *pkt, u32 mode,
266 void pkt_sys_coverage_config(struct hfi_sys_set_property_pkt *pkt, u32 mode);
267 void pkt_sys_ping(struct hfi_sys_ping_pkt *pkt, u32 cookie);
268 void pkt_sys_image_version(struct hfi_sys_get_property_pkt *pkt);
269 int pkt_sys_ssr_cmd(struct hfi_sys_test_ssr_pkt *pkt, u32 trigger_type);
270 int pkt_session_init(struct hfi_session_init_pkt *pkt, void *cookie,
271 u32 session_type, u32 codec);
272 void pkt_session_cmd(struct hfi_session_pkt *pkt, u32 pkt_type, void *cookie);
273 int pkt_session_set_buffers(struct hfi_session_set_buffers_pkt *pkt,
274 void *cookie, struct hfi_buffer_desc *bd);
275 int pkt_session_unset_buffers(struct hfi_session_release_buffer_pkt *pkt,
276 void *cookie, struct hfi_buffer_desc *bd);
277 int pkt_session_etb_decoder(struct hfi_session_empty_buffer_compressed_pkt *pkt,
278 void *cookie, struct hfi_frame_data *input_frame);
279 int pkt_session_etb_encoder(
280 struct hfi_session_empty_buffer_uncompressed_plane0_pkt *pkt,
281 void *cookie, struct hfi_frame_data *input_frame);
282 int pkt_session_ftb(struct hfi_session_fill_buffer_pkt *pkt,
283 void *cookie, struct hfi_frame_data *output_frame);
284 int pkt_session_parse_seq_header(
285 struct hfi_session_parse_sequence_header_pkt *pkt,
286 void *cookie, u32 seq_hdr, u32 seq_hdr_len);
287 int pkt_session_get_seq_hdr(struct hfi_session_get_sequence_header_pkt *pkt,
288 void *cookie, u32 seq_hdr, u32 seq_hdr_len);
289 int pkt_session_flush(struct hfi_session_flush_pkt *pkt, void *cookie,
291 int pkt_session_get_property(struct hfi_session_get_property_pkt *pkt,
292 void *cookie, u32 ptype);
293 int pkt_session_set_property(struct hfi_session_set_property_pkt *pkt,
294 void *cookie, u32 ptype, void *pdata);