diff options
| author | Andy Sun <bins@codeaurora.org> | 2018-05-29 16:23:52 +0800 |
|---|---|---|
| committer | Andy Sun <bins@codeaurora.org> | 2018-06-19 11:07:00 +0800 |
| commit | ab4b239854cf4999ca37f01c169b38c8123cbbee (patch) | |
| tree | 083feb35923988bc85fb898b5651ffbb68f6aece | |
| parent | 2763b994a1a1145eb8d538b35e7bab5156e1e351 (diff) | |
ais: support frame drop configuration for auto
Set hardware frame drop config in the start_stream().
New command for user to set frame drop during streaming.
Change-Id: I523c96366ebbe6d664262e66d3bf7ee2d1b28ee3
Signed-off-by: Andy Sun <bins@codeaurora.org>
| -rw-r--r-- | drivers/media/platform/msm/ais/isp/msm_isp_axi_util.c | 29 | ||||
| -rw-r--r-- | drivers/media/platform/msm/ais/isp/msm_isp_axi_util.h | 1 | ||||
| -rw-r--r-- | drivers/media/platform/msm/ais/isp/msm_isp_util.c | 5 | ||||
| -rw-r--r-- | include/uapi/media/ais/msm_ais_isp.h | 12 |
4 files changed, 46 insertions, 1 deletions
diff --git a/drivers/media/platform/msm/ais/isp/msm_isp_axi_util.c b/drivers/media/platform/msm/ais/isp/msm_isp_axi_util.c index bfccb06407f7..f135cfcd6ccd 100644 --- a/drivers/media/platform/msm/ais/isp/msm_isp_axi_util.c +++ b/drivers/media/platform/msm/ais/isp/msm_isp_axi_util.c @@ -2838,7 +2838,6 @@ static int msm_isp_start_axi_stream(struct vfe_device *vfe_dev, msm_isp_get_stream_wm_mask(stream_info, &wm_reload_mask); spin_lock_irqsave(&stream_info->lock, flags); - msm_isp_reset_framedrop(vfe_dev, stream_info); rc = msm_isp_init_stream_ping_pong_reg(vfe_dev, stream_info); if (rc < 0) { pr_err("%s: No buffer for stream%d\n", __func__, @@ -3586,6 +3585,11 @@ int msm_isp_axi_output_cfg(struct vfe_device *vfe_dev, void *arg) pstream_info, plane_idx); } + vfe_dev->hw_info->vfe_ops.axi_ops.cfg_framedrop( + vfe_dev->vfe_base, pstream_info, + pCmd->output_path_cfg[axi_src_idx].framedrop_pattern, + pCmd->output_path_cfg[axi_src_idx].framedrop_period); + if (axi_src_idx <= PIX_ENCODER && axi_src_idx <= IDEAL_RAW) { if (axi_src_idx == CAMIF_RAW) { vfe_dev->axi_data.src_info[VFE_PIX_0]. @@ -3626,6 +3630,29 @@ int msm_isp_axi_output_cfg(struct vfe_device *vfe_dev, void *arg) return rc; } +void msm_isp_framedrop_update(struct vfe_device *vfe_dev, void *arg) +{ + struct msm_vfe_axi_framedrop_update *pCmd = arg; + struct msm_vfe_axi_shared_data *axi_data = &vfe_dev->axi_data; + struct msm_vfe_axi_stream *pstream_info; + + pr_debug("%s: entry\n", __func__); + + if (pCmd->stream_src < VFE_AXI_SRC_MAX) { + + pstream_info = &axi_data->stream_info[pCmd->stream_src]; + + vfe_dev->hw_info->vfe_ops.axi_ops.cfg_framedrop( + vfe_dev->vfe_base, pstream_info, + pCmd->framedrop_pattern, + pCmd->framedrop_period); + + vfe_dev->hw_info->vfe_ops.core_ops.reg_update( + vfe_dev, SRC_TO_INTF(pstream_info->stream_src)); + } + + pr_debug("%s: exit\n", __func__); +} int msm_isp_update_axi_stream(struct vfe_device *vfe_dev, void *arg) { diff --git a/drivers/media/platform/msm/ais/isp/msm_isp_axi_util.h b/drivers/media/platform/msm/ais/isp/msm_isp_axi_util.h index 7babd750a05a..d695c4c0edf3 100644 --- a/drivers/media/platform/msm/ais/isp/msm_isp_axi_util.h +++ b/drivers/media/platform/msm/ais/isp/msm_isp_axi_util.h @@ -84,6 +84,7 @@ int msm_isp_axi_restart(struct vfe_device *vfe_dev, int msm_isp_axi_output_cfg(struct vfe_device *vfe_dev, void *arg); +void msm_isp_framedrop_update(struct vfe_device *vfe_dev, void *arg); void msm_isp_axi_stream_update(struct vfe_device *vfe_dev, enum msm_vfe_input_src frame_src); diff --git a/drivers/media/platform/msm/ais/isp/msm_isp_util.c b/drivers/media/platform/msm/ais/isp/msm_isp_util.c index 64a3c7cde26b..a9b6e5e6a861 100644 --- a/drivers/media/platform/msm/ais/isp/msm_isp_util.c +++ b/drivers/media/platform/msm/ais/isp/msm_isp_util.c @@ -1073,6 +1073,11 @@ static long msm_isp_ioctl_unlocked(struct v4l2_subdev *sd, rc = msm_isp_camif_cfg(vfe_dev, arg); mutex_unlock(&vfe_dev->core_mutex); break; + case VIDIOC_MSM_ISP_FRAMEDROP_UPDATE: + mutex_lock(&vfe_dev->core_mutex); + msm_isp_framedrop_update(vfe_dev, arg); + mutex_unlock(&vfe_dev->core_mutex); + break; case MSM_SD_NOTIFY_FREEZE: vfe_dev->isp_sof_debug = 0; vfe_dev->isp_raw0_debug = 0; diff --git a/include/uapi/media/ais/msm_ais_isp.h b/include/uapi/media/ais/msm_ais_isp.h index 2b4f0bfeb8c2..649173dd4404 100644 --- a/include/uapi/media/ais/msm_ais_isp.h +++ b/include/uapi/media/ais/msm_ais_isp.h @@ -936,6 +936,13 @@ struct msm_vfe_axi_output_plane_cfg { uint32_t frame_increment; }; +struct msm_vfe_axi_framedrop_update { + enum msm_vfe_axi_stream_src stream_src; + + uint8_t framedrop_period; + uint32_t framedrop_pattern; +}; + struct msm_vfe_axi_output_path_cfg { uint8_t enable; @@ -1003,6 +1010,7 @@ enum msm_isp_ioctl_cmd_code { MSM_ISP_SET_CLK_STATUS, MSM_ISP_CMD_EXT, + MSM_ISP_FRAMEDROP_UPDATE, }; @@ -1130,6 +1138,10 @@ enum msm_isp_ioctl_cmd_code { _IOWR('V', MSM_ISP_AXI_OUTPUT_CFG, \ struct msm_vfe_axi_output_cfg) +#define VIDIOC_MSM_ISP_FRAMEDROP_UPDATE \ + _IOWR('V', MSM_ISP_FRAMEDROP_UPDATE, \ + struct msm_vfe_axi_output_cfg) + #define VIDIOC_MSM_ISP_CAMIF_CFG \ _IOWR('V', MSM_ISP_CAMIF_CFG, \ struct msm_vfe_camif_cfg) |
