| .. | .. |
|---|
| 45 | 45 | #include "isp_stats.h" |
|---|
| 46 | 46 | #include "isp_mipi_luma.h" |
|---|
| 47 | 47 | #include "procfs.h" |
|---|
| 48 | +#include "isp_external.h" |
|---|
| 48 | 49 | #include "version.h" |
|---|
| 49 | 50 | |
|---|
| 50 | 51 | #define DRIVER_NAME "rkisp" |
|---|
| 51 | 52 | #define ISP_VDEV_NAME DRIVER_NAME "_ispdev" |
|---|
| 52 | | -#define SP_VDEV_NAME DRIVER_NAME "_selfpath" |
|---|
| 53 | | -#define MP_VDEV_NAME DRIVER_NAME "_mainpath" |
|---|
| 54 | | -#define DMA_VDEV_NAME DRIVER_NAME "_dmapath" |
|---|
| 55 | | -#define RAW_VDEV_NAME DRIVER_NAME "_rawpath" |
|---|
| 56 | | -#define DMATX0_VDEV_NAME DRIVER_NAME "_rawwr0" |
|---|
| 57 | | -#define DMATX1_VDEV_NAME DRIVER_NAME "_rawwr1" |
|---|
| 58 | | -#define DMATX2_VDEV_NAME DRIVER_NAME "_rawwr2" |
|---|
| 59 | | -#define DMATX3_VDEV_NAME DRIVER_NAME "_rawwr3" |
|---|
| 60 | | -#define DMARX0_VDEV_NAME DRIVER_NAME "_rawrd0_m" |
|---|
| 61 | | -#define DMARX1_VDEV_NAME DRIVER_NAME "_rawrd1_l" |
|---|
| 62 | | -#define DMARX2_VDEV_NAME DRIVER_NAME "_rawrd2_s" |
|---|
| 63 | 53 | |
|---|
| 64 | 54 | #define GRP_ID_SENSOR BIT(0) |
|---|
| 65 | 55 | #define GRP_ID_MIPIPHY BIT(1) |
|---|
| .. | .. |
|---|
| 70 | 60 | #define GRP_ID_ISP_BRIDGE BIT(6) |
|---|
| 71 | 61 | #define GRP_ID_CSI BIT(7) |
|---|
| 72 | 62 | |
|---|
| 73 | | -#define RKISP_MAX_SENSOR 2 |
|---|
| 74 | | -#define RKISP_MAX_PIPELINE 4 |
|---|
| 63 | +#define RKISP_MAX_SENSOR 4 |
|---|
| 64 | +#define RKISP_MAX_PIPELINE 8 |
|---|
| 75 | 65 | |
|---|
| 76 | 66 | #define RKISP_MEDIA_BUS_FMT_MASK 0xF000 |
|---|
| 77 | 67 | #define RKISP_MEDIA_BUS_FMT_BAYER 0x3000 |
|---|
| .. | .. |
|---|
| 85 | 75 | ISP_FRAME_MP = BIT(3), |
|---|
| 86 | 76 | ISP_FRAME_SP = BIT(4), |
|---|
| 87 | 77 | ISP_FRAME_MPFBC = BIT(5), |
|---|
| 78 | + ISP_FRAME_BP = BIT(6), |
|---|
| 88 | 79 | |
|---|
| 89 | 80 | ISP_STOP = BIT(8), |
|---|
| 90 | 81 | ISP_START = BIT(9), |
|---|
| .. | .. |
|---|
| 158 | 149 | struct rkisp_hdr { |
|---|
| 159 | 150 | u8 op_mode; |
|---|
| 160 | 151 | u8 esp_mode; |
|---|
| 152 | + u8 compr_bit; |
|---|
| 161 | 153 | u8 index[HDR_DMA_MAX]; |
|---|
| 162 | 154 | atomic_t refcnt; |
|---|
| 163 | 155 | struct v4l2_subdev *sensor; |
|---|
| .. | .. |
|---|
| 190 | 182 | struct v4l2_ctrl_handler ctrl_handler; |
|---|
| 191 | 183 | struct media_device media_dev; |
|---|
| 192 | 184 | struct v4l2_async_notifier notifier; |
|---|
| 193 | | - struct v4l2_subdev *subdevs[RKISP_SD_MAX]; |
|---|
| 194 | 185 | struct rkisp_sensor_info *active_sensor; |
|---|
| 195 | 186 | struct rkisp_sensor_info sensors[RKISP_MAX_SENSOR]; |
|---|
| 196 | 187 | int num_sensors; |
|---|
| .. | .. |
|---|
| 202 | 193 | struct rkisp_csi_device csi_dev; |
|---|
| 203 | 194 | struct rkisp_bridge_device br_dev; |
|---|
| 204 | 195 | struct rkisp_luma_vdev luma_vdev; |
|---|
| 205 | | - struct proc_dir_entry *procfs; |
|---|
| 196 | + struct rkisp_procfs procfs; |
|---|
| 206 | 197 | struct rkisp_pipeline pipe; |
|---|
| 207 | 198 | enum rkisp_isp_ver isp_ver; |
|---|
| 208 | 199 | struct rkisp_emd_data emd_data_fifo[RKISP_EMDDATA_FIFO_MAX]; |
|---|
| .. | .. |
|---|
| 219 | 210 | struct mutex apilock; /* mutex to serialize the calls of stream */ |
|---|
| 220 | 211 | struct mutex iqlock; /* mutex to serialize the calls of iq */ |
|---|
| 221 | 212 | wait_queue_head_t sync_onoff; |
|---|
| 213 | + |
|---|
| 222 | 214 | dma_addr_t resmem_addr; |
|---|
| 223 | 215 | phys_addr_t resmem_pa; |
|---|
| 224 | 216 | size_t resmem_size; |
|---|
| 217 | + struct rkisp_thunderboot_resmem_head tb_head; |
|---|
| 218 | + bool is_thunderboot; |
|---|
| 219 | + struct rkisp_tb_stream_info tb_stream_info; |
|---|
| 220 | + unsigned int tb_addr_idx; |
|---|
| 221 | + |
|---|
| 225 | 222 | int dev_id; |
|---|
| 226 | 223 | unsigned int skip_frame; |
|---|
| 227 | 224 | unsigned int irq_ends; |
|---|
| .. | .. |
|---|
| 229 | 226 | bool send_fbcgain; |
|---|
| 230 | 227 | struct rkisp_ispp_buf *cur_fbcgain; |
|---|
| 231 | 228 | struct rkisp_buffer *cur_spbuf; |
|---|
| 232 | | - bool is_thunderboot; |
|---|
| 233 | 229 | |
|---|
| 230 | + struct work_struct rdbk_work; |
|---|
| 234 | 231 | struct kfifo rdbk_kfifo; |
|---|
| 235 | 232 | spinlock_t rdbk_lock; |
|---|
| 236 | 233 | int rdbk_cnt; |
|---|
| .. | .. |
|---|
| 238 | 235 | int rdbk_cnt_x2; |
|---|
| 239 | 236 | int rdbk_cnt_x3; |
|---|
| 240 | 237 | u32 rd_mode; |
|---|
| 241 | | - u8 filt_state[RDBK_F_MAX]; |
|---|
| 238 | + int sw_rd_cnt; |
|---|
| 239 | + |
|---|
| 240 | + struct rkisp_rx_buf_pool pv_pool[RKISP_RX_BUF_POOL_MAX]; |
|---|
| 241 | + |
|---|
| 242 | + struct mutex buf_lock; |
|---|
| 243 | + spinlock_t cmsk_lock; |
|---|
| 244 | + struct rkisp_cmsk_cfg cmsk_cfg; |
|---|
| 245 | + bool is_cmsk_upd; |
|---|
| 246 | + bool is_hw_link; |
|---|
| 247 | + bool is_bigmode; |
|---|
| 248 | + bool is_rdbk_auto; |
|---|
| 249 | + bool is_pre_on; |
|---|
| 250 | + bool is_first_double; |
|---|
| 251 | + bool is_probe_end; |
|---|
| 252 | + |
|---|
| 253 | + struct rkisp_vicap_input vicap_in; |
|---|
| 254 | + |
|---|
| 255 | + u8 multi_mode; |
|---|
| 256 | + u8 multi_index; |
|---|
| 257 | + u8 rawaf_irq_cnt; |
|---|
| 242 | 258 | }; |
|---|
| 243 | 259 | #endif |
|---|