vcd_property.h 11 KB

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