hdmirx: optimize errorcable handle in PHY EQ algorithm
authorYicheng Shen <yicheng.shen@amlogic.com>
Mon, 12 Mar 2018 06:30:51 +0000 (14:30 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Tue, 13 Mar 2018 02:06:55 +0000 (18:06 -0800)
PD#161977: optimize errorcable handle in PHY EQ algorithm

Change-Id: I4e0f2884f64ac7818198504f7592b558985b5512
Signed-off-by: Yicheng Shen <yicheng.shen@amlogic.com>
drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h
drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_eq.c
drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_eq.h
drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_wrapper.c

index 28b10db..2cfa7de 100644 (file)
@@ -34,7 +34,7 @@
 //#include "hdmi_rx_edid.h"
 
 
-#define RX_VER0 "ver.2018-01-25-S"
+#define RX_VER0 "ver.2018-03-12-S"
 /*
  *
  *
index 37b15f2..901afd5 100644 (file)
@@ -172,23 +172,34 @@ enum eq_sts_e rx_get_eq_run_state(void)
 
 void eq_dwork_handler(struct work_struct *work)
 {
+       unsigned int i;
+
        cancel_delayed_work(&eq_dwork);
-       if (SettingFinder() == 1) {
-               rx_pr("EQ-%d-%d-%d-",
-                               eq_ch0.bestsetting,
-                               eq_ch1.bestsetting,
-                               eq_ch2.bestsetting);
-               if (eq_maxvsmin(eq_ch0.bestsetting,
-                       eq_ch1.bestsetting,
-                       eq_ch2.bestsetting) == 1) {
+       for (i = 0; i < NTRYS; i++) {
+               if (SettingFinder() == 1) {
+                       rx_pr("EQ-%d-%d-%d-",
+                                       eq_ch0.bestsetting,
+                                       eq_ch1.bestsetting,
+                                       eq_ch2.bestsetting);
+
+                       if (eq_maxvsmin(eq_ch0.bestsetting,
+                                       eq_ch1.bestsetting,
+                                       eq_ch2.bestsetting) == 1) {
+                               if (log_level & EQ_LOG)
+                                       rx_pr("pass\n");
+                               break;
+                       }
                        if (log_level & EQ_LOG)
-                               rx_pr("pass\n");
-               } else {
-                       eq_ch0.bestsetting = ErrorcableSetting;
-                       eq_ch1.bestsetting = ErrorcableSetting;
-                       eq_ch2.bestsetting = ErrorcableSetting;
+                               rx_pr("fail\n");
                }
        }
+       if (i >= NTRYS) {
+               eq_ch0.bestsetting = ErrorcableSetting;
+               eq_ch1.bestsetting = ErrorcableSetting;
+               eq_ch2.bestsetting = ErrorcableSetting;
+               if (log_level & EQ_LOG)
+                       rx_pr("EQ fail-retry\n");
+       }
        eq_cfg();
        eq_sts = E_EQ_FINISH;
        /*rx_set_eq_run_state(E_EQ_FINISH);*/
index 7e00923..ce39425 100644 (file)
@@ -48,7 +48,7 @@
 /* 3d3: Selects counter threshold 8K */
 /* 3d4: Selects counter threshold 16K */
 /* Number of retries in case of algorithm ending with errors */
-#define MINMAX_nTrys   3
+#define NTRYS  1
 /* theoretical threshold for an equalized system */
 #define equalizedCounterValue  512
 /* theoretical threshold for an equalized system */
index 46c9d2c..26f7d6b 100644 (file)
@@ -2370,10 +2370,10 @@ unsigned int hdmirx_show_info(unsigned char *buf, int size)
                        "Color Space: %s\n", "1-YUV422");
        else if (rx.cur.colorspace == E_COLOR_YUV444)
                pos += snprintf(buf+pos, size-pos,
-                       "Color Space: %s\n", "1-YUV444");
+                       "Color Space: %s\n", "2-YUV444");
        else if (rx.cur.colorspace == E_COLOR_YUV420)
                pos += snprintf(buf+pos, size-pos,
-                       "Color Space: %s\n", "1-YUV420");
+                       "Color Space: %s\n", "3-YUV420");
        pos += snprintf(buf+pos, size-pos,
                "Dvi: %d\n", rx.cur.hw_dvi);
        pos += snprintf(buf+pos, size-pos,