From 80866337ec470132d6976302548090a180483088 Mon Sep 17 00:00:00 2001 From: Jihong Sui Date: Wed, 21 Aug 2019 17:25:12 +0800 Subject: [PATCH] deinterace: close cue except local play [1/1] PD#SWPL-12404 Problem: red and green stripes dividing line flash black line Solution: close cue(422/444) except local play(420) VLSI-yanling suggest Verify: TL1 Change-Id: Ied1554d6a0e64e00aea1e692ab6b405f87387095 Signed-off-by: Jihong Sui --- drivers/amlogic/media/deinterlace/deinterlace.c | 2 +- drivers/amlogic/media/deinterlace/di_pqa.h | 2 +- drivers/amlogic/media/deinterlace/nr_drv.c | 26 ++++++++++++++++-- drivers/amlogic/media/deinterlace/nr_drv.h | 3 ++- drivers/amlogic/media/di_multi/deinterlace.c | 36 +++++++++++++------------ 5 files changed, 47 insertions(+), 22 deletions(-) diff --git a/drivers/amlogic/media/deinterlace/deinterlace.c b/drivers/amlogic/media/deinterlace/deinterlace.c index 09d95c4..453ccf6 100644 --- a/drivers/amlogic/media/deinterlace/deinterlace.c +++ b/drivers/amlogic/media/deinterlace/deinterlace.c @@ -6981,7 +6981,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 0f26472..dbe43803 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 1b6d453..19db644 100644 --- a/drivers/amlogic/media/deinterlace/nr_drv.c +++ b/drivers/amlogic/media/deinterlace/nr_drv.c @@ -707,6 +707,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) { @@ -732,13 +734,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); @@ -747,11 +760,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: */ @@ -855,7 +873,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 8dcc2dc..9b160d4 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); extern bool nr_demo_flag; #endif diff --git a/drivers/amlogic/media/di_multi/deinterlace.c b/drivers/amlogic/media/di_multi/deinterlace.c index daa6e1a..da4fc2d 100644 --- a/drivers/amlogic/media/di_multi/deinterlace.c +++ b/drivers/amlogic/media/di_multi/deinterlace.c @@ -1065,16 +1065,15 @@ store_dump_mem(struct device *dev, struct device_attribute *attr, filp_close(filp, NULL); kfree(buf_orig); return len; - - /*try again:*/ - PR_INF("vap err,size to 5222400, try again\n"); - nr_size = 5222400; - buff = dim_vmap(dump_adr, nr_size, &bflg_vmap); - if (!buff) { - filp_close(filp, NULL); - kfree(buf_orig); - return len; - } + } + /*try again:*/ + PR_INF("vap err,size to 5222400, try again\n"); + nr_size = 5222400; + buff = dim_vmap(dump_adr, nr_size, &bflg_vmap); + if (!buff) { + filp_close(filp, NULL); + kfree(buf_orig); + return len; } } } else { @@ -5180,7 +5179,10 @@ int dim_post_process(void *arg, unsigned int zoom_start_x_lines, PR_ERR("%s 2:\n", __func__); return 0; } - dim_tr_ops.post_set(di_buf->vframe->omx_index); + if (di_buf->vframe) + dim_tr_ops.post_set(di_buf->vframe->omx_index); + else + return 0; /*dbg*/ dim_ddbg_mod_save(eDI_DBG_MOD_POST_SETB, channel, ppost->frame_cnt); dbg_post_cnt(channel, "ps1"); @@ -5221,8 +5223,7 @@ int dim_post_process(void *arg, unsigned int zoom_start_x_lines, (dimp_get(eDI_MP_post_wr_en) && dimp_get(eDI_MP_post_wr_support))); - if (!di_buf->di_buf_dup_p[0]->vframe || - !di_buf->vframe) { + if (!di_buf->di_buf_dup_p[0]->vframe) { PR_ERR("%s 3:\n", __func__); return 0; } @@ -7174,7 +7175,7 @@ void di_reg_setting(unsigned int channel, struct vframe_s *vframe) first_field_type = (vframe->type & VIDTYPE_TYPEMASK); di_pre_size_change(vframe->width, nr_height, first_field_type, channel); - get_ops_nr()->cue_int(); + get_ops_nr()->cue_int(vframe); dim_ddbg_mod_save(eDI_DBG_MOD_REGE, channel, 0); /*--------------------------*/ @@ -7220,9 +7221,8 @@ void di_reg_variable(unsigned int channel, struct vframe_s *vframe) ppre->bypass_flag = true; dimh_patch_post_update_mc_sw(DI_MC_SW_OTHER, false); return; - - ppre->bypass_flag = false; } + ppre->bypass_flag = false; /* patch for vdin progressive input */ if ((is_from_vdin(vframe) && is_progressive(vframe)) @@ -7381,7 +7381,9 @@ int di_ori_event_reg(void *data, unsigned int channel) /*ary: need use interface api*/ /*receiver_name = vf_get_receiver_name(VFM_NAME);*/ preceiver = vf_get_receiver(di_rev_name[channel]); - receiver_name = preceiver->name; + if (preceiver) + receiver_name = preceiver->name; + if (receiver_name) { if (!strcmp(receiver_name, "amvideo")) { ppost->run_early_proc_fun_flag = 0; -- 2.7.4