hdmitx21: Optimize frl training failure output strategy under uboot [1/1]
PD#SWPL-170535
Problem:
When the user selects frl mode for output, if frl training fails under
uboot,the output will be changed to 1080p. As a result, after entering
the kernel,the final output is 1080p instead of the frl mode selected
by the user. It is necessary to ensure that the final output under the
kernel is the frl mode selected by the user.
Solution:
When outputting frl mode, if frl training fails under uboot,
in order to ensure that it is displayed under uboot, change
to the default TMDS mode for output display. systemctrl
maintains the original 8k policy. After the subsequent systermctrl
starts running, if it is checked that the current output is not the
original frl mode, it will switch to the original frl mode.
Verify:
s7/s5
Change-Id: I3bc22f5dd6a5977eeec4427b8ab1ad7b6ae9fec9
Signed-off-by: xiang.wu1 <xiang.wu1@amlogic.com>
diff --git a/cmd/amlogic/cmd_hdmitx21.c b/cmd/amlogic/cmd_hdmitx21.c
index 153c4ba..e1b9d04 100644
--- a/cmd/amlogic/cmd_hdmitx21.c
+++ b/cmd/amlogic/cmd_hdmitx21.c
@@ -370,9 +370,9 @@
if (hdev->frl_rate && !hdev->flt_train_st) {
/* FLT training failed, need go to tmds mode */
printf("hdmitx frl training failed, set tmds mode\n");
- run_command("setenv hdmimode 1080p60hz", 0);
- run_command("setenv colorattribute 422,12bit", 0);
- run_command("run init_display_base", 0);
+ hdmitx_module_disable();
+ hdev->frl_train_fail_flag = true;
+ run_command("run init_display", 0);
}
}
return CMD_RET_SUCCESS;
@@ -1379,6 +1379,16 @@
last_dv_status);
}
}
+ /* When outputting frl mode, if frl training fails under uboot,
+ * in order to ensure that it is displayed under uboot, change
+ * to the default TMDS mode for output display. systemctrl
+ * maintains the original 8k policy. After the subsequent systermctrl
+ * starts running, if it is checked that the current output is not the
+ * original frl mode, it will switch to the original frl mode.
+ */
+ if (hdev->frl_train_fail_flag) {
+ save_default_720p();
+ } else if (hdev->RXCap.edid_changed || no_manual_output || !mode_support || over_write) {
/* 4 cases need to decide output by uboot mode select policy:
* 1.TV changed
* 2.either hdmimode or colorattribute is NULL or "none",
@@ -1390,7 +1400,6 @@
* with uboot policy.
* 4.user selected mode is over writen by system policy
*/
- if (hdev->RXCap.edid_changed || no_manual_output || !mode_support || over_write) {
/* find proper mode if EDID changed */
scene_process(hdev, &scene_output_info);
env_set("hdmichecksum", hdev->RXCap.hdmichecksum);
diff --git a/include/amlogic/media/vout/hdmitx21/hdmitx_module.h b/include/amlogic/media/vout/hdmitx21/hdmitx_module.h
index a37e019..e43b9f4 100644
--- a/include/amlogic/media/vout/hdmitx21/hdmitx_module.h
+++ b/include/amlogic/media/vout/hdmitx21/hdmitx_module.h
@@ -53,6 +53,7 @@
enum frl_rate_enum manual_frl_rate; /* for manual setting */
u8 tx_max_frl_rate; /* configure in dts file */
bool flt_train_st; /* 0 means FLT train failed */
+ bool frl_train_fail_flag;
u32 dsc_en;
u8 dsc_policy;
u32 dfm_type;