blob: 545dcd2f0818d3bd8fefa54511c138f0fb1ffe8b [file] [log] [blame]
Vinay Kaliab5598742011-12-21 16:52:33 -08001/* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13#ifndef _VCD_DRIVER_PROPERTY_H_
14#define _VCD_DRIVER_PROPERTY_H_
15
16#define VCD_START_BASE 0x0
17#define VCD_I_LIVE (VCD_START_BASE + 0x1)
18#define VCD_I_CODEC (VCD_START_BASE + 0x2)
19#define VCD_I_FRAME_SIZE (VCD_START_BASE + 0x3)
20#define VCD_I_METADATA_ENABLE (VCD_START_BASE + 0x4)
21#define VCD_I_METADATA_HEADER (VCD_START_BASE + 0x5)
22#define VCD_I_PROFILE (VCD_START_BASE + 0x6)
23#define VCD_I_LEVEL (VCD_START_BASE + 0x7)
24#define VCD_I_BUFFER_FORMAT (VCD_START_BASE + 0x8)
25#define VCD_I_FRAME_RATE (VCD_START_BASE + 0x9)
26#define VCD_I_TARGET_BITRATE (VCD_START_BASE + 0xA)
27#define VCD_I_MULTI_SLICE (VCD_START_BASE + 0xB)
28#define VCD_I_ENTROPY_CTRL (VCD_START_BASE + 0xC)
29#define VCD_I_DEBLOCKING (VCD_START_BASE + 0xD)
30#define VCD_I_RATE_CONTROL (VCD_START_BASE + 0xE)
31#define VCD_I_QP_RANGE (VCD_START_BASE + 0xF)
32#define VCD_I_SESSION_QP (VCD_START_BASE + 0x10)
33#define VCD_I_INTRA_PERIOD (VCD_START_BASE + 0x11)
34#define VCD_I_VOP_TIMING (VCD_START_BASE + 0x12)
35#define VCD_I_SHORT_HEADER (VCD_START_BASE + 0x13)
36#define VCD_I_SEQ_HEADER (VCD_START_BASE + 0x14)
37#define VCD_I_HEADER_EXTENSION (VCD_START_BASE + 0x15)
38#define VCD_I_INTRA_REFRESH (VCD_START_BASE + 0x16)
39#define VCD_I_POST_FILTER (VCD_START_BASE + 0x17)
40#define VCD_I_PROGRESSIVE_ONLY (VCD_START_BASE + 0x18)
41#define VCD_I_OUTPUT_ORDER (VCD_START_BASE + 0x19)
42#define VCD_I_RECON_BUFFERS (VCD_START_BASE + 0x1A)
43#define VCD_I_FREE_RECON_BUFFERS (VCD_START_BASE + 0x1B)
44#define VCD_I_GET_RECON_BUFFER_SIZE (VCD_START_BASE + 0x1C)
45#define VCD_I_H264_MV_BUFFER (VCD_START_BASE + 0x1D)
46#define VCD_I_FREE_H264_MV_BUFFER (VCD_START_BASE + 0x1E)
47#define VCD_I_GET_H264_MV_SIZE (VCD_START_BASE + 0x1F)
48#define VCD_I_DEC_PICTYPE (VCD_START_BASE + 0x20)
49#define VCD_I_CONT_ON_RECONFIG (VCD_START_BASE + 0x21)
50#define VCD_I_META_BUFFER_MODE (VCD_START_BASE + 0x22)
51#define VCD_I_DISABLE_DMX (VCD_START_BASE + 0x23)
52#define VCD_I_DISABLE_DMX_SUPPORT (VCD_START_BASE + 0x24)
Arun Menon4093ccc2012-03-09 12:19:22 -080053#define VCD_I_ENABLE_SPS_PPS_FOR_IDR (VCD_START_BASE + 0x25)
Vinay Kalia700f5c22012-03-28 17:35:28 -070054#define VCD_REQ_PERF_LEVEL (VCD_START_BASE + 0x26)
Pradnya Chaphekarcd681bf2012-02-18 23:05:56 -080055#define VCD_I_SLICE_DELIVERY_MODE (VCD_START_BASE + 0x27)
Deva Ramasubramanian4947d8c2012-04-03 12:41:06 -070056#define VCD_I_VOP_TIMING_CONSTANT_DELTA (VCD_START_BASE + 0x28)
Arun Menon152c3c72012-06-20 11:50:08 -070057#define VCD_I_SET_TURBO_CLK (VCD_START_BASE + 0x29)
Srinu Gorle12b0bc62012-09-05 13:02:13 +053058#define VCD_I_ENABLE_DELIMITER_FLAG (VCD_START_BASE + 0x2A)
Srinu Gorlea41d7772012-11-15 09:36:38 +053059#define VCD_I_ENABLE_VUI_TIMING_INFO (VCD_START_BASE + 0x2B)
60
Vinay Kaliab5598742011-12-21 16:52:33 -080061
62#define VCD_START_REQ (VCD_START_BASE + 0x1000)
63#define VCD_I_REQ_IFRAME (VCD_START_REQ + 0x1)
64
65#define VCD_I_RESERVED_BASE (VCD_START_BASE + 0x10000)
66
67struct vcd_property_hdr {
68 u32 prop_id;
69 size_t sz;
70};
71
72struct vcd_property_live {
73 u32 live;
74};
75
76enum vcd_codec {
77 VCD_CODEC_H264 = 0x1,
78 VCD_CODEC_H263 = 0x2,
79 VCD_CODEC_MPEG1 = 0x3,
80 VCD_CODEC_MPEG2 = 0x4,
81 VCD_CODEC_MPEG4 = 0x5,
82 VCD_CODEC_DIVX_3 = 0x6,
83 VCD_CODEC_DIVX_4 = 0x7,
84 VCD_CODEC_DIVX_5 = 0x8,
85 VCD_CODEC_DIVX_6 = 0x9,
86 VCD_CODEC_XVID = 0xA,
87 VCD_CODEC_VC1 = 0xB,
88 VCD_CODEC_VC1_RCV = 0xC
89};
90
91struct vcd_property_codec {
92 enum vcd_codec codec;
93};
94
95struct vcd_property_frame_size {
96 u32 width;
97 u32 height;
98 u32 stride;
99 u32 scan_lines;
100};
101
Vinay Kalia700f5c22012-03-28 17:35:28 -0700102enum vcd_perf_level {
103 VCD_PERF_LEVEL0,
104 VCD_PERF_LEVEL1,
105 VCD_PERF_LEVEL2,
Deva Ramasubramanian837ae362012-05-12 23:26:53 -0700106 VCD_PERF_LEVEL_TURBO,
Vinay Kalia700f5c22012-03-28 17:35:28 -0700107};
Vinay Kaliab5598742011-12-21 16:52:33 -0800108
109#define VCD_METADATA_DATANONE 0x001
110#define VCD_METADATA_QCOMFILLER 0x002
111#define VCD_METADATA_QPARRAY 0x004
112#define VCD_METADATA_CONCEALMB 0x008
113#define VCD_METADATA_SEI 0x010
114#define VCD_METADATA_VUI 0x020
115#define VCD_METADATA_VC1 0x040
116#define VCD_METADATA_PASSTHROUGH 0x080
117#define VCD_METADATA_ENC_SLICE 0x100
118
Shobhit Pandey833942e2012-08-01 14:02:20 +0530119#define VCD_METADATA_EXT_DATA 0x0800
120#define VCD_METADATA_USER_DATA 0x1000
121
Vinay Kaliab5598742011-12-21 16:52:33 -0800122struct vcd_property_meta_data_enable {
123 u32 meta_data_enable_flag;
124};
125
126struct vcd_property_metadata_hdr {
127 u32 meta_data_id;
128 u32 version;
129 u32 port_index;
130 u32 type;
131};
132
133struct vcd_property_frame_rate {
134 u32 fps_denominator;
135 u32 fps_numerator;
136};
137
138struct vcd_property_target_bitrate {
139 u32 target_bitrate;
140};
141
Vinay Kalia700f5c22012-03-28 17:35:28 -0700142struct vcd_property_perf_level {
143 enum vcd_perf_level level;
144};
145
Vinay Kaliab5598742011-12-21 16:52:33 -0800146enum vcd_yuv_buffer_format {
147 VCD_BUFFER_FORMAT_NV12 = 0x1,
148 VCD_BUFFER_FORMAT_TILE_4x2 = 0x2,
149 VCD_BUFFER_FORMAT_NV12_16M2KA = 0x3,
150 VCD_BUFFER_FORMAT_TILE_1x1 = 0x4
151};
152
153struct vcd_property_buffer_format {
154 enum vcd_yuv_buffer_format buffer_format;
155};
156
157struct vcd_property_post_filter {
158 u32 post_filter;
159};
160
161enum vcd_codec_profile {
162 VCD_PROFILE_UNKNOWN = 0x0,
163 VCD_PROFILE_MPEG4_SP = 0x1,
164 VCD_PROFILE_MPEG4_ASP = 0x2,
165 VCD_PROFILE_H264_BASELINE = 0x3,
166 VCD_PROFILE_H264_MAIN = 0x4,
167 VCD_PROFILE_H264_HIGH = 0x5,
168 VCD_PROFILE_H263_BASELINE = 0x6,
169 VCD_PROFILE_VC1_SIMPLE = 0x7,
170 VCD_PROFILE_VC1_MAIN = 0x8,
171 VCD_PROFILE_VC1_ADVANCE = 0x9,
172 VCD_PROFILE_MPEG2_MAIN = 0xA,
173 VCD_PROFILE_MPEG2_SIMPLE = 0xB
174};
175
176struct vcd_property_profile {
177 enum vcd_codec_profile profile;
178};
179
180enum vcd_codec_level {
181 VCD_LEVEL_UNKNOWN = 0x0,
182 VCD_LEVEL_MPEG4_0 = 0x1,
183 VCD_LEVEL_MPEG4_0b = 0x2,
184 VCD_LEVEL_MPEG4_1 = 0x3,
185 VCD_LEVEL_MPEG4_2 = 0x4,
186 VCD_LEVEL_MPEG4_3 = 0x5,
187 VCD_LEVEL_MPEG4_3b = 0x6,
188 VCD_LEVEL_MPEG4_4 = 0x7,
189 VCD_LEVEL_MPEG4_4a = 0x8,
190 VCD_LEVEL_MPEG4_5 = 0x9,
191 VCD_LEVEL_MPEG4_6 = 0xA,
192 VCD_LEVEL_MPEG4_7 = 0xB,
193 VCD_LEVEL_MPEG4_X = 0xC,
194 VCD_LEVEL_H264_1 = 0x10,
195 VCD_LEVEL_H264_1b = 0x11,
196 VCD_LEVEL_H264_1p1 = 0x12,
197 VCD_LEVEL_H264_1p2 = 0x13,
198 VCD_LEVEL_H264_1p3 = 0x14,
199 VCD_LEVEL_H264_2 = 0x15,
200 VCD_LEVEL_H264_2p1 = 0x16,
201 VCD_LEVEL_H264_2p2 = 0x17,
202 VCD_LEVEL_H264_3 = 0x18,
203 VCD_LEVEL_H264_3p1 = 0x19,
204 VCD_LEVEL_H264_3p2 = 0x1A,
205 VCD_LEVEL_H264_4 = 0x1B,
206 VCD_LEVEL_H264_4p1 = 0x1C,
207 VCD_LEVEL_H264_4p2 = 0x1D,
208 VCD_LEVEL_H264_5 = 0x1E,
209 VCD_LEVEL_H264_5p1 = 0x1F,
210 VCD_LEVEL_H263_10 = 0x20,
211 VCD_LEVEL_H263_20 = 0x21,
212 VCD_LEVEL_H263_30 = 0x22,
213 VCD_LEVEL_H263_40 = 0x23,
214 VCD_LEVEL_H263_45 = 0x24,
215 VCD_LEVEL_H263_50 = 0x25,
216 VCD_LEVEL_H263_60 = 0x26,
217 VCD_LEVEL_H263_70 = 0x27,
218 VCD_LEVEL_H263_X = 0x28,
219 VCD_LEVEL_MPEG2_LOW = 0x30,
220 VCD_LEVEL_MPEG2_MAIN = 0x31,
221 VCD_LEVEL_MPEG2_HIGH_14 = 0x32,
222 VCD_LEVEL_MPEG2_HIGH = 0x33,
223 VCD_LEVEL_MPEG2_X = 0x34,
224 VCD_LEVEL_VC1_S_LOW = 0x40,
225 VCD_LEVEL_VC1_S_MEDIUM = 0x41,
226 VCD_LEVEL_VC1_M_LOW = 0x42,
227 VCD_LEVEL_VC1_M_MEDIUM = 0x43,
228 VCD_LEVEL_VC1_M_HIGH = 0x44,
229 VCD_LEVEL_VC1_A_0 = 0x45,
230 VCD_LEVEL_VC1_A_1 = 0x46,
231 VCD_LEVEL_VC1_A_2 = 0x47,
232 VCD_LEVEL_VC1_A_3 = 0x48,
233 VCD_LEVEL_VC1_A_4 = 0x49,
234 VCD_LEVEL_VC1_X = 0x4A
235};
236
237struct vcd_property_level {
238 enum vcd_codec_level level;
239};
240
241enum vcd_m_slice_sel {
242 VCD_MSLICE_OFF = 0x1,
243 VCD_MSLICE_BY_MB_COUNT = 0x2,
244 VCD_MSLICE_BY_BYTE_COUNT = 0x3,
245 VCD_MSLICE_BY_GOB = 0x4
246};
247
248struct vcd_property_multi_slice {
249 enum vcd_m_slice_sel m_slice_sel;
250 u32 m_slice_size;
251};
252
253enum vcd_entropy_sel {
254 VCD_ENTROPY_SEL_CAVLC = 0x1,
255 VCD_ENTROPY_SEL_CABAC = 0x2
256};
257
258enum vcd_cabac_model {
259 VCD_CABAC_MODEL_NUMBER_0 = 0x1,
260 VCD_CABAC_MODEL_NUMBER_1 = 0x2,
261 VCD_CABAC_MODEL_NUMBER_2 = 0x3
262};
263
264struct vcd_property_entropy_control {
265 enum vcd_entropy_sel entropy_sel;
266 enum vcd_cabac_model cabac_model;
267};
268
269enum vcd_db_config {
270 VCD_DB_ALL_BLOCKING_BOUNDARY = 0x1,
271 VCD_DB_DISABLE = 0x2,
272 VCD_DB_SKIP_SLICE_BOUNDARY = 0x3
273};
274struct vcd_property_db_config {
275 enum vcd_db_config db_config;
276 u32 slice_alpha_offset;
277 u32 slice_beta_offset;
278};
279
280enum vcd_rate_control {
281 VCD_RATE_CONTROL_OFF = 0x1,
282 VCD_RATE_CONTROL_VBR_VFR = 0x2,
283 VCD_RATE_CONTROL_VBR_CFR = 0x3,
284 VCD_RATE_CONTROL_CBR_VFR = 0x4,
285 VCD_RATE_CONTROL_CBR_CFR = 0x5
286};
287
288struct vcd_property_rate_control {
289 enum vcd_rate_control rate_control;
290};
291
292struct vcd_property_qp_range {
293 u32 max_qp;
294 u32 min_qp;
295};
296
297struct vcd_property_session_qp {
298 u32 i_frame_qp;
299 u32 p_frame_qp;
300 u32 b_frame_qp;
301};
302
303struct vcd_property_i_period {
304 u32 p_frames;
305 u32 b_frames;
306};
307
308struct vcd_property_vop_timing {
309 u32 vop_time_resolution;
310};
311
Deva Ramasubramanian4947d8c2012-04-03 12:41:06 -0700312struct vcd_property_vop_timing_constant_delta {
313 u32 constant_delta; /*In usecs */
314};
315
Vinay Kaliab5598742011-12-21 16:52:33 -0800316struct vcd_property_short_header {
317 u32 short_header;
318};
319
320struct vcd_property_intra_refresh_mb_number {
321 u32 cir_mb_number;
322};
323
324struct vcd_property_req_i_frame {
325 u32 req_i_frame;
326};
327
328struct vcd_frame_rect {
329 u32 left;
330 u32 top;
331 u32 right;
332 u32 bottom;
333};
334
335struct vcd_property_dec_output_buffer {
336 struct vcd_frame_rect disp_frm;
337 struct vcd_property_frame_size frm_size;
338};
339
340enum vcd_output_order {
341 VCD_DEC_ORDER_DISPLAY = 0x0,
342 VCD_DEC_ORDER_DECODE = 0x1
343};
344
345struct vcd_property_enc_recon_buffer {
346 u8 *user_virtual_addr;
347 u8 *kernel_virtual_addr;
348 u8 *physical_addr;
349 u8 *dev_addr;
350 u32 buffer_size;
351 u32 ysize;
352 int pmem_fd;
353 u32 offset;
354 void *client_data;
355};
356
357struct vcd_property_h264_mv_buffer {
358 u8 *kernel_virtual_addr;
359 u8 *physical_addr;
360 u32 size;
361 u32 count;
362 int pmem_fd;
363 u32 offset;
364 u8 *dev_addr;
365 void *client_data;
366};
367
368struct vcd_property_buffer_size {
369 int width;
370 int height;
371 int size;
372 int alignment;
373};
374
Arun Menon4093ccc2012-03-09 12:19:22 -0800375struct vcd_property_sps_pps_for_idr_enable {
376 u32 sps_pps_for_idr_enable_flag;
377};
378
Srinu Gorle12b0bc62012-09-05 13:02:13 +0530379struct vcd_property_avc_delimiter_enable {
380 u32 avc_delimiter_enable_flag;
381};
382
Srinu Gorlea41d7772012-11-15 09:36:38 +0530383struct vcd_property_vui_timing_info_enable {
384 u32 vui_timing_info;
385};
386
Vinay Kaliab5598742011-12-21 16:52:33 -0800387#endif