From f2a40545f359146501bc9a513ce4df87b82d99b6 Mon Sep 17 00:00:00 2001 From: "shuanglong.wang" Date: Mon, 3 Jun 2019 09:56:30 +0800 Subject: [PATCH] video: clear pcr in video stop [1/1] PD#SWPL-6903 Problem: pcr increase automatic after system reset Solution: in non-tunnel mode, only after video stop post will adjust pcr in omx_secret_mode. Also clear pcr in video stop Verify: verify by nts Change-Id: I528229e8121a99e50c7b8313bd8dc867e3710ad8 Signed-off-by: shuanglong.wang --- drivers/amlogic/media/frame_sync/tsync.c | 1 + drivers/amlogic/media/video_sink/video.c | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/amlogic/media/frame_sync/tsync.c b/drivers/amlogic/media/frame_sync/tsync.c index 9d0311e55b84..7e2f69108dd0 100644 --- a/drivers/amlogic/media/frame_sync/tsync.c +++ b/drivers/amlogic/media/frame_sync/tsync.c @@ -803,6 +803,7 @@ void tsync_avevent_locked(enum avevent_e event, u32 param) case VIDEO_STOP: tsync_stat = TSYNC_STAT_PCRSCR_SETUP_NONE; timestamp_vpts_set(0); + timestamp_pcrscr_set(0); timestamp_pcrscr_enable(0); timestamp_firstvpts_set(0); tsync_video_started = 0; diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index 900fccf117d7..c79b062c3dfe 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -6700,10 +6700,11 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id) } } - if ((diff - omx_pts_interval_upper) > 0 + if (((diff - omx_pts_interval_upper) > 0 || (diff - omx_pts_interval_lower) < 0 || (omx_pts_set_from_hwc_count < - OMX_MAX_COUNT_RESET_SYSTEMTIME)) { + OMX_MAX_COUNT_RESET_SYSTEMTIME)) + && video_start_post) { timestamp_pcrscr_enable(1); if (debug_flag & DEBUG_FLAG_PTS_TRACE) pr_info("system_time=%d, omx_pts=%d, diff=%d\n", @@ -6715,7 +6716,8 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id) } else if (((diff - omx_pts_interval_upper / 2) > 0 || (diff - omx_pts_interval_lower / 2) < 0) && (omx_pts_set_from_hwc_count_begin < - OMX_MAX_COUNT_RESET_SYSTEMTIME_BEGIN)) { + OMX_MAX_COUNT_RESET_SYSTEMTIME_BEGIN) + && video_start_post) { timestamp_pcrscr_enable(1); if (debug_flag & DEBUG_FLAG_PTS_TRACE) pr_info("begin-system_time=%d, omx_pts=%d, diff=%d\n", @@ -6723,7 +6725,8 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id) timestamp_pcrscr_set(omx_pts + DURATION_GCD); } else if (is_dolby_vision_enable() && ((diff - omx_pts_dv_upper) > 0 - || (diff - omx_pts_dv_lower) < 0)) { + || (diff - omx_pts_dv_lower) < 0) + && video_start_post) { timestamp_pcrscr_set(omx_pts + DURATION_GCD); } } else