1 /*
2  * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
3  * Copyright (C) 2017 Linaro Ltd.
4  *
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.
8  *
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.
13  *
14  */
15 #ifndef __VENUS_HFI_HELPER_H__
16 #define __VENUS_HFI_HELPER_H__
17 
18 #define HFI_DOMAIN_BASE_COMMON				0
19 
20 #define HFI_DOMAIN_BASE_VDEC				0x1000000
21 #define HFI_DOMAIN_BASE_VENC				0x2000000
22 #define HFI_DOMAIN_BASE_VPE				0x3000000
23 
24 #define HFI_VIDEO_ARCH_OX				0x1
25 
26 #define HFI_ARCH_COMMON_OFFSET				0
27 #define HFI_ARCH_OX_OFFSET				0x200000
28 
29 #define HFI_OX_BASE					0x1000000
30 
31 #define HFI_CMD_START_OFFSET				0x10000
32 #define HFI_MSG_START_OFFSET				0x20000
33 
34 #define HFI_ERR_NONE					0x0
35 #define HFI_ERR_SYS_FATAL				0x1
36 #define HFI_ERR_SYS_INVALID_PARAMETER			0x2
37 #define HFI_ERR_SYS_VERSION_MISMATCH			0x3
38 #define HFI_ERR_SYS_INSUFFICIENT_RESOURCES		0x4
39 #define HFI_ERR_SYS_MAX_SESSIONS_REACHED		0x5
40 #define HFI_ERR_SYS_UNSUPPORTED_CODEC			0x6
41 #define HFI_ERR_SYS_SESSION_IN_USE			0x7
42 #define HFI_ERR_SYS_SESSION_ID_OUT_OF_RANGE		0x8
43 #define HFI_ERR_SYS_UNSUPPORTED_DOMAIN			0x9
44 
45 #define HFI_ERR_SESSION_FATAL				0x1001
46 #define HFI_ERR_SESSION_INVALID_PARAMETER		0x1002
47 #define HFI_ERR_SESSION_BAD_POINTER			0x1003
48 #define HFI_ERR_SESSION_INVALID_SESSION_ID		0x1004
49 #define HFI_ERR_SESSION_INVALID_STREAM_ID		0x1005
50 #define HFI_ERR_SESSION_INCORRECT_STATE_OPERATION	0x1006
51 #define HFI_ERR_SESSION_UNSUPPORTED_PROPERTY		0x1007
52 #define HFI_ERR_SESSION_UNSUPPORTED_SETTING		0x1008
53 #define HFI_ERR_SESSION_INSUFFICIENT_RESOURCES		0x1009
54 #define HFI_ERR_SESSION_STREAM_CORRUPT_OUTPUT_STALLED	0x100a
55 #define HFI_ERR_SESSION_STREAM_CORRUPT			0x100b
56 #define HFI_ERR_SESSION_ENC_OVERFLOW			0x100c
57 #define HFI_ERR_SESSION_UNSUPPORTED_STREAM		0x100d
58 #define HFI_ERR_SESSION_CMDSIZE				0x100e
59 #define HFI_ERR_SESSION_UNSUPPORT_CMD			0x100f
60 #define HFI_ERR_SESSION_UNSUPPORT_BUFFERTYPE		0x1010
61 #define HFI_ERR_SESSION_BUFFERCOUNT_TOOSMALL		0x1011
62 #define HFI_ERR_SESSION_INVALID_SCALE_FACTOR		0x1012
63 #define HFI_ERR_SESSION_UPSCALE_NOT_SUPPORTED		0x1013
64 
65 #define HFI_EVENT_SYS_ERROR				0x1
66 #define HFI_EVENT_SESSION_ERROR				0x2
67 
68 #define HFI_EVENT_DATA_SEQUENCE_CHANGED_SUFFICIENT_BUF_RESOURCES   0x1000001
69 #define HFI_EVENT_DATA_SEQUENCE_CHANGED_INSUFFICIENT_BUF_RESOURCES 0x1000002
70 #define HFI_EVENT_SESSION_SEQUENCE_CHANGED			   0x1000003
71 #define HFI_EVENT_SESSION_PROPERTY_CHANGED			   0x1000004
72 #define HFI_EVENT_SESSION_LTRUSE_FAILED				   0x1000005
73 #define HFI_EVENT_RELEASE_BUFFER_REFERENCE			   0x1000006
74 
75 #define HFI_BUFFERFLAG_EOS				0x00000001
76 #define HFI_BUFFERFLAG_STARTTIME			0x00000002
77 #define HFI_BUFFERFLAG_DECODEONLY			0x00000004
78 #define HFI_BUFFERFLAG_DATACORRUPT			0x00000008
79 #define HFI_BUFFERFLAG_ENDOFFRAME			0x00000010
80 #define HFI_BUFFERFLAG_SYNCFRAME			0x00000020
81 #define HFI_BUFFERFLAG_EXTRADATA			0x00000040
82 #define HFI_BUFFERFLAG_CODECCONFIG			0x00000080
83 #define HFI_BUFFERFLAG_TIMESTAMPINVALID			0x00000100
84 #define HFI_BUFFERFLAG_READONLY				0x00000200
85 #define HFI_BUFFERFLAG_ENDOFSUBFRAME			0x00000400
86 #define HFI_BUFFERFLAG_EOSEQ				0x00200000
87 #define HFI_BUFFERFLAG_MBAFF				0x08000000
88 #define HFI_BUFFERFLAG_VPE_YUV_601_709_CSC_CLAMP	0x10000000
89 #define HFI_BUFFERFLAG_DROP_FRAME			0x20000000
90 #define HFI_BUFFERFLAG_TEI				0x40000000
91 #define HFI_BUFFERFLAG_DISCONTINUITY			0x80000000
92 
93 #define HFI_ERR_SESSION_EMPTY_BUFFER_DONE_OUTPUT_PENDING	0x1001001
94 #define HFI_ERR_SESSION_SAME_STATE_OPERATION			0x1001002
95 #define HFI_ERR_SESSION_SYNC_FRAME_NOT_DETECTED			0x1001003
96 #define HFI_ERR_SESSION_START_CODE_NOT_FOUND			0x1001004
97 
98 #define HFI_FLUSH_INPUT					0x1000001
99 #define HFI_FLUSH_OUTPUT				0x1000002
100 #define HFI_FLUSH_OUTPUT2				0x1000003
101 #define HFI_FLUSH_ALL					0x1000004
102 
103 #define HFI_EXTRADATA_NONE				0x00000000
104 #define HFI_EXTRADATA_MB_QUANTIZATION			0x00000001
105 #define HFI_EXTRADATA_INTERLACE_VIDEO			0x00000002
106 #define HFI_EXTRADATA_VC1_FRAMEDISP			0x00000003
107 #define HFI_EXTRADATA_VC1_SEQDISP			0x00000004
108 #define HFI_EXTRADATA_TIMESTAMP				0x00000005
109 #define HFI_EXTRADATA_S3D_FRAME_PACKING			0x00000006
110 #define HFI_EXTRADATA_FRAME_RATE			0x00000007
111 #define HFI_EXTRADATA_PANSCAN_WINDOW			0x00000008
112 #define HFI_EXTRADATA_RECOVERY_POINT_SEI		0x00000009
113 #define HFI_EXTRADATA_MPEG2_SEQDISP			0x0000000d
114 #define HFI_EXTRADATA_STREAM_USERDATA			0x0000000e
115 #define HFI_EXTRADATA_FRAME_QP				0x0000000f
116 #define HFI_EXTRADATA_FRAME_BITS_INFO			0x00000010
117 #define HFI_EXTRADATA_MULTISLICE_INFO			0x7f100000
118 #define HFI_EXTRADATA_NUM_CONCEALED_MB			0x7f100001
119 #define HFI_EXTRADATA_INDEX				0x7f100002
120 #define HFI_EXTRADATA_METADATA_LTR			0x7f100004
121 #define HFI_EXTRADATA_METADATA_FILLER			0x7fe00002
122 
123 #define HFI_INDEX_EXTRADATA_INPUT_CROP			0x0700000e
124 #define HFI_INDEX_EXTRADATA_DIGITAL_ZOOM		0x07000010
125 #define HFI_INDEX_EXTRADATA_ASPECT_RATIO		0x7f100003
126 
127 #define HFI_INTERLACE_FRAME_PROGRESSIVE			0x01
128 #define HFI_INTERLACE_INTERLEAVE_FRAME_TOPFIELDFIRST	0x02
129 #define HFI_INTERLACE_INTERLEAVE_FRAME_BOTTOMFIELDFIRST	0x04
130 #define HFI_INTERLACE_FRAME_TOPFIELDFIRST		0x08
131 #define HFI_INTERLACE_FRAME_BOTTOMFIELDFIRST		0x10
132 
133 /*
134  * HFI_PROPERTY_PARAM_OX_START
135  * HFI_DOMAIN_BASE_COMMON + HFI_ARCH_OX_OFFSET + 0x1000
136  */
137 #define HFI_PROPERTY_PARAM_BUFFER_COUNT_ACTUAL				0x201001
138 #define HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO	0x201002
139 #define HFI_PROPERTY_PARAM_INTERLACE_FORMAT_SUPPORTED			0x201003
140 #define HFI_PROPERTY_PARAM_CHROMA_SITE					0x201004
141 #define HFI_PROPERTY_PARAM_EXTRA_DATA_HEADER_CONFIG			0x201005
142 #define HFI_PROPERTY_PARAM_INDEX_EXTRADATA				0x201006
143 #define HFI_PROPERTY_PARAM_DIVX_FORMAT					0x201007
144 #define HFI_PROPERTY_PARAM_BUFFER_ALLOC_MODE				0x201008
145 #define HFI_PROPERTY_PARAM_S3D_FRAME_PACKING_EXTRADATA			0x201009
146 #define HFI_PROPERTY_PARAM_ERR_DETECTION_CODE_EXTRADATA			0x20100a
147 #define HFI_PROPERTY_PARAM_BUFFER_ALLOC_MODE_SUPPORTED			0x20100b
148 #define HFI_PROPERTY_PARAM_BUFFER_SIZE_ACTUAL				0x20100c
149 #define HFI_PROPERTY_PARAM_BUFFER_DISPLAY_HOLD_COUNT_ACTUAL		0x20100d
150 
151 /*
152  * HFI_PROPERTY_CONFIG_OX_START
153  * HFI_DOMAIN_BASE_COMMON + HFI_ARCH_OX_OFFSET + 0x2000
154  */
155 #define HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS		0x202001
156 #define HFI_PROPERTY_CONFIG_REALTIME			0x202002
157 #define HFI_PROPERTY_CONFIG_PRIORITY			0x202003
158 #define HFI_PROPERTY_CONFIG_BATCH_INFO			0x202004
159 
160 /*
161  * HFI_PROPERTY_PARAM_VDEC_OX_START	\
162  * HFI_DOMAIN_BASE_VDEC + HFI_ARCH_OX_OFFSET + 0x3000
163  */
164 #define HFI_PROPERTY_PARAM_VDEC_CONTINUE_DATA_TRANSFER		0x1203001
165 #define HFI_PROPERTY_PARAM_VDEC_DISPLAY_PICTURE_BUFFER_COUNT	0x1203002
166 #define HFI_PROPERTY_PARAM_VDEC_MULTI_VIEW_SELECT		0x1203003
167 #define HFI_PROPERTY_PARAM_VDEC_PICTURE_TYPE_DECODE		0x1203004
168 #define HFI_PROPERTY_PARAM_VDEC_OUTPUT_ORDER			0x1203005
169 #define HFI_PROPERTY_PARAM_VDEC_MB_QUANTIZATION			0x1203006
170 #define HFI_PROPERTY_PARAM_VDEC_NUM_CONCEALED_MB		0x1203007
171 #define HFI_PROPERTY_PARAM_VDEC_H264_ENTROPY_SWITCHING		0x1203008
172 #define HFI_PROPERTY_PARAM_VDEC_OUTPUT2_KEEP_ASPECT_RATIO	0x1203009
173 #define HFI_PROPERTY_PARAM_VDEC_FRAME_RATE_EXTRADATA		0x120300a
174 #define HFI_PROPERTY_PARAM_VDEC_PANSCAN_WNDW_EXTRADATA		0x120300b
175 #define HFI_PROPERTY_PARAM_VDEC_RECOVERY_POINT_SEI_EXTRADATA	0x120300c
176 #define HFI_PROPERTY_PARAM_VDEC_THUMBNAIL_MODE			0x120300d
177 #define HFI_PROPERTY_PARAM_VDEC_FRAME_ASSEMBLY			0x120300e
178 #define HFI_PROPERTY_PARAM_VDEC_VC1_FRAMEDISP_EXTRADATA		0x1203011
179 #define HFI_PROPERTY_PARAM_VDEC_VC1_SEQDISP_EXTRADATA		0x1203012
180 #define HFI_PROPERTY_PARAM_VDEC_TIMESTAMP_EXTRADATA		0x1203013
181 #define HFI_PROPERTY_PARAM_VDEC_INTERLACE_VIDEO_EXTRADATA	0x1203014
182 #define HFI_PROPERTY_PARAM_VDEC_AVC_SESSION_SELECT		0x1203015
183 #define HFI_PROPERTY_PARAM_VDEC_MPEG2_SEQDISP_EXTRADATA		0x1203016
184 #define HFI_PROPERTY_PARAM_VDEC_STREAM_USERDATA_EXTRADATA	0x1203017
185 #define HFI_PROPERTY_PARAM_VDEC_FRAME_QP_EXTRADATA		0x1203018
186 #define HFI_PROPERTY_PARAM_VDEC_FRAME_BITS_INFO_EXTRADATA	0x1203019
187 #define HFI_PROPERTY_PARAM_VDEC_SCS_THRESHOLD			0x120301a
188 
189 /*
190  * HFI_PROPERTY_CONFIG_VDEC_OX_START
191  * HFI_DOMAIN_BASE_VDEC + HFI_ARCH_OX_OFFSET + 0x0000
192  */
193 #define HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER		0x1200001
194 #define HFI_PROPERTY_CONFIG_VDEC_MB_ERROR_MAP_REPORTING		0x1200002
195 #define HFI_PROPERTY_CONFIG_VDEC_MB_ERROR_MAP			0x1200003
196 
197 #define HFI_PROPERTY_CONFIG_VDEC_ENTROPY			0x1204004
198 
199 /*
200  * HFI_PROPERTY_PARAM_VENC_OX_START
201  * HFI_DOMAIN_BASE_VENC + HFI_ARCH_OX_OFFSET + 0x5000
202  */
203 #define  HFI_PROPERTY_PARAM_VENC_MULTI_SLICE_INFO		0x2205001
204 #define  HFI_PROPERTY_PARAM_VENC_H264_IDR_S3D_FRAME_PACKING_NAL	0x2205002
205 #define  HFI_PROPERTY_PARAM_VENC_LTR_INFO			0x2205003
206 #define  HFI_PROPERTY_PARAM_VENC_MBI_DUMPING			0x2205005
207 
208 /*
209  * HFI_PROPERTY_CONFIG_VENC_OX_START
210  * HFI_DOMAIN_BASE_VENC + HFI_ARCH_OX_OFFSET + 0x6000
211  */
212 #define HFI_PROPERTY_CONFIG_VENC_FRAME_QP			0x2206001
213 
214 /*
215  * HFI_PROPERTY_PARAM_VPE_OX_START
216  * HFI_DOMAIN_BASE_VPE + HFI_ARCH_OX_OFFSET + 0x7000
217  */
218 #define HFI_PROPERTY_PARAM_VPE_COLOR_SPACE_CONVERSION		0x3207001
219 
220 #define HFI_PROPERTY_CONFIG_VPE_OX_START	\
221 	(HFI_DOMAIN_BASE_VPE + HFI_ARCH_OX_OFFSET + 0x8000)
222 
223 #define HFI_CHROMA_SITE_0			0x1000001
224 #define HFI_CHROMA_SITE_1			0x1000002
225 #define HFI_CHROMA_SITE_2			0x1000003
226 #define HFI_CHROMA_SITE_3			0x1000004
227 #define HFI_CHROMA_SITE_4			0x1000005
228 #define HFI_CHROMA_SITE_5			0x1000006
229 
230 #define HFI_PRIORITY_LOW			10
231 #define HFI_PRIOIRTY_MEDIUM			20
232 #define HFI_PRIORITY_HIGH			30
233 
234 #define HFI_OUTPUT_ORDER_DISPLAY		0x1000001
235 #define HFI_OUTPUT_ORDER_DECODE			0x1000002
236 
237 #define HFI_RATE_CONTROL_OFF			0x1000001
238 #define HFI_RATE_CONTROL_VBR_VFR		0x1000002
239 #define HFI_RATE_CONTROL_VBR_CFR		0x1000003
240 #define HFI_RATE_CONTROL_CBR_VFR		0x1000004
241 #define HFI_RATE_CONTROL_CBR_CFR		0x1000005
242 
243 #define HFI_VIDEO_CODEC_H264			0x00000002
244 #define HFI_VIDEO_CODEC_H263			0x00000004
245 #define HFI_VIDEO_CODEC_MPEG1			0x00000008
246 #define HFI_VIDEO_CODEC_MPEG2			0x00000010
247 #define HFI_VIDEO_CODEC_MPEG4			0x00000020
248 #define HFI_VIDEO_CODEC_DIVX_311		0x00000040
249 #define HFI_VIDEO_CODEC_DIVX			0x00000080
250 #define HFI_VIDEO_CODEC_VC1			0x00000100
251 #define HFI_VIDEO_CODEC_SPARK			0x00000200
252 #define HFI_VIDEO_CODEC_VP8			0x00001000
253 #define HFI_VIDEO_CODEC_HEVC			0x00002000
254 #define HFI_VIDEO_CODEC_VP9			0x00004000
255 #define HFI_VIDEO_CODEC_HEVC_HYBRID		0x80000000
256 
257 #define HFI_H264_PROFILE_BASELINE		0x00000001
258 #define HFI_H264_PROFILE_MAIN			0x00000002
259 #define HFI_H264_PROFILE_HIGH			0x00000004
260 #define HFI_H264_PROFILE_STEREO_HIGH		0x00000008
261 #define HFI_H264_PROFILE_MULTIVIEW_HIGH		0x00000010
262 #define HFI_H264_PROFILE_CONSTRAINED_BASE	0x00000020
263 #define HFI_H264_PROFILE_CONSTRAINED_HIGH	0x00000040
264 
265 #define HFI_H264_LEVEL_1			0x00000001
266 #define HFI_H264_LEVEL_1b			0x00000002
267 #define HFI_H264_LEVEL_11			0x00000004
268 #define HFI_H264_LEVEL_12			0x00000008
269 #define HFI_H264_LEVEL_13			0x00000010
270 #define HFI_H264_LEVEL_2			0x00000020
271 #define HFI_H264_LEVEL_21			0x00000040
272 #define HFI_H264_LEVEL_22			0x00000080
273 #define HFI_H264_LEVEL_3			0x00000100
274 #define HFI_H264_LEVEL_31			0x00000200
275 #define HFI_H264_LEVEL_32			0x00000400
276 #define HFI_H264_LEVEL_4			0x00000800
277 #define HFI_H264_LEVEL_41			0x00001000
278 #define HFI_H264_LEVEL_42			0x00002000
279 #define HFI_H264_LEVEL_5			0x00004000
280 #define HFI_H264_LEVEL_51			0x00008000
281 #define HFI_H264_LEVEL_52			0x00010000
282 
283 #define HFI_H263_PROFILE_BASELINE		0x00000001
284 
285 #define HFI_H263_LEVEL_10			0x00000001
286 #define HFI_H263_LEVEL_20			0x00000002
287 #define HFI_H263_LEVEL_30			0x00000004
288 #define HFI_H263_LEVEL_40			0x00000008
289 #define HFI_H263_LEVEL_45			0x00000010
290 #define HFI_H263_LEVEL_50			0x00000020
291 #define HFI_H263_LEVEL_60			0x00000040
292 #define HFI_H263_LEVEL_70			0x00000080
293 
294 #define HFI_MPEG2_PROFILE_SIMPLE		0x00000001
295 #define HFI_MPEG2_PROFILE_MAIN			0x00000002
296 #define HFI_MPEG2_PROFILE_422			0x00000004
297 #define HFI_MPEG2_PROFILE_SNR			0x00000008
298 #define HFI_MPEG2_PROFILE_SPATIAL		0x00000010
299 #define HFI_MPEG2_PROFILE_HIGH			0x00000020
300 
301 #define HFI_MPEG2_LEVEL_LL			0x00000001
302 #define HFI_MPEG2_LEVEL_ML			0x00000002
303 #define HFI_MPEG2_LEVEL_H14			0x00000004
304 #define HFI_MPEG2_LEVEL_HL			0x00000008
305 
306 #define HFI_MPEG4_PROFILE_SIMPLE		0x00000001
307 #define HFI_MPEG4_PROFILE_ADVANCEDSIMPLE	0x00000002
308 
309 #define HFI_MPEG4_LEVEL_0			0x00000001
310 #define HFI_MPEG4_LEVEL_0b			0x00000002
311 #define HFI_MPEG4_LEVEL_1			0x00000004
312 #define HFI_MPEG4_LEVEL_2			0x00000008
313 #define HFI_MPEG4_LEVEL_3			0x00000010
314 #define HFI_MPEG4_LEVEL_4			0x00000020
315 #define HFI_MPEG4_LEVEL_4a			0x00000040
316 #define HFI_MPEG4_LEVEL_5			0x00000080
317 #define HFI_MPEG4_LEVEL_6			0x00000100
318 #define HFI_MPEG4_LEVEL_7			0x00000200
319 #define HFI_MPEG4_LEVEL_8			0x00000400
320 #define HFI_MPEG4_LEVEL_9			0x00000800
321 #define HFI_MPEG4_LEVEL_3b			0x00001000
322 
323 #define HFI_VC1_PROFILE_SIMPLE			0x00000001
324 #define HFI_VC1_PROFILE_MAIN			0x00000002
325 #define HFI_VC1_PROFILE_ADVANCED		0x00000004
326 
327 #define HFI_VC1_LEVEL_LOW			0x00000001
328 #define HFI_VC1_LEVEL_MEDIUM			0x00000002
329 #define HFI_VC1_LEVEL_HIGH			0x00000004
330 #define HFI_VC1_LEVEL_0				0x00000008
331 #define HFI_VC1_LEVEL_1				0x00000010
332 #define HFI_VC1_LEVEL_2				0x00000020
333 #define HFI_VC1_LEVEL_3				0x00000040
334 #define HFI_VC1_LEVEL_4				0x00000080
335 
336 #define HFI_VPX_PROFILE_SIMPLE			0x00000001
337 #define HFI_VPX_PROFILE_ADVANCED		0x00000002
338 #define HFI_VPX_PROFILE_VERSION_0		0x00000004
339 #define HFI_VPX_PROFILE_VERSION_1		0x00000008
340 #define HFI_VPX_PROFILE_VERSION_2		0x00000010
341 #define HFI_VPX_PROFILE_VERSION_3		0x00000020
342 
343 #define HFI_DIVX_FORMAT_4			0x1
344 #define HFI_DIVX_FORMAT_5			0x2
345 #define HFI_DIVX_FORMAT_6			0x3
346 
347 #define HFI_DIVX_PROFILE_QMOBILE		0x00000001
348 #define HFI_DIVX_PROFILE_MOBILE			0x00000002
349 #define HFI_DIVX_PROFILE_MT			0x00000004
350 #define HFI_DIVX_PROFILE_HT			0x00000008
351 #define HFI_DIVX_PROFILE_HD			0x00000010
352 
353 #define HFI_HEVC_PROFILE_MAIN			0x00000001
354 #define HFI_HEVC_PROFILE_MAIN10			0x00000002
355 #define HFI_HEVC_PROFILE_MAIN_STILL_PIC		0x00000004
356 
357 #define HFI_HEVC_LEVEL_1			0x00000001
358 #define HFI_HEVC_LEVEL_2			0x00000002
359 #define HFI_HEVC_LEVEL_21			0x00000004
360 #define HFI_HEVC_LEVEL_3			0x00000008
361 #define HFI_HEVC_LEVEL_31			0x00000010
362 #define HFI_HEVC_LEVEL_4			0x00000020
363 #define HFI_HEVC_LEVEL_41			0x00000040
364 #define HFI_HEVC_LEVEL_5			0x00000080
365 #define HFI_HEVC_LEVEL_51			0x00000100
366 #define HFI_HEVC_LEVEL_52			0x00000200
367 #define HFI_HEVC_LEVEL_6			0x00000400
368 #define HFI_HEVC_LEVEL_61			0x00000800
369 #define HFI_HEVC_LEVEL_62			0x00001000
370 
371 #define HFI_HEVC_TIER_MAIN			0x1
372 #define HFI_HEVC_TIER_HIGH0			0x2
373 
374 #define HFI_BUFFER_INPUT			0x1
375 #define HFI_BUFFER_OUTPUT			0x2
376 #define HFI_BUFFER_OUTPUT2			0x3
377 #define HFI_BUFFER_INTERNAL_PERSIST		0x4
378 #define HFI_BUFFER_INTERNAL_PERSIST_1		0x5
379 #define HFI_BUFFER_INTERNAL_SCRATCH		0x1000001
380 #define HFI_BUFFER_EXTRADATA_INPUT		0x1000002
381 #define HFI_BUFFER_EXTRADATA_OUTPUT		0x1000003
382 #define HFI_BUFFER_EXTRADATA_OUTPUT2		0x1000004
383 #define HFI_BUFFER_INTERNAL_SCRATCH_1		0x1000005
384 #define HFI_BUFFER_INTERNAL_SCRATCH_2		0x1000006
385 
386 #define HFI_BUFFER_TYPE_MAX			11
387 
388 #define HFI_BUFFER_MODE_STATIC			0x1000001
389 #define HFI_BUFFER_MODE_RING			0x1000002
390 #define HFI_BUFFER_MODE_DYNAMIC			0x1000003
391 
392 #define HFI_VENC_PERFMODE_MAX_QUALITY		0x1
393 #define HFI_VENC_PERFMODE_POWER_SAVE		0x2
394 
395 /*
396  * HFI_PROPERTY_SYS_COMMON_START
397  * HFI_DOMAIN_BASE_COMMON + HFI_ARCH_COMMON_OFFSET + 0x0000
398  */
399 #define HFI_PROPERTY_SYS_DEBUG_CONFIG				0x1
400 #define HFI_PROPERTY_SYS_RESOURCE_OCMEM_REQUIREMENT_INFO	0x2
401 #define HFI_PROPERTY_SYS_CONFIG_VCODEC_CLKFREQ			0x3
402 #define HFI_PROPERTY_SYS_IDLE_INDICATOR				0x4
403 #define HFI_PROPERTY_SYS_CODEC_POWER_PLANE_CTRL			0x5
404 #define HFI_PROPERTY_SYS_IMAGE_VERSION				0x6
405 #define HFI_PROPERTY_SYS_CONFIG_COVERAGE			0x7
406 
407 /*
408  * HFI_PROPERTY_PARAM_COMMON_START
409  * HFI_DOMAIN_BASE_COMMON + HFI_ARCH_COMMON_OFFSET + 0x1000
410  */
411 #define HFI_PROPERTY_PARAM_FRAME_SIZE				0x1001
412 #define HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_INFO	0x1002
413 #define HFI_PROPERTY_PARAM_UNCOMPRESSED_FORMAT_SELECT		0x1003
414 #define HFI_PROPERTY_PARAM_UNCOMPRESSED_FORMAT_SUPPORTED	0x1004
415 #define HFI_PROPERTY_PARAM_PROFILE_LEVEL_CURRENT		0x1005
416 #define HFI_PROPERTY_PARAM_PROFILE_LEVEL_SUPPORTED		0x1006
417 #define HFI_PROPERTY_PARAM_CAPABILITY_SUPPORTED			0x1007
418 #define HFI_PROPERTY_PARAM_PROPERTIES_SUPPORTED			0x1008
419 #define HFI_PROPERTY_PARAM_CODEC_SUPPORTED			0x1009
420 #define HFI_PROPERTY_PARAM_NAL_STREAM_FORMAT_SUPPORTED		0x100a
421 #define HFI_PROPERTY_PARAM_NAL_STREAM_FORMAT_SELECT		0x100b
422 #define HFI_PROPERTY_PARAM_MULTI_VIEW_FORMAT			0x100c
423 #define HFI_PROPERTY_PARAM_MAX_SEQUENCE_HEADER_SIZE		0x100d
424 #define HFI_PROPERTY_PARAM_CODEC_MASK_SUPPORTED			0x100e
425 #define HFI_PROPERTY_PARAM_MVC_BUFFER_LAYOUT			0x100f
426 #define HFI_PROPERTY_PARAM_MAX_SESSIONS_SUPPORTED		0x1010
427 
428 /*
429  * HFI_PROPERTY_CONFIG_COMMON_START
430  * HFI_DOMAIN_BASE_COMMON + HFI_ARCH_COMMON_OFFSET + 0x2000
431  */
432 #define HFI_PROPERTY_CONFIG_FRAME_RATE				0x2001
433 
434 /*
435  * HFI_PROPERTY_PARAM_VDEC_COMMON_START
436  * HFI_DOMAIN_BASE_VDEC + HFI_ARCH_COMMON_OFFSET + 0x3000
437  */
438 #define HFI_PROPERTY_PARAM_VDEC_MULTI_STREAM			0x1003001
439 #define HFI_PROPERTY_PARAM_VDEC_CONCEAL_COLOR			0x1003002
440 #define HFI_PROPERTY_PARAM_VDEC_NONCP_OUTPUT2			0x1003003
441 
442 /*
443  * HFI_PROPERTY_CONFIG_VDEC_COMMON_START
444  * HFI_DOMAIN_BASE_VDEC + HFI_ARCH_COMMON_OFFSET + 0x4000
445  */
446 
447 /*
448  * HFI_PROPERTY_PARAM_VENC_COMMON_START
449  * HFI_DOMAIN_BASE_VENC + HFI_ARCH_COMMON_OFFSET + 0x5000
450  */
451 #define HFI_PROPERTY_PARAM_VENC_SLICE_DELIVERY_MODE		0x2005001
452 #define HFI_PROPERTY_PARAM_VENC_H264_ENTROPY_CONTROL		0x2005002
453 #define HFI_PROPERTY_PARAM_VENC_H264_DEBLOCK_CONTROL		0x2005003
454 #define HFI_PROPERTY_PARAM_VENC_RATE_CONTROL			0x2005004
455 #define HFI_PROPERTY_PARAM_VENC_H264_PICORDER_CNT_TYPE		0x2005005
456 #define HFI_PROPERTY_PARAM_VENC_SESSION_QP			0x2005006
457 #define HFI_PROPERTY_PARAM_VENC_MPEG4_AC_PREDICTION		0x2005007
458 #define HFI_PROPERTY_PARAM_VENC_SESSION_QP_RANGE		0x2005008
459 #define HFI_PROPERTY_PARAM_VENC_MPEG4_TIME_RESOLUTION		0x2005009
460 #define HFI_PROPERTY_PARAM_VENC_MPEG4_SHORT_HEADER		0x200500a
461 #define HFI_PROPERTY_PARAM_VENC_MPEG4_HEADER_EXTENSION		0x200500b
462 #define HFI_PROPERTY_PARAM_VENC_OPEN_GOP			0x200500c
463 #define HFI_PROPERTY_PARAM_VENC_INTRA_REFRESH			0x200500d
464 #define HFI_PROPERTY_PARAM_VENC_MULTI_SLICE_CONTROL		0x200500e
465 #define HFI_PROPERTY_PARAM_VENC_VBV_HRD_BUF_SIZE		0x200500f
466 #define HFI_PROPERTY_PARAM_VENC_QUALITY_VS_SPEED		0x2005010
467 #define HFI_PROPERTY_PARAM_VENC_ADVANCED			0x2005012
468 #define HFI_PROPERTY_PARAM_VENC_H264_SPS_ID			0x2005014
469 #define HFI_PROPERTY_PARAM_VENC_H264_PPS_ID			0x2005015
470 #define HFI_PROPERTY_PARAM_VENC_H264_GENERATE_AUDNAL		0x2005016
471 #define HFI_PROPERTY_PARAM_VENC_ASPECT_RATIO			0x2005017
472 #define HFI_PROPERTY_PARAM_VENC_NUMREF				0x2005018
473 #define HFI_PROPERTY_PARAM_VENC_MULTIREF_P			0x2005019
474 #define HFI_PROPERTY_PARAM_VENC_H264_NAL_SVC_EXT		0x200501b
475 #define HFI_PROPERTY_PARAM_VENC_LTRMODE				0x200501c
476 #define HFI_PROPERTY_PARAM_VENC_VIDEO_FULL_RANGE		0x200501d
477 #define HFI_PROPERTY_PARAM_VENC_H264_VUI_TIMING_INFO		0x200501e
478 #define HFI_PROPERTY_PARAM_VENC_VC1_PERF_CFG			0x200501f
479 #define HFI_PROPERTY_PARAM_VENC_MAX_NUM_B_FRAMES		0x2005020
480 #define HFI_PROPERTY_PARAM_VENC_H264_VUI_BITSTREAM_RESTRC	0x2005021
481 #define HFI_PROPERTY_PARAM_VENC_PRESERVE_TEXT_QUALITY		0x2005023
482 #define HFI_PROPERTY_PARAM_VENC_HIER_P_MAX_NUM_ENH_LAYER	0x2005026
483 #define HFI_PROPERTY_PARAM_VENC_DISABLE_RC_TIMESTAMP		0x2005027
484 #define HFI_PROPERTY_PARAM_VENC_INITIAL_QP			0x2005028
485 #define HFI_PROPERTY_PARAM_VENC_VPX_ERROR_RESILIENCE_MODE	0x2005029
486 #define HFI_PROPERTY_PARAM_VENC_HIER_B_MAX_NUM_ENH_LAYER	0x200502c
487 #define HFI_PROPERTY_PARAM_VENC_HIER_P_HYBRID_MODE		0x200502f
488 
489 /*
490  * HFI_PROPERTY_CONFIG_VENC_COMMON_START
491  * HFI_DOMAIN_BASE_VENC + HFI_ARCH_COMMON_OFFSET + 0x6000
492  */
493 #define HFI_PROPERTY_CONFIG_VENC_TARGET_BITRATE			0x2006001
494 #define HFI_PROPERTY_CONFIG_VENC_IDR_PERIOD			0x2006002
495 #define HFI_PROPERTY_CONFIG_VENC_INTRA_PERIOD			0x2006003
496 #define HFI_PROPERTY_CONFIG_VENC_REQUEST_SYNC_FRAME		0x2006004
497 #define HFI_PROPERTY_CONFIG_VENC_SLICE_SIZE			0x2006005
498 #define HFI_PROPERTY_CONFIG_VENC_MAX_BITRATE			0x2006007
499 #define HFI_PROPERTY_CONFIG_VENC_SYNC_FRAME_SEQUENCE_HEADER	0x2006008
500 #define HFI_PROPERTY_CONFIG_VENC_MARKLTRFRAME			0x2006009
501 #define HFI_PROPERTY_CONFIG_VENC_USELTRFRAME			0x200600a
502 #define HFI_PROPERTY_CONFIG_VENC_HIER_P_ENH_LAYER		0x200600b
503 #define HFI_PROPERTY_CONFIG_VENC_LTRPERIOD			0x200600c
504 #define HFI_PROPERTY_CONFIG_VENC_PERF_MODE			0x200600e
505 
506 /*
507  * HFI_PROPERTY_PARAM_VPE_COMMON_START
508  * HFI_DOMAIN_BASE_VPE + HFI_ARCH_COMMON_OFFSET + 0x7000
509  */
510 
511 /*
512  * HFI_PROPERTY_CONFIG_VPE_COMMON_START
513  * HFI_DOMAIN_BASE_VPE + HFI_ARCH_COMMON_OFFSET + 0x8000
514  */
515 #define HFI_PROPERTY_CONFIG_VPE_DEINTERLACE			0x3008001
516 #define HFI_PROPERTY_CONFIG_VPE_OPERATIONS			0x3008002
517 
518 enum hfi_version {
519 	HFI_VERSION_1XX,
520 	HFI_VERSION_3XX,
521 };
522 
523 struct hfi_buffer_info {
524 	u32 buffer_addr;
525 	u32 extradata_addr;
526 };
527 
528 struct hfi_bitrate {
529 	u32 bitrate;
530 	u32 layer_id;
531 };
532 
533 #define HFI_CAPABILITY_FRAME_WIDTH			0x01
534 #define HFI_CAPABILITY_FRAME_HEIGHT			0x02
535 #define HFI_CAPABILITY_MBS_PER_FRAME			0x03
536 #define HFI_CAPABILITY_MBS_PER_SECOND			0x04
537 #define HFI_CAPABILITY_FRAMERATE			0x05
538 #define HFI_CAPABILITY_SCALE_X				0x06
539 #define HFI_CAPABILITY_SCALE_Y				0x07
540 #define HFI_CAPABILITY_BITRATE				0x08
541 #define HFI_CAPABILITY_BFRAME				0x09
542 #define HFI_CAPABILITY_PEAKBITRATE			0x0a
543 #define HFI_CAPABILITY_HIER_P_NUM_ENH_LAYERS		0x10
544 #define HFI_CAPABILITY_ENC_LTR_COUNT			0x11
545 #define HFI_CAPABILITY_CP_OUTPUT2_THRESH		0x12
546 #define HFI_CAPABILITY_HIER_B_NUM_ENH_LAYERS		0x13
547 #define HFI_CAPABILITY_LCU_SIZE				0x14
548 #define HFI_CAPABILITY_HIER_P_HYBRID_NUM_ENH_LAYERS	0x15
549 #define HFI_CAPABILITY_MBS_PER_SECOND_POWERSAVE		0x16
550 
551 struct hfi_capability {
552 	u32 capability_type;
553 	u32 min;
554 	u32 max;
555 	u32 step_size;
556 };
557 
558 struct hfi_capabilities {
559 	u32 num_capabilities;
560 	struct hfi_capability data[1];
561 };
562 
563 #define HFI_DEBUG_MSG_LOW	0x01
564 #define HFI_DEBUG_MSG_MEDIUM	0x02
565 #define HFI_DEBUG_MSG_HIGH	0x04
566 #define HFI_DEBUG_MSG_ERROR	0x08
567 #define HFI_DEBUG_MSG_FATAL	0x10
568 #define HFI_DEBUG_MSG_PERF	0x20
569 
570 #define HFI_DEBUG_MODE_QUEUE	0x01
571 #define HFI_DEBUG_MODE_QDSS	0x02
572 
573 struct hfi_debug_config {
574 	u32 config;
575 	u32 mode;
576 };
577 
578 struct hfi_enable {
579 	u32 enable;
580 };
581 
582 #define HFI_H264_DB_MODE_DISABLE		0x1
583 #define HFI_H264_DB_MODE_SKIP_SLICE_BOUNDARY	0x2
584 #define HFI_H264_DB_MODE_ALL_BOUNDARY		0x3
585 
586 struct hfi_h264_db_control {
587 	u32 mode;
588 	s32 slice_alpha_offset;
589 	s32 slice_beta_offset;
590 };
591 
592 #define HFI_H264_ENTROPY_CAVLC			0x1
593 #define HFI_H264_ENTROPY_CABAC			0x2
594 
595 #define HFI_H264_CABAC_MODEL_0			0x1
596 #define HFI_H264_CABAC_MODEL_1			0x2
597 #define HFI_H264_CABAC_MODEL_2			0x3
598 
599 struct hfi_h264_entropy_control {
600 	u32 entropy_mode;
601 	u32 cabac_model;
602 };
603 
604 struct hfi_framerate {
605 	u32 buffer_type;
606 	u32 framerate;
607 };
608 
609 #define HFI_INTRA_REFRESH_NONE			0x1
610 #define HFI_INTRA_REFRESH_CYCLIC		0x2
611 #define HFI_INTRA_REFRESH_ADAPTIVE		0x3
612 #define HFI_INTRA_REFRESH_CYCLIC_ADAPTIVE	0x4
613 #define HFI_INTRA_REFRESH_RANDOM		0x5
614 
615 struct hfi_intra_refresh {
616 	u32 mode;
617 	u32 air_mbs;
618 	u32 air_ref;
619 	u32 cir_mbs;
620 };
621 
622 struct hfi_intra_refresh_3x {
623 	u32 mode;
624 	u32 mbs;
625 };
626 
627 struct hfi_idr_period {
628 	u32 idr_period;
629 };
630 
631 struct hfi_operations_type {
632 	u32 rotation;
633 	u32 flip;
634 };
635 
636 struct hfi_max_num_b_frames {
637 	u32 max_num_b_frames;
638 };
639 
640 struct hfi_vc1e_perf_cfg_type {
641 	u32 search_range_x_subsampled[3];
642 	u32 search_range_y_subsampled[3];
643 };
644 
645 struct hfi_conceal_color {
646 	u32 conceal_color;
647 };
648 
649 struct hfi_intra_period {
650 	u32 pframes;
651 	u32 bframes;
652 };
653 
654 struct hfi_mpeg4_header_extension {
655 	u32 header_extension;
656 };
657 
658 struct hfi_mpeg4_time_resolution {
659 	u32 time_increment_resolution;
660 };
661 
662 struct hfi_multi_stream {
663 	u32 buffer_type;
664 	u32 enable;
665 	u32 width;
666 	u32 height;
667 };
668 
669 struct hfi_multi_stream_3x {
670 	u32 buffer_type;
671 	u32 enable;
672 };
673 
674 struct hfi_multi_view_format {
675 	u32 views;
676 	u32 view_order[1];
677 };
678 
679 #define HFI_MULTI_SLICE_OFF			0x1
680 #define HFI_MULTI_SLICE_BY_MB_COUNT		0x2
681 #define HFI_MULTI_SLICE_BY_BYTE_COUNT		0x3
682 #define HFI_MULTI_SLICE_GOB			0x4
683 
684 struct hfi_multi_slice_control {
685 	u32 multi_slice;
686 	u32 slice_size;
687 };
688 
689 #define HFI_NAL_FORMAT_STARTCODES		0x01
690 #define HFI_NAL_FORMAT_ONE_NAL_PER_BUFFER	0x02
691 #define HFI_NAL_FORMAT_ONE_BYTE_LENGTH		0x04
692 #define HFI_NAL_FORMAT_TWO_BYTE_LENGTH		0x08
693 #define HFI_NAL_FORMAT_FOUR_BYTE_LENGTH		0x10
694 
695 struct hfi_nal_stream_format {
696 	u32 format;
697 };
698 
699 struct hfi_nal_stream_format_select {
700 	u32 format;
701 };
702 
703 #define HFI_PICTURE_TYPE_I			0x01
704 #define HFI_PICTURE_TYPE_P			0x02
705 #define HFI_PICTURE_TYPE_B			0x04
706 #define HFI_PICTURE_TYPE_IDR			0x08
707 
708 struct hfi_profile_level {
709 	u32 profile;
710 	u32 level;
711 };
712 
713 #define HFI_MAX_PROFILE_COUNT			16
714 
715 struct hfi_profile_level_supported {
716 	u32 profile_count;
717 	struct hfi_profile_level profile_level[1];
718 };
719 
720 struct hfi_quality_vs_speed {
721 	u32 quality_vs_speed;
722 };
723 
724 struct hfi_quantization {
725 	u32 qp_i;
726 	u32 qp_p;
727 	u32 qp_b;
728 	u32 layer_id;
729 };
730 
731 struct hfi_initial_quantization {
732 	u32 qp_i;
733 	u32 qp_p;
734 	u32 qp_b;
735 	u32 init_qp_enable;
736 };
737 
738 struct hfi_quantization_range {
739 	u32 min_qp;
740 	u32 max_qp;
741 	u32 layer_id;
742 };
743 
744 #define HFI_LTR_MODE_DISABLE	0x0
745 #define HFI_LTR_MODE_MANUAL	0x1
746 #define HFI_LTR_MODE_PERIODIC	0x2
747 
748 struct hfi_ltr_mode {
749 	u32 ltr_mode;
750 	u32 ltr_count;
751 	u32 trust_mode;
752 };
753 
754 struct hfi_ltr_use {
755 	u32 ref_ltr;
756 	u32 use_constrnt;
757 	u32 frames;
758 };
759 
760 struct hfi_ltr_mark {
761 	u32 mark_frame;
762 };
763 
764 struct hfi_framesize {
765 	u32 buffer_type;
766 	u32 width;
767 	u32 height;
768 };
769 
770 struct hfi_h264_vui_timing_info {
771 	u32 enable;
772 	u32 fixed_framerate;
773 	u32 time_scale;
774 };
775 
776 #define HFI_COLOR_FORMAT_MONOCHROME		0x01
777 #define HFI_COLOR_FORMAT_NV12			0x02
778 #define HFI_COLOR_FORMAT_NV21			0x03
779 #define HFI_COLOR_FORMAT_NV12_4x4TILE		0x04
780 #define HFI_COLOR_FORMAT_NV21_4x4TILE		0x05
781 #define HFI_COLOR_FORMAT_YUYV			0x06
782 #define HFI_COLOR_FORMAT_YVYU			0x07
783 #define HFI_COLOR_FORMAT_UYVY			0x08
784 #define HFI_COLOR_FORMAT_VYUY			0x09
785 #define HFI_COLOR_FORMAT_RGB565			0x0a
786 #define HFI_COLOR_FORMAT_BGR565			0x0b
787 #define HFI_COLOR_FORMAT_RGB888			0x0c
788 #define HFI_COLOR_FORMAT_BGR888			0x0d
789 #define HFI_COLOR_FORMAT_YUV444			0x0e
790 #define HFI_COLOR_FORMAT_RGBA8888		0x10
791 
792 #define HFI_COLOR_FORMAT_UBWC_BASE		0x8000
793 #define HFI_COLOR_FORMAT_10_BIT_BASE		0x4000
794 
795 #define HFI_COLOR_FORMAT_YUV420_TP10		0x4002
796 #define HFI_COLOR_FORMAT_NV12_UBWC		0x8002
797 #define HFI_COLOR_FORMAT_YUV420_TP10_UBWC	0xc002
798 #define HFI_COLOR_FORMAT_RGBA8888_UBWC		0x8010
799 
800 struct hfi_uncompressed_format_select {
801 	u32 buffer_type;
802 	u32 format;
803 };
804 
805 struct hfi_uncompressed_format_supported {
806 	u32 buffer_type;
807 	u32 format_entries;
808 	u32 format_info[1];
809 };
810 
811 struct hfi_uncompressed_plane_actual {
812 	int actual_stride;
813 	u32 actual_plane_buffer_height;
814 };
815 
816 struct hfi_uncompressed_plane_actual_info {
817 	u32 buffer_type;
818 	u32 num_planes;
819 	struct hfi_uncompressed_plane_actual plane_format[1];
820 };
821 
822 struct hfi_uncompressed_plane_constraints {
823 	u32 stride_multiples;
824 	u32 max_stride;
825 	u32 min_plane_buffer_height_multiple;
826 	u32 buffer_alignment;
827 };
828 
829 struct hfi_uncompressed_plane_info {
830 	u32 format;
831 	u32 num_planes;
832 	struct hfi_uncompressed_plane_constraints plane_format[1];
833 };
834 
835 struct hfi_uncompressed_plane_actual_constraints_info {
836 	u32 buffer_type;
837 	u32 num_planes;
838 	struct hfi_uncompressed_plane_constraints plane_format[1];
839 };
840 
841 struct hfi_codec_supported {
842 	u32 dec_codecs;
843 	u32 enc_codecs;
844 };
845 
846 struct hfi_properties_supported {
847 	u32 num_properties;
848 	u32 properties[1];
849 };
850 
851 struct hfi_max_sessions_supported {
852 	u32 max_sessions;
853 };
854 
855 #define HFI_MAX_MATRIX_COEFFS	9
856 #define HFI_MAX_BIAS_COEFFS	3
857 #define HFI_MAX_LIMIT_COEFFS	6
858 
859 struct hfi_vpe_color_space_conversion {
860 	u32 csc_matrix[HFI_MAX_MATRIX_COEFFS];
861 	u32 csc_bias[HFI_MAX_BIAS_COEFFS];
862 	u32 csc_limit[HFI_MAX_LIMIT_COEFFS];
863 };
864 
865 #define HFI_ROTATE_NONE		0x1
866 #define HFI_ROTATE_90		0x2
867 #define HFI_ROTATE_180		0x3
868 #define HFI_ROTATE_270		0x4
869 
870 #define HFI_FLIP_NONE		0x1
871 #define HFI_FLIP_HORIZONTAL	0x2
872 #define HFI_FLIP_VERTICAL	0x3
873 
874 struct hfi_operations {
875 	u32 rotate;
876 	u32 flip;
877 };
878 
879 #define HFI_RESOURCE_OCMEM	0x1
880 
881 struct hfi_resource_ocmem {
882 	u32 size;
883 	u32 mem;
884 };
885 
886 struct hfi_resource_ocmem_requirement {
887 	u32 session_domain;
888 	u32 width;
889 	u32 height;
890 	u32 size;
891 };
892 
893 struct hfi_resource_ocmem_requirement_info {
894 	u32 num_entries;
895 	struct hfi_resource_ocmem_requirement requirements[1];
896 };
897 
898 struct hfi_property_sys_image_version_info_type {
899 	u32 string_size;
900 	u8  str_image_version[1];
901 };
902 
903 struct hfi_codec_mask_supported {
904 	u32 codecs;
905 	u32 video_domains;
906 };
907 
908 struct hfi_seq_header_info {
909 	u32 max_hader_len;
910 };
911 
912 struct hfi_aspect_ratio {
913 	u32 aspect_width;
914 	u32 aspect_height;
915 };
916 
917 #define HFI_MVC_BUFFER_LAYOUT_TOP_BOTTOM	0
918 #define HFI_MVC_BUFFER_LAYOUT_SIDEBYSIDE	1
919 #define HFI_MVC_BUFFER_LAYOUT_SEQ		2
920 
921 struct hfi_mvc_buffer_layout_descp_type {
922 	u32 layout_type;
923 	u32 bright_view_first;
924 	u32 ngap;
925 };
926 
927 struct hfi_scs_threshold {
928 	u32 threshold_value;
929 };
930 
931 #define HFI_TEST_SSR_SW_ERR_FATAL	0x1
932 #define HFI_TEST_SSR_SW_DIV_BY_ZERO	0x2
933 #define HFI_TEST_SSR_HW_WDOG_IRQ	0x3
934 
935 struct hfi_buffer_alloc_mode {
936 	u32 type;
937 	u32 mode;
938 };
939 
940 struct hfi_index_extradata_config {
941 	u32 enable;
942 	u32 index_extra_data_id;
943 };
944 
945 struct hfi_extradata_header {
946 	u32 size;
947 	u32 version;
948 	u32 port_index;
949 	u32 type;
950 	u32 data_size;
951 	u8 data[1];
952 };
953 
954 struct hfi_batch_info {
955 	u32 input_batch_count;
956 	u32 output_batch_count;
957 };
958 
959 struct hfi_buffer_count_actual {
960 	u32 type;
961 	u32 count_actual;
962 };
963 
964 struct hfi_buffer_size_actual {
965 	u32 type;
966 	u32 size;
967 };
968 
969 struct hfi_buffer_display_hold_count_actual {
970 	u32 type;
971 	u32 hold_count;
972 };
973 
974 struct hfi_buffer_requirements {
975 	u32 type;
976 	u32 size;
977 	u32 region_size;
978 	u32 hold_count;
979 	u32 count_min;
980 	u32 count_actual;
981 	u32 contiguous;
982 	u32 alignment;
983 };
984 
985 struct hfi_data_payload {
986 	u32 size;
987 	u8 data[1];
988 };
989 
990 struct hfi_enable_picture {
991 	u32 picture_type;
992 };
993 
994 struct hfi_display_picture_buffer_count {
995 	int enable;
996 	u32 count;
997 };
998 
999 struct hfi_extra_data_header_config {
1000 	u32 type;
1001 	u32 buffer_type;
1002 	u32 version;
1003 	u32 port_index;
1004 	u32 client_extra_data_id;
1005 };
1006 
1007 struct hfi_interlace_format_supported {
1008 	u32 buffer_type;
1009 	u32 format;
1010 };
1011 
1012 struct hfi_buffer_alloc_mode_supported {
1013 	u32 buffer_type;
1014 	u32 num_entries;
1015 	u32 data[1];
1016 };
1017 
1018 struct hfi_mb_error_map {
1019 	u32 error_map_size;
1020 	u8 error_map[1];
1021 };
1022 
1023 struct hfi_metadata_pass_through {
1024 	int enable;
1025 	u32 size;
1026 };
1027 
1028 struct hfi_multi_view_select {
1029 	u32 view_index;
1030 };
1031 
1032 struct hfi_hybrid_hierp {
1033 	u32 layers;
1034 };
1035 
1036 struct hfi_pkt_hdr {
1037 	u32 size;
1038 	u32 pkt_type;
1039 };
1040 
1041 struct hfi_session_hdr_pkt {
1042 	struct hfi_pkt_hdr hdr;
1043 	u32 session_id;
1044 };
1045 
1046 struct hfi_session_pkt {
1047 	struct hfi_session_hdr_pkt shdr;
1048 };
1049 
1050 #endif
1051