From 4eb0070cba1df5fff699cd31f0bed9b9b5efe9bb Mon Sep 17 00:00:00 2001 From: "Zhengrong.Zhu" Date: Wed, 12 Feb 2020 14:29:57 +0800 Subject: [PATCH] hdmitx: The logo is displayed twice during the restart process [1/1] PD#SWPL-20447 Problem: The logo is displayed twice during the restart process Solution: Modify the codes used to update the status of HPD during the restart. Verify: verify on the board of U212 Change-Id: I05786b0668991eb4c161529d04b0333493475d8c Signed-off-by: Zhengrong Zhu --- .../media/vout/hdmitx/hdmi_common/hdmi_parameters.c | 6 +++++- .../amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/amlogic/media/vout/hdmitx/hdmi_common/hdmi_parameters.c b/drivers/amlogic/media/vout/hdmitx/hdmi_common/hdmi_parameters.c index 679d0ea2e4fa..af2706f3a928 100644 --- a/drivers/amlogic/media/vout/hdmitx/hdmi_common/hdmi_parameters.c +++ b/drivers/amlogic/media/vout/hdmitx/hdmi_common/hdmi_parameters.c @@ -3176,6 +3176,7 @@ struct hdmi_format_para *hdmi_get_fmt_name(char const *name, char const *attr) char *lname; enum hdmi_vic vic = HDMI_Unknown; struct hdmi_format_para *para = &fmt_para_non_hdmi_fmt; + unsigned int copy_len; if (!name) return para; @@ -3196,7 +3197,10 @@ struct hdmi_format_para *hdmi_get_fmt_name(char const *name, char const *attr) sizeof(struct hdmi_format_para *))) { para = all_fmt_paras[i]; memset(¶->ext_name[0], 0, sizeof(para->ext_name)); - memcpy(¶->ext_name[0], name, sizeof(para->ext_name)); + copy_len = strlen(name); + if (copy_len >= sizeof(para->ext_name)) + copy_len = sizeof(para->ext_name) - 1; + memcpy(¶->ext_name[0], name, copy_len); hdmi_parse_attr(para, name); hdmi_parse_attr(para, attr); } else { diff --git a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c index cc2390567f31..f388ab35f5de 100644 --- a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c +++ b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c @@ -5942,6 +5942,12 @@ static int amhdmitx_probe(struct platform_device *pdev) hdmitx_device.nb.notifier_call = hdmitx_reboot_notifier; register_reboot_notifier(&hdmitx_device.nb); + HDMITX_Meson_Init(&hdmitx_device); + + hdmitx_device.hpd_state = !!(hdmitx_device.hwop.cntlmisc( + &hdmitx_device, MISC_HPD_GPI_ST, 0)); + + vout_register_server(&hdmitx_vout_server); #ifdef CONFIG_AMLOGIC_VOUT2_SERVE vout2_register_server(&hdmitx_vout2_server); @@ -5955,8 +5961,6 @@ static int amhdmitx_probe(struct platform_device *pdev) hdmitx_extcon_register(pdev, dev); - HDMITX_Meson_Init(&hdmitx_device); - /* update fmt_attr */ hdmitx_init_fmt_attr(&hdmitx_device);