deinterace: close cue except local play [1/1]
authorJihong Sui <jihong.sui@amlogic.com>
Wed, 21 Aug 2019 09:25:12 +0000 (17:25 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Fri, 23 Aug 2019 04:09:39 +0000 (21:09 -0700)
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 <jihong.sui@amlogic.com>
drivers/amlogic/media/deinterlace/deinterlace.c
drivers/amlogic/media/deinterlace/di_pqa.h
drivers/amlogic/media/deinterlace/nr_drv.c
drivers/amlogic/media/deinterlace/nr_drv.h
drivers/amlogic/media/di_multi/deinterlace.c

index 09d95c4d654d319e54e4c6f08f13999ac1a1e9c2..453ccf6599b20abf2fa0fe3b2f76c7062897c4b8 100644 (file)
@@ -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;
index 0f26472ec301bc92744c8ea8ea132d1a5158014c..dbe43803cb240394fcc9c67b14f27336eaf12498 100644 (file)
@@ -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);
index 1b6d45379cf8dd8f694cb91692e29557f1bb9a09..19db64421530515dfaea9820a72bd9a98e7467e5 100644 (file)
@@ -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);
index 8dcc2dc94c50f0621b9e06b1cab863819e7c004c..9b160d4fdf27586ee1c426cea29160b712d3ab42 100644 (file)
@@ -18,6 +18,7 @@
 #ifndef _DNR_H
 #define _DNR_H
 #include <linux/atomic.h>
+#include <linux/amlogic/media/vfm/vframe.h>
 
 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
index daa6e1ad360e0948cd53de8dab08af3d3a683ab1..da4fc2d2c74a1418efb364b8202446c608e928cf 100644 (file)
@@ -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;