From 87f71506f6467db433957aef044488df2e36b864 Mon Sep 17 00:00:00 2001 From: Ao Xu Date: Sat, 7 Oct 2023 10:18:49 +0800 Subject: [PATCH] hdmitx: fix earc probe crash and no plugout uevent issue [1/1] PD#SWPL-141704 Problem: 1 earc probe crash hdmitx21_hpd_hw_op+0x14/0x80 [aml_media] hdmitx21_earc_hpdst+0x28/0x48 [aml_media] register_earcrx_callback+0x4c/0x60 [aml_media] earc_platform_probe+0x628/0x9e0 [amlogic_snd_soc] 2 hdmitx21 did not call drm hpd callback Solution: 1 separate hdmitx20 and hdmitx21 earc register api 2 call hpd callback when call plugout handler Verify: ac200/t7c/s1a Test: DRM-TX-41 Change-Id: I829da54849b152420de9409e42f46ae1016c22c5 Signed-off-by: Ao Xu --- drivers/drm/meson_hdmi.c | 4 ++-- drivers/media/vout/hdmitx21/hdmi_tx_ext.c | 2 +- drivers/media/vout/hdmitx21/hdmi_tx_main.c | 6 ++++-- drivers/media/vout/hdmitx_common/hdmitx_common.c | 4 ---- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/drm/meson_hdmi.c b/drivers/drm/meson_hdmi.c index 722952134..cbd92507b 100644 --- a/drivers/drm/meson_hdmi.c +++ b/drivers/drm/meson_hdmi.c @@ -114,8 +114,8 @@ struct hdmitx_color_attr other_color_attr_list[] = { void convert_attrstr(char *attr_str, struct hdmitx_color_attr *attr_param) { - attr_param->colorformat = HDMI_COLORSPACE_RESERVED6; - attr_param->bitdepth = COLORDEPTH_RESERVED; + attr_param->colorformat = HDMI_COLORSPACE_YUV444; + attr_param->bitdepth = 8; if (strstr(attr_str, "420")) attr_param->colorformat = HDMI_COLORSPACE_YUV420; diff --git a/drivers/media/vout/hdmitx21/hdmi_tx_ext.c b/drivers/media/vout/hdmitx21/hdmi_tx_ext.c index 912ec8a0b..53f51331e 100644 --- a/drivers/media/vout/hdmitx21/hdmi_tx_ext.c +++ b/drivers/media/vout/hdmitx21/hdmi_tx_ext.c @@ -133,7 +133,7 @@ int register_earcrx_callback(pf_callback callback) * doesn't know if HDMI Tx cable plug in/out. * so don't check hdmitx21 init or not */ - /*if (get_hdmitx21_init() == 1)*/ + if (get_hdmitx21_init() == 1) hdmitx21_earc_hpdst(callback); #endif return 0; diff --git a/drivers/media/vout/hdmitx21/hdmi_tx_main.c b/drivers/media/vout/hdmitx21/hdmi_tx_main.c index 1674f057b..e465680bc 100644 --- a/drivers/media/vout/hdmitx21/hdmi_tx_main.c +++ b/drivers/media/vout/hdmitx21/hdmi_tx_main.c @@ -3608,11 +3608,13 @@ static void hdmitx_hpd_plugout_irq_handler(struct work_struct *work) mutex_unlock(&hdev->tx_comm.hdmimode_mutex); return; } + hdmitx_plugout_handler(hdev); mutex_unlock(&hdev->tx_comm.hdmimode_mutex); - /*notify event to user space and other modules*/ - hdmitx_common_notify_hpd_status(&hdev->tx_comm); + /* notify to drm hdmi, TO CONFIRM: if need the suspend flag? */ + if (!hdev->tx_comm.suspend_flag) + hdmitx_hpd_notify_unlocked(&hdev->tx_comm); } int get21_hpd_state(void) diff --git a/drivers/media/vout/hdmitx_common/hdmitx_common.c b/drivers/media/vout/hdmitx_common/hdmitx_common.c index 493aa7959..c18fbe10e 100644 --- a/drivers/media/vout/hdmitx_common/hdmitx_common.c +++ b/drivers/media/vout/hdmitx_common/hdmitx_common.c @@ -593,10 +593,6 @@ EXPORT_SYMBOL(hdmitx_common_parse_vic_in_edid); int hdmitx_common_notify_hpd_status(struct hdmitx_common *tx_comm) { if (!tx_comm->suspend_flag) { - /*TOCONFIRM: notify to drm*/ - /* if (tx_comm->drm_hpd_cb.callback) */ - /* tx_comm->drm_hpd_cb.callback(tx_comm->drm_hpd_cb.data); */ - /*notify to userspace by uevent*/ hdmitx_event_mgr_send_uevent(tx_comm->event_mgr, HDMITX_HPD_EVENT, tx_comm->hpd_state);