1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 **************************************************************************** 11 ****************************************************************************/ 12 #ifndef _MSM_VDEC_H_ 13 #define _MSM_VDEC_H_ 14 15 #include <linux/types.h> 16 17 #define VDEC_IOCTL_MAGIC 'v' 18 19 #define VDEC_IOCTL_INITIALIZE _IOWR(VDEC_IOCTL_MAGIC, 1, struct vdec_init) 20 #define VDEC_IOCTL_SETBUFFERS _IOW(VDEC_IOCTL_MAGIC, 2, struct vdec_buffer) 21 #define VDEC_IOCTL_QUEUE _IOWR(VDEC_IOCTL_MAGIC, 3, struct vdec_input_buf) 22 #define VDEC_IOCTL_REUSEFRAMEBUFFER _IOW(VDEC_IOCTL_MAGIC, 4, unsigned int) 23 #define VDEC_IOCTL_FLUSH _IOW(VDEC_IOCTL_MAGIC, 5, unsigned int) 24 #define VDEC_IOCTL_EOS _IO(VDEC_IOCTL_MAGIC, 6) 25 #define VDEC_IOCTL_GETMSG _IOR(VDEC_IOCTL_MAGIC, 7, struct vdec_msg) 26 #define VDEC_IOCTL_CLOSE _IO(VDEC_IOCTL_MAGIC, 8) 27 #define VDEC_IOCTL_FREEBUFFERS _IOW(VDEC_IOCTL_MAGIC, 9, struct vdec_buf_info) 28 #define VDEC_IOCTL_GETDECATTRIBUTES _IOR(VDEC_IOCTL_MAGIC, 10, struct vdec_dec_attributes) 29 30 enum { 31 VDEC_FRAME_DECODE_OK, 32 VDEC_FRAME_DECODE_ERR, 33 VDEC_FATAL_ERR, 34 VDEC_FLUSH_FINISH, 35 VDEC_EOS, 36 VDEC_FRAME_FLUSH, 37 VDEC_STREAM_SWITCH, 38 VDEC_SUSPEND_FINISH, 39 VDEC_BUFFER_CONSUMED 40 }; 41 42 enum { 43 VDEC_FLUSH_INPUT, 44 VDEC_FLUSH_OUTPUT, 45 VDEC_FLUSH_ALL 46 }; 47 48 enum { 49 VDEC_BUFFER_TYPE_INPUT, 50 VDEC_BUFFER_TYPE_OUTPUT, 51 VDEC_BUFFER_TYPE_INTERNAL1, 52 VDEC_BUFFER_TYPE_INTERNAL2, 53 }; 54 55 enum { 56 VDEC_QUEUE_SUCCESS, 57 VDEC_QUEUE_FAILED, 58 VDEC_QUEUE_BADSTATE, 59 }; 60 61 struct vdec_input_buf_info { 62 u32 offset; 63 u32 data; 64 u32 size; 65 int timestamp_lo; 66 int timestamp_hi; 67 int avsync_state; 68 u32 flags; 69 }; 70 71 struct vdec_buf_desc { 72 u32 bufsize; 73 u32 num_min_buffers; 74 u32 num_max_buffers; 75 }; 76 77 struct vdec_buf_req { 78 u32 max_input_queue_size; 79 struct vdec_buf_desc input; 80 struct vdec_buf_desc output; 81 struct vdec_buf_desc dec_req1; 82 struct vdec_buf_desc dec_req2; 83 }; 84 85 struct vdec_region_info { 86 u32 src_id; 87 u32 offset; 88 u32 size; 89 }; 90 91 struct vdec_config { 92 u32 fourcc; 93 u32 width; 94 u32 height; 95 u32 order; 96 u32 notify_enable; 97 u32 vc1_rowbase; 98 u32 h264_startcode_detect; 99 u32 h264_nal_len_size; 100 u32 postproc_flag; 101 u32 fruc_enable; 102 u32 reserved; 103 }; 104 105 struct vdec_vc1_panscan_regions { 106 int num; 107 int width[4]; 108 int height[4]; 109 int xoffset[4]; 110 int yoffset[4]; 111 }; 112 113 struct vdec_cropping_window { 114 u32 x1; 115 u32 y1; 116 u32 x2; 117 u32 y2; 118 }; 119 120 struct vdec_frame_info { 121 u32 status; 122 u32 offset; 123 u32 data1; 124 u32 data2; 125 int timestamp_lo; 126 int timestamp_hi; 127 int cal_timestamp_lo; 128 int cal_timestamp_hi; 129 u32 dec_width; 130 u32 dec_height; 131 struct vdec_cropping_window cwin; 132 u32 picture_type[2]; 133 u32 picture_format; 134 u32 vc1_rangeY; 135 u32 vc1_rangeUV; 136 u32 picture_resolution; 137 u32 frame_disp_repeat; 138 u32 repeat_first_field; 139 u32 top_field_first; 140 u32 interframe_interp; 141 struct vdec_vc1_panscan_regions panscan; 142 u32 concealed_macblk_num; 143 u32 flags; 144 u32 performance_stats; 145 u32 data3; 146 }; 147 148 struct vdec_buf_info { 149 u32 buf_type; 150 struct vdec_region_info region; 151 u32 num_buf; 152 u32 islast; 153 }; 154 155 struct vdec_buffer { 156 u32 pmem_id; 157 struct vdec_buf_info buf; 158 }; 159 160 struct vdec_sequence { 161 u8 *header; 162 u32 len; 163 }; 164 165 struct vdec_config_sps { 166 struct vdec_config cfg; 167 struct vdec_sequence seq; 168 }; 169 170 #define VDEC_MSG_REUSEINPUTBUFFER 1 171 #define VDEC_MSG_FRAMEDONE 2 172 173 struct vdec_msg { 174 u32 id; 175 176 union { 177 178 u32 buf_id; 179 180 struct vdec_frame_info vfr_info; 181 }; 182 }; 183 184 struct vdec_init { 185 struct vdec_config_sps sps_cfg; 186 struct vdec_buf_req *buf_req; 187 }; 188 189 struct vdec_input_buf { 190 u32 pmem_id; 191 struct vdec_input_buf_info buffer; 192 struct vdec_queue_status *queue_status; 193 }; 194 195 struct vdec_queue_status { 196 u32 status; 197 }; 198 199 struct vdec_dec_attributes { 200 u32 fourcc; 201 u32 profile; 202 u32 level; 203 u32 dec_pic_width; 204 u32 dec_pic_height; 205 struct vdec_buf_desc input; 206 struct vdec_buf_desc output; 207 struct vdec_buf_desc dec_req1; 208 struct vdec_buf_desc dec_req2; 209 }; 210 211 #endif 212 213