Vinay Kalia | b559874 | 2011-12-21 16:52:33 -0800 | [diff] [blame] | 1 | /* 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 Menon | 4093ccc | 2012-03-09 12:19:22 -0800 | [diff] [blame] | 53 | #define VCD_I_ENABLE_SPS_PPS_FOR_IDR (VCD_START_BASE + 0x25) |
Vinay Kalia | 700f5c2 | 2012-03-28 17:35:28 -0700 | [diff] [blame] | 54 | #define VCD_REQ_PERF_LEVEL (VCD_START_BASE + 0x26) |
Pradnya Chaphekar | cd681bf | 2012-02-18 23:05:56 -0800 | [diff] [blame] | 55 | #define VCD_I_SLICE_DELIVERY_MODE (VCD_START_BASE + 0x27) |
Deva Ramasubramanian | 4947d8c | 2012-04-03 12:41:06 -0700 | [diff] [blame] | 56 | #define VCD_I_VOP_TIMING_CONSTANT_DELTA (VCD_START_BASE + 0x28) |
Vinay Kalia | b559874 | 2011-12-21 16:52:33 -0800 | [diff] [blame] | 57 | |
| 58 | #define VCD_START_REQ (VCD_START_BASE + 0x1000) |
| 59 | #define VCD_I_REQ_IFRAME (VCD_START_REQ + 0x1) |
| 60 | |
| 61 | #define VCD_I_RESERVED_BASE (VCD_START_BASE + 0x10000) |
| 62 | |
| 63 | struct vcd_property_hdr { |
| 64 | u32 prop_id; |
| 65 | size_t sz; |
| 66 | }; |
| 67 | |
| 68 | struct vcd_property_live { |
| 69 | u32 live; |
| 70 | }; |
| 71 | |
| 72 | enum vcd_codec { |
| 73 | VCD_CODEC_H264 = 0x1, |
| 74 | VCD_CODEC_H263 = 0x2, |
| 75 | VCD_CODEC_MPEG1 = 0x3, |
| 76 | VCD_CODEC_MPEG2 = 0x4, |
| 77 | VCD_CODEC_MPEG4 = 0x5, |
| 78 | VCD_CODEC_DIVX_3 = 0x6, |
| 79 | VCD_CODEC_DIVX_4 = 0x7, |
| 80 | VCD_CODEC_DIVX_5 = 0x8, |
| 81 | VCD_CODEC_DIVX_6 = 0x9, |
| 82 | VCD_CODEC_XVID = 0xA, |
| 83 | VCD_CODEC_VC1 = 0xB, |
| 84 | VCD_CODEC_VC1_RCV = 0xC |
| 85 | }; |
| 86 | |
| 87 | struct vcd_property_codec { |
| 88 | enum vcd_codec codec; |
| 89 | }; |
| 90 | |
| 91 | struct vcd_property_frame_size { |
| 92 | u32 width; |
| 93 | u32 height; |
| 94 | u32 stride; |
| 95 | u32 scan_lines; |
| 96 | }; |
| 97 | |
Vinay Kalia | 700f5c2 | 2012-03-28 17:35:28 -0700 | [diff] [blame] | 98 | enum vcd_perf_level { |
| 99 | VCD_PERF_LEVEL0, |
| 100 | VCD_PERF_LEVEL1, |
| 101 | VCD_PERF_LEVEL2, |
Deva Ramasubramanian | 837ae36 | 2012-05-12 23:26:53 -0700 | [diff] [blame^] | 102 | VCD_PERF_LEVEL_TURBO, |
Vinay Kalia | 700f5c2 | 2012-03-28 17:35:28 -0700 | [diff] [blame] | 103 | }; |
Vinay Kalia | b559874 | 2011-12-21 16:52:33 -0800 | [diff] [blame] | 104 | |
| 105 | #define VCD_METADATA_DATANONE 0x001 |
| 106 | #define VCD_METADATA_QCOMFILLER 0x002 |
| 107 | #define VCD_METADATA_QPARRAY 0x004 |
| 108 | #define VCD_METADATA_CONCEALMB 0x008 |
| 109 | #define VCD_METADATA_SEI 0x010 |
| 110 | #define VCD_METADATA_VUI 0x020 |
| 111 | #define VCD_METADATA_VC1 0x040 |
| 112 | #define VCD_METADATA_PASSTHROUGH 0x080 |
| 113 | #define VCD_METADATA_ENC_SLICE 0x100 |
| 114 | |
| 115 | struct vcd_property_meta_data_enable { |
| 116 | u32 meta_data_enable_flag; |
| 117 | }; |
| 118 | |
| 119 | struct vcd_property_metadata_hdr { |
| 120 | u32 meta_data_id; |
| 121 | u32 version; |
| 122 | u32 port_index; |
| 123 | u32 type; |
| 124 | }; |
| 125 | |
| 126 | struct vcd_property_frame_rate { |
| 127 | u32 fps_denominator; |
| 128 | u32 fps_numerator; |
| 129 | }; |
| 130 | |
| 131 | struct vcd_property_target_bitrate { |
| 132 | u32 target_bitrate; |
| 133 | }; |
| 134 | |
Vinay Kalia | 700f5c2 | 2012-03-28 17:35:28 -0700 | [diff] [blame] | 135 | struct vcd_property_perf_level { |
| 136 | enum vcd_perf_level level; |
| 137 | }; |
| 138 | |
Vinay Kalia | b559874 | 2011-12-21 16:52:33 -0800 | [diff] [blame] | 139 | enum vcd_yuv_buffer_format { |
| 140 | VCD_BUFFER_FORMAT_NV12 = 0x1, |
| 141 | VCD_BUFFER_FORMAT_TILE_4x2 = 0x2, |
| 142 | VCD_BUFFER_FORMAT_NV12_16M2KA = 0x3, |
| 143 | VCD_BUFFER_FORMAT_TILE_1x1 = 0x4 |
| 144 | }; |
| 145 | |
| 146 | struct vcd_property_buffer_format { |
| 147 | enum vcd_yuv_buffer_format buffer_format; |
| 148 | }; |
| 149 | |
| 150 | struct vcd_property_post_filter { |
| 151 | u32 post_filter; |
| 152 | }; |
| 153 | |
| 154 | enum vcd_codec_profile { |
| 155 | VCD_PROFILE_UNKNOWN = 0x0, |
| 156 | VCD_PROFILE_MPEG4_SP = 0x1, |
| 157 | VCD_PROFILE_MPEG4_ASP = 0x2, |
| 158 | VCD_PROFILE_H264_BASELINE = 0x3, |
| 159 | VCD_PROFILE_H264_MAIN = 0x4, |
| 160 | VCD_PROFILE_H264_HIGH = 0x5, |
| 161 | VCD_PROFILE_H263_BASELINE = 0x6, |
| 162 | VCD_PROFILE_VC1_SIMPLE = 0x7, |
| 163 | VCD_PROFILE_VC1_MAIN = 0x8, |
| 164 | VCD_PROFILE_VC1_ADVANCE = 0x9, |
| 165 | VCD_PROFILE_MPEG2_MAIN = 0xA, |
| 166 | VCD_PROFILE_MPEG2_SIMPLE = 0xB |
| 167 | }; |
| 168 | |
| 169 | struct vcd_property_profile { |
| 170 | enum vcd_codec_profile profile; |
| 171 | }; |
| 172 | |
| 173 | enum vcd_codec_level { |
| 174 | VCD_LEVEL_UNKNOWN = 0x0, |
| 175 | VCD_LEVEL_MPEG4_0 = 0x1, |
| 176 | VCD_LEVEL_MPEG4_0b = 0x2, |
| 177 | VCD_LEVEL_MPEG4_1 = 0x3, |
| 178 | VCD_LEVEL_MPEG4_2 = 0x4, |
| 179 | VCD_LEVEL_MPEG4_3 = 0x5, |
| 180 | VCD_LEVEL_MPEG4_3b = 0x6, |
| 181 | VCD_LEVEL_MPEG4_4 = 0x7, |
| 182 | VCD_LEVEL_MPEG4_4a = 0x8, |
| 183 | VCD_LEVEL_MPEG4_5 = 0x9, |
| 184 | VCD_LEVEL_MPEG4_6 = 0xA, |
| 185 | VCD_LEVEL_MPEG4_7 = 0xB, |
| 186 | VCD_LEVEL_MPEG4_X = 0xC, |
| 187 | VCD_LEVEL_H264_1 = 0x10, |
| 188 | VCD_LEVEL_H264_1b = 0x11, |
| 189 | VCD_LEVEL_H264_1p1 = 0x12, |
| 190 | VCD_LEVEL_H264_1p2 = 0x13, |
| 191 | VCD_LEVEL_H264_1p3 = 0x14, |
| 192 | VCD_LEVEL_H264_2 = 0x15, |
| 193 | VCD_LEVEL_H264_2p1 = 0x16, |
| 194 | VCD_LEVEL_H264_2p2 = 0x17, |
| 195 | VCD_LEVEL_H264_3 = 0x18, |
| 196 | VCD_LEVEL_H264_3p1 = 0x19, |
| 197 | VCD_LEVEL_H264_3p2 = 0x1A, |
| 198 | VCD_LEVEL_H264_4 = 0x1B, |
| 199 | VCD_LEVEL_H264_4p1 = 0x1C, |
| 200 | VCD_LEVEL_H264_4p2 = 0x1D, |
| 201 | VCD_LEVEL_H264_5 = 0x1E, |
| 202 | VCD_LEVEL_H264_5p1 = 0x1F, |
| 203 | VCD_LEVEL_H263_10 = 0x20, |
| 204 | VCD_LEVEL_H263_20 = 0x21, |
| 205 | VCD_LEVEL_H263_30 = 0x22, |
| 206 | VCD_LEVEL_H263_40 = 0x23, |
| 207 | VCD_LEVEL_H263_45 = 0x24, |
| 208 | VCD_LEVEL_H263_50 = 0x25, |
| 209 | VCD_LEVEL_H263_60 = 0x26, |
| 210 | VCD_LEVEL_H263_70 = 0x27, |
| 211 | VCD_LEVEL_H263_X = 0x28, |
| 212 | VCD_LEVEL_MPEG2_LOW = 0x30, |
| 213 | VCD_LEVEL_MPEG2_MAIN = 0x31, |
| 214 | VCD_LEVEL_MPEG2_HIGH_14 = 0x32, |
| 215 | VCD_LEVEL_MPEG2_HIGH = 0x33, |
| 216 | VCD_LEVEL_MPEG2_X = 0x34, |
| 217 | VCD_LEVEL_VC1_S_LOW = 0x40, |
| 218 | VCD_LEVEL_VC1_S_MEDIUM = 0x41, |
| 219 | VCD_LEVEL_VC1_M_LOW = 0x42, |
| 220 | VCD_LEVEL_VC1_M_MEDIUM = 0x43, |
| 221 | VCD_LEVEL_VC1_M_HIGH = 0x44, |
| 222 | VCD_LEVEL_VC1_A_0 = 0x45, |
| 223 | VCD_LEVEL_VC1_A_1 = 0x46, |
| 224 | VCD_LEVEL_VC1_A_2 = 0x47, |
| 225 | VCD_LEVEL_VC1_A_3 = 0x48, |
| 226 | VCD_LEVEL_VC1_A_4 = 0x49, |
| 227 | VCD_LEVEL_VC1_X = 0x4A |
| 228 | }; |
| 229 | |
| 230 | struct vcd_property_level { |
| 231 | enum vcd_codec_level level; |
| 232 | }; |
| 233 | |
| 234 | enum vcd_m_slice_sel { |
| 235 | VCD_MSLICE_OFF = 0x1, |
| 236 | VCD_MSLICE_BY_MB_COUNT = 0x2, |
| 237 | VCD_MSLICE_BY_BYTE_COUNT = 0x3, |
| 238 | VCD_MSLICE_BY_GOB = 0x4 |
| 239 | }; |
| 240 | |
| 241 | struct vcd_property_multi_slice { |
| 242 | enum vcd_m_slice_sel m_slice_sel; |
| 243 | u32 m_slice_size; |
| 244 | }; |
| 245 | |
| 246 | enum vcd_entropy_sel { |
| 247 | VCD_ENTROPY_SEL_CAVLC = 0x1, |
| 248 | VCD_ENTROPY_SEL_CABAC = 0x2 |
| 249 | }; |
| 250 | |
| 251 | enum vcd_cabac_model { |
| 252 | VCD_CABAC_MODEL_NUMBER_0 = 0x1, |
| 253 | VCD_CABAC_MODEL_NUMBER_1 = 0x2, |
| 254 | VCD_CABAC_MODEL_NUMBER_2 = 0x3 |
| 255 | }; |
| 256 | |
| 257 | struct vcd_property_entropy_control { |
| 258 | enum vcd_entropy_sel entropy_sel; |
| 259 | enum vcd_cabac_model cabac_model; |
| 260 | }; |
| 261 | |
| 262 | enum vcd_db_config { |
| 263 | VCD_DB_ALL_BLOCKING_BOUNDARY = 0x1, |
| 264 | VCD_DB_DISABLE = 0x2, |
| 265 | VCD_DB_SKIP_SLICE_BOUNDARY = 0x3 |
| 266 | }; |
| 267 | struct vcd_property_db_config { |
| 268 | enum vcd_db_config db_config; |
| 269 | u32 slice_alpha_offset; |
| 270 | u32 slice_beta_offset; |
| 271 | }; |
| 272 | |
| 273 | enum vcd_rate_control { |
| 274 | VCD_RATE_CONTROL_OFF = 0x1, |
| 275 | VCD_RATE_CONTROL_VBR_VFR = 0x2, |
| 276 | VCD_RATE_CONTROL_VBR_CFR = 0x3, |
| 277 | VCD_RATE_CONTROL_CBR_VFR = 0x4, |
| 278 | VCD_RATE_CONTROL_CBR_CFR = 0x5 |
| 279 | }; |
| 280 | |
| 281 | struct vcd_property_rate_control { |
| 282 | enum vcd_rate_control rate_control; |
| 283 | }; |
| 284 | |
| 285 | struct vcd_property_qp_range { |
| 286 | u32 max_qp; |
| 287 | u32 min_qp; |
| 288 | }; |
| 289 | |
| 290 | struct vcd_property_session_qp { |
| 291 | u32 i_frame_qp; |
| 292 | u32 p_frame_qp; |
| 293 | u32 b_frame_qp; |
| 294 | }; |
| 295 | |
| 296 | struct vcd_property_i_period { |
| 297 | u32 p_frames; |
| 298 | u32 b_frames; |
| 299 | }; |
| 300 | |
| 301 | struct vcd_property_vop_timing { |
| 302 | u32 vop_time_resolution; |
| 303 | }; |
| 304 | |
Deva Ramasubramanian | 4947d8c | 2012-04-03 12:41:06 -0700 | [diff] [blame] | 305 | struct vcd_property_vop_timing_constant_delta { |
| 306 | u32 constant_delta; /*In usecs */ |
| 307 | }; |
| 308 | |
Vinay Kalia | b559874 | 2011-12-21 16:52:33 -0800 | [diff] [blame] | 309 | struct vcd_property_short_header { |
| 310 | u32 short_header; |
| 311 | }; |
| 312 | |
| 313 | struct vcd_property_intra_refresh_mb_number { |
| 314 | u32 cir_mb_number; |
| 315 | }; |
| 316 | |
| 317 | struct vcd_property_req_i_frame { |
| 318 | u32 req_i_frame; |
| 319 | }; |
| 320 | |
| 321 | struct vcd_frame_rect { |
| 322 | u32 left; |
| 323 | u32 top; |
| 324 | u32 right; |
| 325 | u32 bottom; |
| 326 | }; |
| 327 | |
| 328 | struct vcd_property_dec_output_buffer { |
| 329 | struct vcd_frame_rect disp_frm; |
| 330 | struct vcd_property_frame_size frm_size; |
| 331 | }; |
| 332 | |
| 333 | enum vcd_output_order { |
| 334 | VCD_DEC_ORDER_DISPLAY = 0x0, |
| 335 | VCD_DEC_ORDER_DECODE = 0x1 |
| 336 | }; |
| 337 | |
| 338 | struct vcd_property_enc_recon_buffer { |
| 339 | u8 *user_virtual_addr; |
| 340 | u8 *kernel_virtual_addr; |
| 341 | u8 *physical_addr; |
| 342 | u8 *dev_addr; |
| 343 | u32 buffer_size; |
| 344 | u32 ysize; |
| 345 | int pmem_fd; |
| 346 | u32 offset; |
| 347 | void *client_data; |
| 348 | }; |
| 349 | |
| 350 | struct vcd_property_h264_mv_buffer { |
| 351 | u8 *kernel_virtual_addr; |
| 352 | u8 *physical_addr; |
| 353 | u32 size; |
| 354 | u32 count; |
| 355 | int pmem_fd; |
| 356 | u32 offset; |
| 357 | u8 *dev_addr; |
| 358 | void *client_data; |
| 359 | }; |
| 360 | |
| 361 | struct vcd_property_buffer_size { |
| 362 | int width; |
| 363 | int height; |
| 364 | int size; |
| 365 | int alignment; |
| 366 | }; |
| 367 | |
Arun Menon | 4093ccc | 2012-03-09 12:19:22 -0800 | [diff] [blame] | 368 | struct vcd_property_sps_pps_for_idr_enable { |
| 369 | u32 sps_pps_for_idr_enable_flag; |
| 370 | }; |
| 371 | |
Vinay Kalia | b559874 | 2011-12-21 16:52:33 -0800 | [diff] [blame] | 372 | #endif |