From e4ced521129f56249ae000bfc138e60dffe5a9b8 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Thu, 8 Jun 2017 15:04:42 -0700 Subject: [PATCH] msm: camera: Always report real time timestamp Kernel will always report timestamp value in real time, also adding in AV timer value if necessary. HAL will do any necessary conversion to monotonic time. CRs-fixed: 2054122 Change-Id: I40ff893a02090f73874da54cddf46801768231a3 Signed-off-by: Jason Lee --- .../media/platform/msm/camera_v2/isp/msm_isp_axi_util.c | 2 +- drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c index 86cdfec7ed8b..f724daea0805 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c @@ -4021,7 +4021,7 @@ void msm_isp_process_axi_irq_stream(struct vfe_device *vfe_dev, msm_isp_get_avtimer_ts(ts); time_stamp = &ts->vt_time; } else { - time_stamp = &ts->buf_time; + time_stamp = &ts->event_time; } frame_id = vfe_dev->axi_data. diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c index e87f2414a879..6900c1d16cb0 100644 --- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c +++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c @@ -208,15 +208,14 @@ void msm_isp_get_timestamp(struct msm_isp_timestamp *time_stamp, { struct timespec ts; - do_gettimeofday(&(time_stamp->event_time)); + get_monotonic_boottime(&ts); + time_stamp->event_time.tv_sec = ts.tv_sec; + time_stamp->event_time.tv_usec = ts.tv_nsec / 1000; + time_stamp->buf_time = 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; } }