| .. | .. |
|---|
| 146 | 146 | struct rkisp_buffer *params_buf = to_rkisp_buffer(vbuf); |
|---|
| 147 | 147 | struct vb2_queue *vq = vb->vb2_queue; |
|---|
| 148 | 148 | struct rkisp_isp_params_vdev *params_vdev = vq->drv_priv; |
|---|
| 149 | + struct rkisp_device *dev = params_vdev->dev; |
|---|
| 149 | 150 | void *first_param; |
|---|
| 150 | 151 | unsigned long flags; |
|---|
| 151 | 152 | unsigned int cur_frame_id = -1; |
|---|
| 152 | 153 | |
|---|
| 153 | | - cur_frame_id = atomic_read(¶ms_vdev->dev->isp_sdev.frm_sync_seq) - 1; |
|---|
| 154 | + cur_frame_id = atomic_read(&dev->isp_sdev.frm_sync_seq) - 1; |
|---|
| 154 | 155 | if (params_vdev->first_params) { |
|---|
| 155 | 156 | first_param = vb2_plane_vaddr(vb, 0); |
|---|
| 156 | 157 | params_vdev->ops->save_first_param(params_vdev, first_param); |
|---|
| .. | .. |
|---|
| 159 | 160 | vb2_buffer_done(¶ms_buf->vb.vb2_buf, VB2_BUF_STATE_DONE); |
|---|
| 160 | 161 | params_vdev->first_params = false; |
|---|
| 161 | 162 | wake_up(¶ms_vdev->dev->sync_onoff); |
|---|
| 162 | | - if (params_vdev->dev->is_first_double) { |
|---|
| 163 | | - dev_info(params_vdev->dev->dev, "first params for fast\n"); |
|---|
| 164 | | - params_vdev->dev->is_first_double = false; |
|---|
| 165 | | - rkisp_trigger_read_back(params_vdev->dev, false, false, false); |
|---|
| 163 | + if (dev->is_first_double) { |
|---|
| 164 | + dev_info(dev->dev, "first params for fast\n"); |
|---|
| 165 | + dev->is_first_double = false; |
|---|
| 166 | + dev->sw_rd_cnt = 0; |
|---|
| 167 | + if (dev->hw_dev->unite == ISP_UNITE_ONE) { |
|---|
| 168 | + dev->unite_index = ISP_UNITE_LEFT; |
|---|
| 169 | + dev->sw_rd_cnt += dev->hw_dev->is_multi_overflow ? 3 : 1; |
|---|
| 170 | + } |
|---|
| 171 | + params_vdev->rdbk_times = dev->sw_rd_cnt + 1; |
|---|
| 172 | + rkisp_trigger_read_back(dev, false, false, false); |
|---|
| 166 | 173 | } |
|---|
| 167 | | - dev_info(params_vdev->dev->dev, "first params buf queue\n"); |
|---|
| 174 | + dev_info(dev->dev, "first params buf queue\n"); |
|---|
| 168 | 175 | return; |
|---|
| 169 | 176 | } |
|---|
| 170 | 177 | |
|---|
| 171 | | - if (params_vdev->dev->procfs.mode & |
|---|
| 178 | + if (dev->procfs.mode & |
|---|
| 172 | 179 | (RKISP_PROCFS_FIL_AIQ | RKISP_PROCFS_FIL_SW)) { |
|---|
| 173 | 180 | vb2_buffer_done(¶ms_buf->vb.vb2_buf, VB2_BUF_STATE_DONE); |
|---|
| 174 | 181 | return; |
|---|
| .. | .. |
|---|
| 208 | 215 | break; |
|---|
| 209 | 216 | } |
|---|
| 210 | 217 | |
|---|
| 211 | | - if (buf) |
|---|
| 212 | | - vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); |
|---|
| 213 | | - buf = NULL; |
|---|
| 218 | + vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); |
|---|
| 214 | 219 | } |
|---|
| 215 | 220 | |
|---|
| 216 | 221 | if (params_vdev->cur_buf) { |
|---|
| .. | .. |
|---|
| 284 | 289 | return ret; |
|---|
| 285 | 290 | } |
|---|
| 286 | 291 | |
|---|
| 292 | +static __poll_t rkisp_params_fop_poll(struct file *file, poll_table *wait) |
|---|
| 293 | +{ |
|---|
| 294 | + struct video_device *vdev = video_devdata(file); |
|---|
| 295 | + |
|---|
| 296 | + /* buf done or subscribe event */ |
|---|
| 297 | + if (vdev->queue->owner == file->private_data) |
|---|
| 298 | + return vb2_fop_poll(file, wait); |
|---|
| 299 | + else |
|---|
| 300 | + return v4l2_ctrl_poll(file, wait); |
|---|
| 301 | +} |
|---|
| 302 | + |
|---|
| 287 | 303 | struct v4l2_file_operations rkisp_params_fops = { |
|---|
| 288 | 304 | .mmap = vb2_fop_mmap, |
|---|
| 289 | 305 | .unlocked_ioctl = video_ioctl2, |
|---|
| 290 | | - .poll = vb2_fop_poll, |
|---|
| 306 | + .poll = rkisp_params_fop_poll, |
|---|
| 291 | 307 | .open = rkisp_params_fh_open, |
|---|
| 292 | 308 | .release = rkisp_params_fop_release |
|---|
| 293 | 309 | }; |
|---|
| .. | .. |
|---|
| 395 | 411 | stream->out_isp_fmt.fmt_type == FMT_RGB) |
|---|
| 396 | 412 | rkisp_unite_set_bits(dev, ISP3X_MI_WR_CTRL, mask, |
|---|
| 397 | 413 | quantization == V4L2_QUANTIZATION_FULL_RANGE ? |
|---|
| 398 | | - mask : 0, |
|---|
| 399 | | - false, dev->hw_dev->is_unite); |
|---|
| 414 | + mask : 0, false); |
|---|
| 400 | 415 | dev->isp_sdev.quantization = quantization; |
|---|
| 401 | 416 | } |
|---|
| 402 | 417 | } |
|---|