diff --git a/drivers/amlogic/media/deinterlace/deinterlace.c b/drivers/amlogic/media/deinterlace/deinterlace.c index 91d4dacef74b..29e04c1104f7 100644 --- a/drivers/amlogic/media/deinterlace/deinterlace.c +++ b/drivers/amlogic/media/deinterlace/deinterlace.c @@ -6939,7 +6939,7 @@ static void di_reg_process_irq(void) vframe->sig_fmt); di_patch_post_update_mc_sw(DI_MC_SW_REG, true); - cue_int(); + cue_int(vframe); if (de_devp->flags & DI_LOAD_REG_FLAG) up(&di_sema); init_flag = 1; diff --git a/drivers/amlogic/media/deinterlace/di_pqa.h b/drivers/amlogic/media/deinterlace/di_pqa.h index 0f26472ec301..dbe43803cb24 100644 --- a/drivers/amlogic/media/deinterlace/di_pqa.h +++ b/drivers/amlogic/media/deinterlace/di_pqa.h @@ -96,7 +96,7 @@ struct nr_op_s { void (*nr_all_config)(unsigned short nCol, unsigned short nRow, unsigned short type); bool (*set_nr_ctrl_reg_table)(unsigned int addr, unsigned int value); - void (*cue_int)(void); + void (*cue_int)(struct vframe_s *vf); void (*adaptive_cue_adjust)(unsigned int frame_diff, unsigned int field_diff); int (*module_para)(struct seq_file *seq); diff --git a/drivers/amlogic/media/deinterlace/nr_drv.c b/drivers/amlogic/media/deinterlace/nr_drv.c index 08c802cd8d68..e63015bbeb51 100644 --- a/drivers/amlogic/media/deinterlace/nr_drv.c +++ b/drivers/amlogic/media/deinterlace/nr_drv.c @@ -705,6 +705,8 @@ module_param_named(cue_pr_cnt, cue_pr_cnt, uint, 0644); static bool cue_glb_mot_check_en = true; module_param_named(cue_glb_mot_check_en, cue_glb_mot_check_en, bool, 0644); +/* confirm with vlsi-liuyanling, cue_process_irq is no use */ +/* when CUE disable */ static void cue_process_irq(void) { @@ -730,13 +732,24 @@ static void cue_process_irq(void) if (nr_param.frame_count == 5) Wr_reg_bits(NR2_CUE_MODE, 7, 0, 4); } -void cue_int(void) +void cue_int(struct vframe_s *vf) { /*confirm with vlsi-liuyanling, G12a cue must be disabled*/ if (is_meson_g12a_cpu()) { cue_en = false; cue_glb_mot_check_en = false; + } else if (vf && IS_VDIN_SRC(vf->source_type)) { + /*VLSI-yanling suggest close cue(422/444) except local play(420)*/ + cue_en = false; + cue_glb_mot_check_en = false; + } else { + cue_en = true; + cue_glb_mot_check_en = true; } + /*close cue when cue disable*/ + if (cpu_after_eq(MESON_CPU_MAJOR_ID_GXLX) && !cue_en) + DI_Wr_reg_bits(DI_NR_CTRL0, 0, 26, 1); + if (cpu_after_eq(MESON_CPU_MAJOR_ID_G12B)) { if (cue_en) Wr_reg_bits(NR2_CUE_MODE, 3, 10, 2); @@ -745,11 +758,16 @@ void cue_int(void) static bool glb_fieldck_en = true; module_param_named(glb_fieldck_en, glb_fieldck_en, bool, 0644); +/* confirm with vlsi-liuyanling, cue_process_irq is no use */ +/* when CUE disable */ void adaptive_cue_adjust(unsigned int frame_diff, unsigned int field_diff) { struct CUE_PARM_s *pcue_parm = nr_param.pcue_parm; unsigned int mask1, mask2; + if (!cue_glb_mot_check_en) + return; + //if (is_meson_tl1_cpu() || is_meson_tm2_cpu()) { if (cpu_after_eq(MESON_CPU_MAJOR_ID_G12B)) { /*value from VLSI(yanling.liu) 2018-12-07: */ @@ -853,7 +871,11 @@ void nr_process_in_irq(void) { nr_param.frame_count++; nr_ctrl_reg_load(nr_param.pnr_regs); - if (cpu_after_eq(MESON_CPU_MAJOR_ID_GXLX)) + + /* confirm with vlsi-liuyanling, cue_process_irq is no use */ + /* when CUE disable */ + if (cpu_after_eq(MESON_CPU_MAJOR_ID_GXLX) && + cue_glb_mot_check_en) cue_process_irq(); if (dnr_en) dnr_process(&dnr_param); diff --git a/drivers/amlogic/media/deinterlace/nr_drv.h b/drivers/amlogic/media/deinterlace/nr_drv.h index 36b98d16e7ad..3af10f6adab4 100644 --- a/drivers/amlogic/media/deinterlace/nr_drv.h +++ b/drivers/amlogic/media/deinterlace/nr_drv.h @@ -18,6 +18,7 @@ #ifndef _DNR_H #define _DNR_H #include +#include struct nr_param_s { char *name; @@ -183,7 +184,7 @@ void nr_all_config(unsigned short nCol, unsigned short nRow, unsigned short type); bool set_nr_ctrl_reg_table(unsigned int addr, unsigned int value); -extern void cue_int(void); +extern void cue_int(struct vframe_s *vf); #endif