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

Commit 6261ed1f authored by Jing Zhou's avatar Jing Zhou Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: AV timer support for HAL3



Propagate AV timer timestamp as part of SOF, when VT is enabled

CRs-fixed: 1039601
Change-Id: Ic6bed924911a6db27e84b10921f6c6b400f1c8fb
Signed-off-by: default avatarNagesh Subba Reddy <nageshsreddy@codeaurora.org>
Signed-off-by: default avatarJing Zhou <jzhou70@codeaurora.org>
parent 8eefef21
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -1095,7 +1095,7 @@ void msm_isp_start_avtimer(void)
	avcs_core_disable_power_collapse(1);
}

static inline void msm_isp_get_avtimer_ts(
void msm_isp_get_avtimer_ts(
		struct msm_isp_timestamp *time_stamp)
{
	int rc = 0;
@@ -1123,7 +1123,7 @@ void msm_isp_start_avtimer(void)
	pr_err("AV Timer is not supported\n");
}

static inline void msm_isp_get_avtimer_ts(
void msm_isp_get_avtimer_ts(
		struct msm_isp_timestamp *time_stamp)
{
	pr_err_ratelimited("%s: Error: AVTimer driver not available\n",
@@ -2343,7 +2343,7 @@ int msm_isp_axi_reset(struct vfe_device *vfe_dev,
	rc = vfe_dev->hw_info->vfe_ops.core_ops.reset_hw(vfe_dev,
		0, reset_cmd->blocking);

	msm_isp_get_timestamp(&timestamp);
	msm_isp_get_timestamp(&timestamp, vfe_dev);

	for (i = 0, j = 0; j < axi_data->num_active_stream &&
		i < VFE_AXI_SRC_MAX; i++, j++) {
@@ -2835,7 +2835,7 @@ static int msm_isp_stop_axi_stream(struct vfe_device *vfe_dev,
		stream_cfg_cmd->num_streams == 0)
		return -EINVAL;

	msm_isp_get_timestamp(&timestamp);
	msm_isp_get_timestamp(&timestamp, vfe_dev);

	for (i = 0; i < stream_cfg_cmd->num_streams; i++) {
		if (HANDLE_TO_IDX(stream_cfg_cmd->stream_handle[i]) >=
@@ -3093,7 +3093,7 @@ static int msm_isp_return_empty_buffer(struct vfe_device *vfe_dev,
		return rc;
	}

	msm_isp_get_timestamp(&timestamp);
	msm_isp_get_timestamp(&timestamp, vfe_dev);
	buf->buf_debug.put_state[buf->buf_debug.put_state_last] =
		MSM_ISP_BUFFER_STATE_DROP_REG;
	buf->buf_debug.put_state_last ^= 1;
@@ -3414,7 +3414,7 @@ int msm_isp_update_axi_stream(struct vfe_device *vfe_dev, void *arg)
			stream_info = &axi_data->stream_info[HANDLE_TO_IDX(
				update_info->stream_handle)];
			stream_info->buf_divert = 0;
			msm_isp_get_timestamp(&timestamp);
			msm_isp_get_timestamp(&timestamp, vfe_dev);
			frame_id = vfe_dev->axi_data.src_info[
				SRC_TO_INTF(stream_info->stream_src)].frame_id;
			/* set ping pong address to scratch before flush */
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ void msm_isp_reset_framedrop(struct vfe_device *vfe_dev,
	struct msm_vfe_axi_stream *stream_info);

int msm_isp_request_axi_stream(struct vfe_device *vfe_dev, void *arg);
void msm_isp_get_avtimer_ts(struct msm_isp_timestamp *time_stamp);
int msm_isp_cfg_axi_stream(struct vfe_device *vfe_dev, void *arg);
int msm_isp_release_axi_stream(struct vfe_device *vfe_dev, void *arg);
int msm_isp_update_axi_stream(struct vfe_device *vfe_dev, void *arg);
+2 −2
Original line number Diff line number Diff line
@@ -621,7 +621,7 @@ int msm_isp_stats_reset(struct vfe_device *vfe_dev)
	struct msm_vfe_stats_shared_data *stats_data = &vfe_dev->stats_data;
	struct msm_isp_timestamp timestamp;

	msm_isp_get_timestamp(&timestamp);
	msm_isp_get_timestamp(&timestamp, vfe_dev);

	for (i = 0; i < MSM_ISP_STATS_MAX; i++) {
		stream_info = &stats_data->stream_info[i];
@@ -747,7 +747,7 @@ static int msm_isp_stop_stats_stream(struct vfe_device *vfe_dev,
	struct msm_vfe_stats_shared_data *stats_data = &vfe_dev->stats_data;
	struct msm_isp_timestamp timestamp;

	msm_isp_get_timestamp(&timestamp);
	msm_isp_get_timestamp(&timestamp, vfe_dev);

	num_stats_comp_mask =
		vfe_dev->hw_info->stats_hw_info->num_stats_comp_mask;
+13 −5
Original line number Diff line number Diff line
@@ -181,13 +181,21 @@ uint32_t msm_isp_get_framedrop_period(
	return 1;
}

void msm_isp_get_timestamp(struct msm_isp_timestamp *time_stamp)
void msm_isp_get_timestamp(struct msm_isp_timestamp *time_stamp,
	struct vfe_device *vfe_dev)
{
	struct timespec ts;
	do_gettimeofday(&(time_stamp->event_time));
	if (vfe_dev->vt_enable) {
		msm_isp_get_avtimer_ts(time_stamp);
		time_stamp->buf_time.tv_sec    = time_stamp->vt_time.tv_sec;
		time_stamp->buf_time.tv_usec   = time_stamp->vt_time.tv_usec;
	} else	{
		get_monotonic_boottime(&ts);
		time_stamp->buf_time.tv_sec    = ts.tv_sec;
		time_stamp->buf_time.tv_usec   = ts.tv_nsec/1000;
	do_gettimeofday(&(time_stamp->event_time));
	}

}

static inline u32 msm_isp_evt_mask_to_isp_event(u32 evt_mask)
@@ -1843,7 +1851,7 @@ static void msm_isp_enqueue_tasklet_cmd(struct vfe_device *vfe_dev,
	queue_cmd->vfeInterruptStatus0 = irq_status0;
	queue_cmd->vfeInterruptStatus1 = irq_status1;
	queue_cmd->vfePingPongStatus = ping_pong_status;
	msm_isp_get_timestamp(&queue_cmd->ts);
	msm_isp_get_timestamp(&queue_cmd->ts, vfe_dev);
	queue_cmd->cmd_used = 1;
	vfe_dev->taskletq_idx = (vfe_dev->taskletq_idx + 1) %
		MSM_VFE_TASKLETQ_SIZE;
+2 −1
Original line number Diff line number Diff line
@@ -72,5 +72,6 @@ void msm_isp_print_fourcc_error(const char *origin, uint32_t fourcc_format);
void msm_isp_flush_tasklet(struct vfe_device *vfe_dev);
void msm_isp_save_framedrop_values(struct vfe_device *vfe_dev,
	enum msm_vfe_input_src frame_src);
void msm_isp_get_timestamp(struct msm_isp_timestamp *time_stamp);
void msm_isp_get_timestamp(struct msm_isp_timestamp *time_stamp,
	struct vfe_device *vfe_dev);
#endif /* __MSM_ISP_UTIL_H__ */