From 7da9ec0ae5348ef6e519fccd7643eadfab0587e7 Mon Sep 17 00:00:00 2001 From: Yong Qin Date: Tue, 23 Apr 2019 17:33:09 +0800 Subject: [PATCH] di: when src size change, post ready size not right [1/1] PD#OTT-2650 Problem: Play local video, when source window size change, flashing occur. about two frame is not right Solution: There have a bug when source window size change, current frame width was copied to post ready frame. so every frame backup width saved in to current frame private buffer. Verify: TL1 Change-Id: I1b82dcfcfaeffaad6b28a7871014e12f0d157004 Signed-off-by: Yong Qin --- drivers/amlogic/media/deinterlace/deinterlace.c | 22 +++++++++++++--------- drivers/amlogic/media/deinterlace/deinterlace.h | 3 ++- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/amlogic/media/deinterlace/deinterlace.c b/drivers/amlogic/media/deinterlace/deinterlace.c index 2aabf04..557d7e3 100644 --- a/drivers/amlogic/media/deinterlace/deinterlace.c +++ b/drivers/amlogic/media/deinterlace/deinterlace.c @@ -129,7 +129,7 @@ static di_dev_t *de_devp; static dev_t di_devno; static struct class *di_clsp; -static const char version_s[] = "2019-04-12b:chg clkb from 500 to 667 for tl1"; +static const char version_s[] = "2019-0423a:src chg, post ready size is wrong"; static int bypass_state = 1; static int bypass_all; @@ -3616,7 +3616,7 @@ jiffies_to_msecs(jiffies_64 - vframe->ready_jiffies64)); vframe->type |= VIDTYPE_INTERLACE_TOP; } } - di_pre_stru.width_bk = vframe->width; + /*di_pre_stru.width_bk = vframe->width;*/ if (force_width) vframe->width = force_width; if (force_height) @@ -3650,7 +3650,7 @@ jiffies_to_msecs(jiffies_64 - vframe->ready_jiffies64)); } #endif memcpy(di_buf->vframe, vframe, sizeof(vframe_t)); - + di_buf->width_bk = vframe->width; di_buf->vframe->private_data = di_buf; vframe_in[di_buf->index] = vframe; di_buf->seq = di_pre_stru.in_seq; @@ -4037,10 +4037,12 @@ jiffies_to_msecs(jiffies_64 - vframe->ready_jiffies64)); /* set vframe bit info */ di_buf->vframe->bitdepth &= ~(BITDEPTH_YMASK); di_buf->vframe->bitdepth &= ~(FULL_PACK_422_MODE); + di_buf->width_bk = di_buf->vframe->width; if (de_devp->pps_enable && pps_position) { if (pps_dstw != di_buf->vframe->width) { di_buf->vframe->width = pps_dstw; - di_pre_stru.width_bk = pps_dstw; + /*di_pre_stru.width_bk = pps_dstw;*/ + di_buf->width_bk = pps_dstw; } if (pps_dsth != di_buf->vframe->height) di_buf->vframe->height = pps_dsth; @@ -4049,10 +4051,10 @@ jiffies_to_msecs(jiffies_64 - vframe->ready_jiffies64)); pr_info("di: hscd %d to %d\n", di_buf->vframe->width, pre_hsc_down_width); di_buf->vframe->width = pre_hsc_down_width; - di_pre_stru.width_bk = pre_hsc_down_width; + /*di_pre_stru.width_bk = pre_hsc_down_width;*/ + di_buf->width_bk = pre_hsc_down_width; } } - if (di_force_bit_mode == 10) { di_buf->vframe->bitdepth |= (BITDEPTH_Y10); if (full_422_pack) @@ -5607,7 +5609,8 @@ static int process_post_vframe(void) VIDTYPE_VIU_SINGLE_PLANE | VIDTYPE_VIU_FIELD | VIDTYPE_PRE_INTERLACE; - di_buf->vframe->width = di_pre_stru.width_bk; + di_buf->vframe->width = + di_buf->di_buf_dup_p[1]->width_bk; if ( di_buf->di_buf_dup_p[1]-> new_format_flag) { @@ -5753,7 +5756,7 @@ VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL); memcpy(di_buf->vframe, di_buf_i->vframe, sizeof(vframe_t)); - di_buf->vframe->width = di_pre_stru.width_bk; + di_buf->vframe->width = di_buf_i->width_bk; di_buf->vframe->private_data = di_buf; if (ready_di_buf->new_format_flag && @@ -5928,7 +5931,8 @@ VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL); VIDTYPE_VIU_FIELD | VIDTYPE_PRE_INTERLACE; di_buf->vframe->height >>= 1; - di_buf->vframe->width = di_pre_stru.width_bk; + di_buf->vframe->width = + di_buf->di_buf_dup_p[0]->width_bk; if ( (di_buf->di_buf_dup_p[0]-> new_format_flag) || diff --git a/drivers/amlogic/media/deinterlace/deinterlace.h b/drivers/amlogic/media/deinterlace/deinterlace.h index 9b9ad1f..964e203 100644 --- a/drivers/amlogic/media/deinterlace/deinterlace.h +++ b/drivers/amlogic/media/deinterlace/deinterlace.h @@ -161,6 +161,7 @@ struct di_buf_s { */ atomic_t di_cnt; struct page *pages; + u32 width_bk; }; #define RDMA_DET3D_IRQ 0x20 /* vdin0 rdma irq */ @@ -343,7 +344,7 @@ struct di_pre_stru_s { unsigned int det_tp; unsigned int det_la; unsigned int det_null; - unsigned int width_bk; + /*unsigned int width_bk;*/ #ifdef DET3D int vframe_interleave_flag; #endif -- 2.7.4