modepolicy: sync change from uboot [1/1]
PD#SWPL-186145
Problem:
sync code from uboot change
Solution:
sync code for two files same
Verify:
U
Change-Id: I2009bb7a14b16c743e4c707877810a5e29983580
Signed-off-by: fuqing.chen <fuqing.chen@amlogic.com>
diff --git a/libs/modepolicy/mode_policy_parser.c b/libs/modepolicy/mode_policy_parser.c
index e9cb36a..e96609b 100644
--- a/libs/modepolicy/mode_policy_parser.c
+++ b/libs/modepolicy/mode_policy_parser.c
@@ -374,7 +374,8 @@
* compilation pass, and then make modifications when it is used later.
*/
bool find_brr_mode(const char *mode, struct meson_policy_in *input, char* outputmode) {
- struct hdmitx_dev *hdev = get_hdmitx21_device();
+#ifdef CONFIG_AML_HDMITX21
+ struct hdmitx_dev *hdev = get_hdmitx21_device();
bool rx_qms_cap = 0;
bool env_qms_en = 0;
bool progressive_mode = 1;
@@ -387,9 +388,10 @@
int i;
enum hdmi_vic qms_brr_vic = HDMI_UNKNOWN;
const struct hdmi_timing *hdmitx21_gettiming_from_name(const char *name);
+#endif
if (!mode || !input || !outputmode) {
- SYS_LOGE("%s input or mode or outputmode is null\n", __FUNCTION__);
+ SYS_LOGE("%s input or mode or outputmode is null\n", __func__);
return false;
}
/* QMS is not applied for hdmi20 devices */
@@ -397,7 +399,7 @@
strcpy(outputmode, mode);
return false;
#endif
-
+#ifdef CONFIG_AML_HDMITX21
rx_qms_cap = hdev->RXCap.qms;
if (env_get("qms_en") && (env_get_ulong("qms_en", 10, 0) == 1))
env_qms_en = 1;
@@ -412,7 +414,8 @@
if (!(env_qms_en && progressive_mode && rx_qms_cap)) {
strcpy(outputmode, mode);
- SYS_LOGE("hdmitx: qms: env %d mode %d rx_qms %d\n", env_qms_en, progressive_mode, rx_qms_cap);
+ SYS_LOGE("hdmitx: qms: env %d mode %d rx_qms %d\n",
+ env_qms_en, progressive_mode, rx_qms_cap);
return false;
}
tfr_timing = hdmitx21_gettiming_from_name(mode);
@@ -433,6 +436,8 @@
SYS_LOGE("hdmitx: qms: the brr mode of %s is %s\n", mode, brr_mode);
strcpy(outputmode, brr_mode);
return true;
+#endif
+ return false;
}
/*
@@ -441,23 +446,23 @@
bool mode_support_check(const char *mode, const char * color, struct meson_policy_in *input) {
struct hdmi_format_para *para = NULL;
#ifdef CONFIG_AML_HDMITX20
- struct hdmitx_dev *hdev = hdmitx_get_hdev();
+ struct hdmitx_dev *hdev = hdmitx_get_hdev();
#else
- struct hdmitx_dev *hdev = get_hdmitx21_device();
- char brr_mode[32] = {0};
+ struct hdmitx_dev *hdev = get_hdmitx21_device();
+ char brr_mode[32] = {0};
#endif
- if (!mode || !color || !input)
- return false;
+ if (!mode || !color || !input)
+ return false;
#ifdef CONFIG_AML_HDMITX20
- para = hdmi_tst_fmt_name(mode, color);
- return hdmitx_edid_check_valid_mode(hdev, para);
+ para = hdmi_tst_fmt_name(mode, color);
+ return hdmitx_edid_check_valid_mode(hdev, para);
#else
- if (find_brr_mode(mode, input, brr_mode))
- mode = &brr_mode[0];
- para = hdmitx21_tst_fmt_name(mode, color);
- return hdmitx21_validate_mode(hdev, para);
+ if (find_brr_mode(mode, input, brr_mode))
+ mode = &brr_mode[0];
+ para = hdmitx21_tst_fmt_name(mode, color);
+ return hdmitx21_validate_mode(hdev, para);
#endif
}