From 73f949cfea204b72cef7938fd301b7302f1c46a2 Mon Sep 17 00:00:00 2001 From: "shuanglong.wang" Date: Fri, 12 Apr 2019 13:55:06 +0800 Subject: [PATCH] video: compensation omxpts for pcr check [1/1] PD#SWPL-5664 Problem: pcr is probably adjust when test AL1 eyepatch test case Solution: the time is not accurate when check pcr and omx_pts differ, because omx_pts is used the value that be set, but pcr is current. Here add compensation for omx_pts Verify: verify by nts Change-Id: I3e0f6f006fd79cf7cac4148fd18da72111a333c7 Signed-off-by: shuanglong.wang Conflicts: drivers/amlogic/media/video_sink/video.c --- drivers/amlogic/media/video_sink/video.c | 26 ++++++++++++++++++------ drivers/amlogic/media/video_sink/vpp.c | 19 +---------------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index 1d2300c77497..78a398be67ba 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -456,8 +456,6 @@ static u32 reference_zorder = 128; static s32 black_threshold_width = 20; static s32 black_threshold_height = 30; -static u32 reference_zorder = 128; - #define MAX_ZOOM_RATIO 300 #define VPP_PREBLEND_VD_V_END_LIMIT 2304 @@ -6549,9 +6547,19 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id) } if (omx_secret_mode == true) { u32 system_time = timestamp_pcrscr_get(); - int diff = system_time - omx_pts; - video_notify_flag |= VIDEO_NOTIFY_TRICK_WAIT; - atomic_set(&trickmode_framedone, 1); + int diff = 0; + unsigned long delta1 = 0; + + diff = system_time - omx_pts; + if (time_setomxpts.tv_sec > 0) { + struct timeval now; + + do_gettimeofday(&now); + delta1 = (now.tv_sec - time_setomxpts.tv_sec) + * 1000000LL + + (now.tv_usec - time_setomxpts.tv_usec); + diff -= delta1 * 90 / 1000; + } if ((diff - omx_pts_interval_upper) > 0 || (diff - omx_pts_interval_lower) < 0 @@ -8350,6 +8358,9 @@ static void video_vf_unreg_provider(void) show_first_picture = false; show_first_frame_nosync = false; + time_setomxpts.tv_sec = 0; + time_setomxpts.tv_usec = 0; + #ifdef PTS_LOGGING { int pattern; @@ -8887,8 +8898,11 @@ static void set_omx_pts(u32 *p) pr_info("[set_omx_pts]tmp_pts:%d, set_from_hwc:%d,frame_num=%d, not_reset=%d\n", tmp_pts, set_from_hwc, frame_num, not_reset); - if (not_reset == 0) + if (not_reset == 0) { omx_pts = tmp_pts; + ATRACE_COUNTER("omxpts", omx_pts); + do_gettimeofday(&time_setomxpts); + } /* kodi may render first frame, then drop dozens of frames */ if (set_from_hwc == 0 && omx_run == true && frame_num <= 2 && not_reset == 0) { diff --git a/drivers/amlogic/media/video_sink/vpp.c b/drivers/amlogic/media/video_sink/vpp.c index 93787f418a7c..1c89853f8c85 100644 --- a/drivers/amlogic/media/video_sink/vpp.c +++ b/drivers/amlogic/media/video_sink/vpp.c @@ -2976,10 +2976,7 @@ int vpp_set_filters( if (!input) return ret; - if (vpp_flags & VPP_FLAG_INTERLACE_IN) - vskip_step = 2; - else - vskip_step = 1; + WARN_ON(vinfo == NULL); /* use local var to avoid the input data be overwriten */ memcpy(&local_input, input, sizeof(struct disp_info_s)); @@ -3066,20 +3063,6 @@ int vpp_set_filters( if (vf->type & VIDTYPE_VSCALE_DISABLE) vpp_flags |= VPP_FLAG_VSCALE_DISABLE; -#ifndef TV_3D_FUNCTION_OPEN - if (vf->type & VIDTYPE_COMPRESS) { - src_width = vf->compWidth; - src_height = vf->compHeight; - } else { - src_width = vf->width; - src_height = vf->height; - } -#endif - - if ((vf->ratio_control & DISP_RATIO_ADAPTED_PICMODE) - && !disable_adapted) { - if (vf->pic_mode.screen_mode != 0xff) - wide_mode = vf->pic_mode.screen_mode; if ((vf->ratio_control & DISP_RATIO_ADAPTED_PICMODE) && !disable_adapted) {