deinterlace: fix tl1 in 1080i has small sawtooth [1/1]
authorWenfeng Guo <wenfeng.guo@amlogic.com>
Thu, 10 Jan 2019 08:19:58 +0000 (16:19 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Thu, 11 Apr 2019 06:32:16 +0000 (23:32 -0700)
PD#SWPL-4072

Problem:
tl1 1080i in some dark scenes and roller coasters
have small sawtooth

Solution:
adjust a set of registers with special motion

Verify:
tl1

Change-Id: Idbe62e823f1c6c683b67d000978de1862c8e3162
Signed-off-by: Wenfeng Guo <wenfeng.guo@amlogic.com>
drivers/amlogic/media/deinterlace/deinterlace.c
drivers/amlogic/media/deinterlace/deinterlace_mtn.c
drivers/amlogic/media/deinterlace/deinterlace_mtn.h

index 2059410..674c707 100644 (file)
@@ -3932,6 +3932,18 @@ jiffies_to_msecs(jiffies_64 - vframe->ready_jiffies64));
                                }
                        }
                } else {
+               /*********************************/
+               if ((di_buf->vframe->width >= 1920) &&
+                       (di_buf->vframe->height >= 1080) &&
+                       is_meson_tl1_cpu()) {
+                       if (combing_fix_en) {
+                               combing_fix_en = false;
+                               fix_tl1_1080i_sawtooth_patch();
+                       }
+               } else
+                       combing_fix_en = true;
+
+               /*********************************/
                        if (
                                di_pre_stru.di_chan2_buf_dup_p == NULL) {
                                di_pre_stru.field_count_for_cont = 0;
index 6ff0bb6..d539aeb 100644 (file)
@@ -624,6 +624,24 @@ static int di_debug_readreg;
 module_param(di_debug_readreg, int, 0644);
 MODULE_PARM_DESC(di_debug_readreg, "di_debug_readreg");
 
+/*from VLSI yanling.liu, the patch fix TL1 1080I in some dark */
+/*scenes and roller coasters have small sawtooth, when turn off*/
+/*combing_fix_en, set the registers*/
+void fix_tl1_1080i_sawtooth_patch(void)
+{
+       DI_Wr(0x1741, 0x0A0A1A22);
+       DI_Wr(0x1742, 0x0a100101);
+       DI_Wr(0x1743, 0x01020420);
+       DI_Wr(0x1744, 0x32210404);
+       DI_Wr(0x17a9, 0x0a100505);
+       DI_Wr(0x17aa, 0x04040101);
+       DI_Wr(0x17ab, 0x0a0a0a0a);
+       DI_Wr(0x17ac, 0x0f100101);
+       DI_Wr(0x17ad, 0x04040606);
+       DI_Wr(0x17ae, 0x02030202);
+       DI_Wr(0x17af, 0x60020a60);
+}
+
 int adaptive_combing_fixing(
        struct combing_status_s *cmb_status,
        unsigned int field_diff,
index 206d1c3..13cc468 100644 (file)
@@ -39,6 +39,7 @@ struct combing_status_s *adpative_combing_config(unsigned int width,
        unsigned int height,
        enum vframe_source_type_e src_type, bool prog,
        enum tvin_sig_fmt_e fmt);
+extern void fix_tl1_1080i_sawtooth_patch(void);
 int adaptive_combing_fixing(
        struct combing_status_s *cmb_status,
        unsigned int field_diff, unsigned int frame_diff,