Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9b3ab33 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: Reset stats buffers during overflow recovery"

parents 104b1b72 8a428239
Loading
Loading
Loading
Loading
+47 −0
Original line number Diff line number Diff line
@@ -567,6 +567,53 @@ static int msm_isp_stats_update_cgc_override(struct vfe_device *vfe_dev,
	return 0;
}

int msm_isp_stats_reset(struct vfe_device *vfe_dev)
{
	int i = 0;
	struct msm_vfe_stats_stream *stream_info = NULL;
	struct msm_vfe_stats_shared_data *stats_data = &vfe_dev->stats_data;
	struct msm_isp_bufq *bufq = NULL;

	for (i = 0; i < MSM_ISP_STATS_MAX; i++) {
		stream_info = &stats_data->stream_info[i];
		if (stream_info->state != STATS_ACTIVE)
			continue;

		bufq = vfe_dev->buf_mgr->ops->get_bufq(vfe_dev->buf_mgr,
			stream_info->bufq_handle);
		if (!bufq) {
			pr_err("%s Error! bufq is NULL\n", __func__);
			continue;
		}

		if (bufq->buf_type != ISP_SHARE_BUF)
			msm_isp_deinit_stats_ping_pong_reg(vfe_dev,
				stream_info);
		else
			vfe_dev->buf_mgr->ops->flush_buf(vfe_dev->buf_mgr,
				stream_info->bufq_handle,
				MSM_ISP_BUFFER_FLUSH_ALL);
	}

	return 0;
}

int msm_isp_stats_restart(struct vfe_device *vfe_dev)
{
	int i = 0;
	struct msm_vfe_stats_stream *stream_info = NULL;
	struct msm_vfe_stats_shared_data *stats_data = &vfe_dev->stats_data;

	for (i = 0; i < MSM_ISP_STATS_MAX; i++) {
		stream_info = &stats_data->stream_info[i];
			if (stream_info->state < STATS_ACTIVE)
				continue;
		msm_isp_init_stats_ping_pong_reg(vfe_dev, stream_info);
	}

	return 0;
}

static int msm_isp_start_stats_stream(struct vfe_device *vfe_dev,
	struct msm_vfe_stats_stream_cfg_cmd *stream_cfg_cmd)
{
+2 −0
Original line number Diff line number Diff line
@@ -25,4 +25,6 @@ int msm_isp_release_stats_stream(struct vfe_device *vfe_dev, void *arg);
int msm_isp_request_stats_stream(struct vfe_device *vfe_dev, void *arg);
void msm_isp_update_stats_framedrop_reg(struct vfe_device *vfe_dev);
void msm_isp_stats_disable(struct vfe_device *vfe_dev);
int msm_isp_stats_reset(struct vfe_device *vfe_dev);
int msm_isp_stats_restart(struct vfe_device *vfe_dev);
#endif /* __MSM_ISP_STATS_UTIL_H__ */
+4 −2
Original line number Diff line number Diff line
@@ -809,12 +809,14 @@ static long msm_isp_ioctl_unlocked(struct v4l2_subdev *sd,
		break;
	case VIDIOC_MSM_ISP_AXI_RESET:
		mutex_lock(&vfe_dev->core_mutex);
		rc = msm_isp_axi_reset(vfe_dev, arg);
		rc = msm_isp_stats_reset(vfe_dev);
		rc |= msm_isp_axi_reset(vfe_dev, arg);
		mutex_unlock(&vfe_dev->core_mutex);
		break;
	case VIDIOC_MSM_ISP_AXI_RESTART:
		mutex_lock(&vfe_dev->core_mutex);
		rc = msm_isp_axi_restart(vfe_dev, arg);
		rc = msm_isp_stats_restart(vfe_dev);
		rc |= msm_isp_axi_restart(vfe_dev, arg);
		mutex_unlock(&vfe_dev->core_mutex);
		break;
	case VIDIOC_MSM_ISP_INPUT_CFG: