From fa675ff48c55bbcf98013ff87cb6181b66c5350e Mon Sep 17 00:00:00 2001 From: "qiang.liu" Date: Mon, 11 Sep 2023 20:58:17 +0800 Subject: [PATCH] vdin: add game interlace drop bottom [1/1] PD#SWPL-139287 Problem: game interlace bypass di will jitter Solution: add game interlace drop bottom Verify: txhd2 Change-Id: I8d596454499461803066d3ce6260afd310e8252c Signed-off-by: qiang.liu --- drivers/media/vin/tvin/vdin/vdin_ctl_s5.c | 2 -- drivers/media/vin/tvin/vdin/vdin_drv.c | 12 ++++++++---- drivers/media/vin/tvin/vdin/vdin_drv.h | 2 ++ drivers/media/vin/tvin/vdin/vdin_sm.c | 1 + 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/media/vin/tvin/vdin/vdin_ctl_s5.c b/drivers/media/vin/tvin/vdin/vdin_ctl_s5.c index 41f29ea74..2e48f1080 100644 --- a/drivers/media/vin/tvin/vdin/vdin_ctl_s5.c +++ b/drivers/media/vin/tvin/vdin/vdin_ctl_s5.c @@ -2494,8 +2494,6 @@ void vdin_set_all_regs_s5(struct vdin_dev_s *devp) /* bbar sub-module */ //vdin_set_bbar_s5(devp->addr_offset, devp->v_active, devp->h_active); #ifdef CONFIG_AML_LOCAL_DIMMING - devp->h_active, devp->v_active); - /* ldim sub-module */ /* vdin_set_ldim_max_init(devp->addr_offset, 1920, 1080, 8, 2); */ vdin_set_ldim_max_init_s5(devp->addr_offset, devp->h_active, diff --git a/drivers/media/vin/tvin/vdin/vdin_drv.c b/drivers/media/vin/tvin/vdin/vdin_drv.c index 7bca262b7..6b1fb77d5 100644 --- a/drivers/media/vin/tvin/vdin/vdin_drv.c +++ b/drivers/media/vin/tvin/vdin/vdin_drv.c @@ -502,10 +502,13 @@ static bool vdin_need_game_mode(struct vdin_dev_s *devp) // 1080i maybe has game mode demand if ((devp->vdin_function_sel & VDIN_INTERLACE_GAME_MODE) && devp->fmt_info_p->scan_mode == TVIN_SCAN_MODE_INTERLACED && - devp->fmt_info_p->v_active == 540) + devp->fmt_info_p->v_active == 540) { + if (devp->vdin_function_sel & VDIN_INTERLACE_DROP_BOTTOM) + devp->interlace_drop_bottom = true; return true; - else + } else { return false; + } } static void vdin_game_mode_check(struct vdin_dev_s *devp) @@ -1633,6 +1636,7 @@ void vdin_stop_dec(struct vdin_dev_s *devp) devp->game_mode_bak = 0; devp->game_mode_chg = VDIN_GAME_MODE_UN_CHG; devp->common_divisor = 0; + devp->interlace_drop_bottom = 0; if ((devp->vdin_function_sel & VDIN_SELF_STOP_START) && devp->self_stop_start) { @@ -3203,11 +3207,11 @@ irqreturn_t vdin_isr(int irq, void *dev_id) * give up bottom field to avoid odd/even phase different */ trans_fmt = devp->parm.info.trans_fmt; - if (vdin_is_3d_interlace_signal(devp) && + if ((vdin_is_3d_interlace_signal(devp) || devp->interlace_drop_bottom) && ((last_field_type & VIDTYPE_INTERLACE_BOTTOM) == VIDTYPE_INTERLACE_BOTTOM)) { devp->vdin_irq_flag = VDIN_IRQ_FLG_FMT_TRANS_CHG; - vdin_drop_frame_info(devp, "tran fmt chg"); + vdin_drop_frame_info(devp, "3d tran fmt or game interlace"); goto irq_handled; } /* Check whether frame written done */ diff --git a/drivers/media/vin/tvin/vdin/vdin_drv.h b/drivers/media/vin/tvin/vdin/vdin_drv.h index 06e5941e6..da92aaaae 100644 --- a/drivers/media/vin/tvin/vdin/vdin_drv.h +++ b/drivers/media/vin/tvin/vdin/vdin_drv.h @@ -335,6 +335,7 @@ struct match_data_s { #define VDIN_MUX_VDIN0_HIST BIT(15) //sel vdin0 hist for txhd2 #define VDIN_SET_PCS_RESET BIT(16) //for report_active abnormal callback rx pcs_reset #define VDIN_AFBCE_DOLBY BIT(17) +#define VDIN_INTERLACE_DROP_BOTTOM BIT(18) /* vdin_function_sel control bits end */ @@ -1007,6 +1008,7 @@ struct vdin_dev_s { bool black_bar_enable; bool hist_bar_enable; bool rdma_not_register; + bool interlace_drop_bottom; unsigned int ignore_frames; /*use frame rate to cal duration*/ unsigned int use_frame_rate; diff --git a/drivers/media/vin/tvin/vdin/vdin_sm.c b/drivers/media/vin/tvin/vdin/vdin_sm.c index 8335235f3..89bf48c20 100644 --- a/drivers/media/vin/tvin/vdin/vdin_sm.c +++ b/drivers/media/vin/tvin/vdin/vdin_sm.c @@ -757,6 +757,7 @@ void tvin_sig_chg_event_process(struct vdin_dev_s *devp, u32 chg) if (sm_debug_enable & VDIN_SM_LOG_L_1) pr_info("vdin reconfig, set unstable\n"); devp->parm.info.status = TVIN_SIG_STATUS_UNSTABLE; + sm_dev[devp->index].state = TVIN_SM_STATUS_UNSTABLE; devp->frame_drop_num = vdin_re_cfg_drop_cnt; } devp->pre_event_info.event_sts = devp->event_info.event_sts;