* [PATCH v4 1/1] drm/mediatek: dp: Add sdp path reset
@ 2024-11-28 2:37 Liankun Yang
2024-12-10 9:32 ` CK Hu (胡俊光)
2024-12-25 13:38 ` Chun-Kuang Hu
0 siblings, 2 replies; 3+ messages in thread
From: Liankun Yang @ 2024-11-28 2:37 UTC (permalink / raw)
To: chunkuang.hu, p.zabel, airlied, simona, matthias.bgg,
angelogioacchino.delregno, jitao.shi, mac.shen, peng.liu,
liankun.yang, Project_Global_Chrome_Upstream_Group
Cc: dri-devel, linux-mediatek, linux-arm-kernel, linux-kernel
When using type-c to type-c to connect to the monitor,
the sound plays normally. If you unplug the type-c and
connect the type-c to hdmi dongle to the monitor, there will be noise.
By capturing the audio data, it is found that
the data position is messy, and there is no error in the data.
Through experiments, it can be restored by resetting the SDP path
when unplugging it.
Signed-off-by: Liankun Yang <liankun.yang@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
Changes in V4:
- Fix align to the right of '('.
Per suggestion from the previous thread:
https://patchwork.kernel.org/project/linux-mediatek/patch/20240925064854.23065-1-liankun.yang@mediatek.com/
Changes in V3:
- No change.
Per suggestion from the previous thread:
https://patchwork.kernel.org/project/linux-mediatek/patch/20240923132521.22785-1-liankun.yang@mediatek.com/
Changes in V2:
- Fix build error.
Per suggestion from the previous thread:
https://patchwork.kernel.org/project/linux-mediatek/patch/20240923133610.23728-1-liankun.yang@mediatek.com/
---
drivers/gpu/drm/mediatek/mtk_dp.c | 15 +++++++++++++++
drivers/gpu/drm/mediatek/mtk_dp_reg.h | 1 +
2 files changed, 16 insertions(+)
diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
index 1cc916b16471..4f4233bd83f7 100644
--- a/drivers/gpu/drm/mediatek/mtk_dp.c
+++ b/drivers/gpu/drm/mediatek/mtk_dp.c
@@ -1135,6 +1135,18 @@ static void mtk_dp_digital_sw_reset(struct mtk_dp *mtk_dp)
0, DP_TX_TRANSMITTER_4P_RESET_SW_DP_TRANS_P0);
}
+static void mtk_dp_sdp_path_reset(struct mtk_dp *mtk_dp)
+{
+ mtk_dp_update_bits(mtk_dp, MTK_DP_ENC0_P0_3004,
+ SDP_RESET_SW_DP_ENC0_P0,
+ SDP_RESET_SW_DP_ENC0_P0);
+
+ /* Wait for sdp path reset to complete */
+ usleep_range(1000, 5000);
+ mtk_dp_update_bits(mtk_dp, MTK_DP_ENC0_P0_3004,
+ 0, SDP_RESET_SW_DP_ENC0_P0);
+}
+
static void mtk_dp_set_lanes(struct mtk_dp *mtk_dp, int lanes)
{
mtk_dp_update_bits(mtk_dp, MTK_DP_TRANS_P0_35F0,
@@ -2397,6 +2409,9 @@ static void mtk_dp_bridge_atomic_disable(struct drm_bridge *bridge,
DP_PWR_STATE_BANDGAP_TPLL,
DP_PWR_STATE_MASK);
+ /* SDP path reset sw*/
+ mtk_dp_sdp_path_reset(mtk_dp);
+
/* Ensure the sink is muted */
msleep(20);
}
diff --git a/drivers/gpu/drm/mediatek/mtk_dp_reg.h b/drivers/gpu/drm/mediatek/mtk_dp_reg.h
index 709b79480693..8ad7a9cc259e 100644
--- a/drivers/gpu/drm/mediatek/mtk_dp_reg.h
+++ b/drivers/gpu/drm/mediatek/mtk_dp_reg.h
@@ -86,6 +86,7 @@
#define MTK_DP_ENC0_P0_3004 0x3004
#define VIDEO_M_CODE_SEL_DP_ENC0_P0_MASK BIT(8)
#define DP_TX_ENCODER_4P_RESET_SW_DP_ENC0_P0 BIT(9)
+#define SDP_RESET_SW_DP_ENC0_P0 BIT(13)
#define MTK_DP_ENC0_P0_3010 0x3010
#define HTOTAL_SW_DP_ENC0_P0_MASK GENMASK(15, 0)
#define MTK_DP_ENC0_P0_3014 0x3014
--
2.45.2
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v4 1/1] drm/mediatek: dp: Add sdp path reset
2024-11-28 2:37 [PATCH v4 1/1] drm/mediatek: dp: Add sdp path reset Liankun Yang
@ 2024-12-10 9:32 ` CK Hu (胡俊光)
2024-12-25 13:38 ` Chun-Kuang Hu
1 sibling, 0 replies; 3+ messages in thread
From: CK Hu (胡俊光) @ 2024-12-10 9:32 UTC (permalink / raw)
To: Mac Shen (沈俊),
chunkuang.hu, simona, AngeloGioacchino Del Regno, airlied,
Project_Global_Chrome_Upstream_Group,
Jitao Shi (石记涛),
p.zabel, matthias.bgg, Peng Liu (刘鹏),
LIANKUN YANG (杨连坤)
Cc: dri-devel, linux-mediatek, linux-arm-kernel, linux-kernel
Hi, Liankun:
On Thu, 2024-11-28 at 10:37 +0800, Liankun Yang wrote:
> When using type-c to type-c to connect to the monitor,
> the sound plays normally. If you unplug the type-c and
> connect the type-c to hdmi dongle to the monitor, there will be noise.
>
> By capturing the audio data, it is found that
> the data position is messy, and there is no error in the data.
>
> Through experiments, it can be restored by resetting the SDP path
> when unplugging it.
Reviewed-by: CK Hu <ck.hu@mediatek.com>
>
> Signed-off-by: Liankun Yang <liankun.yang@mediatek.com>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
> Changes in V4:
> - Fix align to the right of '('.
> Per suggestion from the previous thread:
> https://urldefense.com/v3/__https://patchwork.kernel.org/project/linux-mediatek/patch/20240925064854.23065-1-liankun.yang@mediatek.com/__;!!CTRNKA9wMg0ARbw!moBIboZU1a4UlCJ0PNdls-Wyg8zCbx_60VUFdSkCnk5IXzWsiAnF1DpO_4qFz0xvDoTsAKkDVd38PvIu2EFntv4$
>
> Changes in V3:
> - No change.
> Per suggestion from the previous thread:
> https://urldefense.com/v3/__https://patchwork.kernel.org/project/linux-mediatek/patch/20240923132521.22785-1-liankun.yang@mediatek.com/__;!!CTRNKA9wMg0ARbw!moBIboZU1a4UlCJ0PNdls-Wyg8zCbx_60VUFdSkCnk5IXzWsiAnF1DpO_4qFz0xvDoTsAKkDVd38PvIusbUGckk$
>
> Changes in V2:
> - Fix build error.
> Per suggestion from the previous thread:
> https://urldefense.com/v3/__https://patchwork.kernel.org/project/linux-mediatek/patch/20240923133610.23728-1-liankun.yang@mediatek.com/__;!!CTRNKA9wMg0ARbw!moBIboZU1a4UlCJ0PNdls-Wyg8zCbx_60VUFdSkCnk5IXzWsiAnF1DpO_4qFz0xvDoTsAKkDVd38PvIutNJ46WI$
> ---
> drivers/gpu/drm/mediatek/mtk_dp.c | 15 +++++++++++++++
> drivers/gpu/drm/mediatek/mtk_dp_reg.h | 1 +
> 2 files changed, 16 insertions(+)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
> index 1cc916b16471..4f4233bd83f7 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dp.c
> @@ -1135,6 +1135,18 @@ static void mtk_dp_digital_sw_reset(struct mtk_dp *mtk_dp)
> 0, DP_TX_TRANSMITTER_4P_RESET_SW_DP_TRANS_P0);
> }
>
> +static void mtk_dp_sdp_path_reset(struct mtk_dp *mtk_dp)
> +{
> + mtk_dp_update_bits(mtk_dp, MTK_DP_ENC0_P0_3004,
> + SDP_RESET_SW_DP_ENC0_P0,
> + SDP_RESET_SW_DP_ENC0_P0);
> +
> + /* Wait for sdp path reset to complete */
> + usleep_range(1000, 5000);
> + mtk_dp_update_bits(mtk_dp, MTK_DP_ENC0_P0_3004,
> + 0, SDP_RESET_SW_DP_ENC0_P0);
> +}
> +
> static void mtk_dp_set_lanes(struct mtk_dp *mtk_dp, int lanes)
> {
> mtk_dp_update_bits(mtk_dp, MTK_DP_TRANS_P0_35F0,
> @@ -2397,6 +2409,9 @@ static void mtk_dp_bridge_atomic_disable(struct drm_bridge *bridge,
> DP_PWR_STATE_BANDGAP_TPLL,
> DP_PWR_STATE_MASK);
>
> + /* SDP path reset sw*/
> + mtk_dp_sdp_path_reset(mtk_dp);
> +
> /* Ensure the sink is muted */
> msleep(20);
> }
> diff --git a/drivers/gpu/drm/mediatek/mtk_dp_reg.h b/drivers/gpu/drm/mediatek/mtk_dp_reg.h
> index 709b79480693..8ad7a9cc259e 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dp_reg.h
> +++ b/drivers/gpu/drm/mediatek/mtk_dp_reg.h
> @@ -86,6 +86,7 @@
> #define MTK_DP_ENC0_P0_3004 0x3004
> #define VIDEO_M_CODE_SEL_DP_ENC0_P0_MASK BIT(8)
> #define DP_TX_ENCODER_4P_RESET_SW_DP_ENC0_P0 BIT(9)
> +#define SDP_RESET_SW_DP_ENC0_P0 BIT(13)
> #define MTK_DP_ENC0_P0_3010 0x3010
> #define HTOTAL_SW_DP_ENC0_P0_MASK GENMASK(15, 0)
> #define MTK_DP_ENC0_P0_3014 0x3014
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v4 1/1] drm/mediatek: dp: Add sdp path reset
2024-11-28 2:37 [PATCH v4 1/1] drm/mediatek: dp: Add sdp path reset Liankun Yang
2024-12-10 9:32 ` CK Hu (胡俊光)
@ 2024-12-25 13:38 ` Chun-Kuang Hu
1 sibling, 0 replies; 3+ messages in thread
From: Chun-Kuang Hu @ 2024-12-25 13:38 UTC (permalink / raw)
To: Liankun Yang
Cc: chunkuang.hu, p.zabel, airlied, simona, matthias.bgg,
angelogioacchino.delregno, jitao.shi, mac.shen, peng.liu,
Project_Global_Chrome_Upstream_Group, dri-devel, linux-mediatek,
linux-arm-kernel, linux-kernel
Hi, Liankun:
Liankun Yang <liankun.yang@mediatek.com> 於 2024年11月28日 週四 上午10:37寫道:
>
> When using type-c to type-c to connect to the monitor,
> the sound plays normally. If you unplug the type-c and
> connect the type-c to hdmi dongle to the monitor, there will be noise.
>
> By capturing the audio data, it is found that
> the data position is messy, and there is no error in the data.
>
> Through experiments, it can be restored by resetting the SDP path
> when unplugging it.
Applied to mediatek-drm-next [1], thanks.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next
Regards,
Chun-Kuang.
>
> Signed-off-by: Liankun Yang <liankun.yang@mediatek.com>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
> Changes in V4:
> - Fix align to the right of '('.
> Per suggestion from the previous thread:
> https://patchwork.kernel.org/project/linux-mediatek/patch/20240925064854.23065-1-liankun.yang@mediatek.com/
>
> Changes in V3:
> - No change.
> Per suggestion from the previous thread:
> https://patchwork.kernel.org/project/linux-mediatek/patch/20240923132521.22785-1-liankun.yang@mediatek.com/
>
> Changes in V2:
> - Fix build error.
> Per suggestion from the previous thread:
> https://patchwork.kernel.org/project/linux-mediatek/patch/20240923133610.23728-1-liankun.yang@mediatek.com/
> ---
> drivers/gpu/drm/mediatek/mtk_dp.c | 15 +++++++++++++++
> drivers/gpu/drm/mediatek/mtk_dp_reg.h | 1 +
> 2 files changed, 16 insertions(+)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
> index 1cc916b16471..4f4233bd83f7 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dp.c
> @@ -1135,6 +1135,18 @@ static void mtk_dp_digital_sw_reset(struct mtk_dp *mtk_dp)
> 0, DP_TX_TRANSMITTER_4P_RESET_SW_DP_TRANS_P0);
> }
>
> +static void mtk_dp_sdp_path_reset(struct mtk_dp *mtk_dp)
> +{
> + mtk_dp_update_bits(mtk_dp, MTK_DP_ENC0_P0_3004,
> + SDP_RESET_SW_DP_ENC0_P0,
> + SDP_RESET_SW_DP_ENC0_P0);
> +
> + /* Wait for sdp path reset to complete */
> + usleep_range(1000, 5000);
> + mtk_dp_update_bits(mtk_dp, MTK_DP_ENC0_P0_3004,
> + 0, SDP_RESET_SW_DP_ENC0_P0);
> +}
> +
> static void mtk_dp_set_lanes(struct mtk_dp *mtk_dp, int lanes)
> {
> mtk_dp_update_bits(mtk_dp, MTK_DP_TRANS_P0_35F0,
> @@ -2397,6 +2409,9 @@ static void mtk_dp_bridge_atomic_disable(struct drm_bridge *bridge,
> DP_PWR_STATE_BANDGAP_TPLL,
> DP_PWR_STATE_MASK);
>
> + /* SDP path reset sw*/
> + mtk_dp_sdp_path_reset(mtk_dp);
> +
> /* Ensure the sink is muted */
> msleep(20);
> }
> diff --git a/drivers/gpu/drm/mediatek/mtk_dp_reg.h b/drivers/gpu/drm/mediatek/mtk_dp_reg.h
> index 709b79480693..8ad7a9cc259e 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dp_reg.h
> +++ b/drivers/gpu/drm/mediatek/mtk_dp_reg.h
> @@ -86,6 +86,7 @@
> #define MTK_DP_ENC0_P0_3004 0x3004
> #define VIDEO_M_CODE_SEL_DP_ENC0_P0_MASK BIT(8)
> #define DP_TX_ENCODER_4P_RESET_SW_DP_ENC0_P0 BIT(9)
> +#define SDP_RESET_SW_DP_ENC0_P0 BIT(13)
> #define MTK_DP_ENC0_P0_3010 0x3010
> #define HTOTAL_SW_DP_ENC0_P0_MASK GENMASK(15, 0)
> #define MTK_DP_ENC0_P0_3014 0x3014
> --
> 2.45.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-12-25 13:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-28 2:37 [PATCH v4 1/1] drm/mediatek: dp: Add sdp path reset Liankun Yang
2024-12-10 9:32 ` CK Hu (胡俊光)
2024-12-25 13:38 ` Chun-Kuang Hu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®