From 3481d706fb8a33fd718aa8caf31b78fc42883b86 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: May 17 2023 19:16:00 +0000 Subject: drm/amd/display: hpd rx irq not working with eDP interface (bsc#1012628). --- diff --git a/patches.kernel.org/6.3.3-215-drm-amd-display-hpd-rx-irq-not-working-with-eDP.patch b/patches.kernel.org/6.3.3-215-drm-amd-display-hpd-rx-irq-not-working-with-eDP.patch new file mode 100644 index 0000000..82c5c60 --- /dev/null +++ b/patches.kernel.org/6.3.3-215-drm-amd-display-hpd-rx-irq-not-working-with-eDP.patch @@ -0,0 +1,84 @@ +From: Robin Chen +Date: Fri, 17 Feb 2023 20:47:57 +0800 +Subject: [PATCH] drm/amd/display: hpd rx irq not working with eDP interface +References: bsc#1012628 +Patch-mainline: 6.3.3 +Git-commit: eeefe7c4820b6baa0462a8b723ea0a3b5846ccae + +[ Upstream commit eeefe7c4820b6baa0462a8b723ea0a3b5846ccae ] + +[Why] +This is the fix for the defect of commit ab144f0b4ad6 +("drm/amd/display: Allow individual control of eDP hotplug support"). + +[How] +To revise the default eDP hotplug setting and use the enum to git rid +of the magic number for different options. + +Fixes: ab144f0b4ad6 ("drm/amd/display: Allow individual control of eDP hotplug support") +Cc: stable@vger.kernel.org +Cc: Mario Limonciello +Reviewed-by: Wenjing Liu +Acked-by: Qingqing Zhuo +Signed-off-by: Robin Chen +Tested-by: Daniel Wheeler +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +Signed-off-by: Jiri Slaby +--- + drivers/gpu/drm/amd/display/dc/dc_types.h | 7 +++++++ + drivers/gpu/drm/amd/display/dc/link/link_factory.c | 9 +++++++-- + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/amd/display/dc/dc_types.h b/drivers/gpu/drm/amd/display/dc/dc_types.h +index f28b8597..cba65766 100644 +--- a/drivers/gpu/drm/amd/display/dc/dc_types.h ++++ b/drivers/gpu/drm/amd/display/dc/dc_types.h +@@ -1086,4 +1086,11 @@ struct dc_dpia_bw_alloc { + }; + + #define MAX_SINKS_PER_LINK 4 ++ ++enum dc_hpd_enable_select { ++ HPD_EN_FOR_ALL_EDP = 0, ++ HPD_EN_FOR_PRIMARY_EDP_ONLY, ++ HPD_EN_FOR_SECONDARY_EDP_ONLY, ++}; ++ + #endif /* DC_TYPES_H_ */ +diff --git a/drivers/gpu/drm/amd/display/dc/link/link_factory.c b/drivers/gpu/drm/amd/display/dc/link/link_factory.c +index aeb26a4d..8aaf14af 100644 +--- a/drivers/gpu/drm/amd/display/dc/link/link_factory.c ++++ b/drivers/gpu/drm/amd/display/dc/link/link_factory.c +@@ -274,14 +274,18 @@ static bool dc_link_construct_phy(struct dc_link *link, + link->irq_source_hpd = DC_IRQ_SOURCE_INVALID; + + switch (link->dc->config.allow_edp_hotplug_detection) { +- case 1: // only the 1st eDP handles hotplug ++ case HPD_EN_FOR_ALL_EDP: ++ link->irq_source_hpd_rx = ++ dal_irq_get_rx_source(link->hpd_gpio); ++ break; ++ case HPD_EN_FOR_PRIMARY_EDP_ONLY: + if (link->link_index == 0) + link->irq_source_hpd_rx = + dal_irq_get_rx_source(link->hpd_gpio); + else + link->irq_source_hpd = DC_IRQ_SOURCE_INVALID; + break; +- case 2: // only the 2nd eDP handles hotplug ++ case HPD_EN_FOR_SECONDARY_EDP_ONLY: + if (link->link_index == 1) + link->irq_source_hpd_rx = + dal_irq_get_rx_source(link->hpd_gpio); +@@ -289,6 +293,7 @@ static bool dc_link_construct_phy(struct dc_link *link, + link->irq_source_hpd = DC_IRQ_SOURCE_INVALID; + break; + default: ++ link->irq_source_hpd = DC_IRQ_SOURCE_INVALID; + break; + } + } +-- +2.35.3 + diff --git a/series.conf b/series.conf index 5419f8f..d70d5f8 100644 --- a/series.conf +++ b/series.conf @@ -948,6 +948,7 @@ patches.kernel.org/6.3.3-212-Revert-net-sched-flower-Fix-wrong-handle-assign.patch patches.kernel.org/6.3.3-213-drm-msm-adreno-adreno_gpu-Use-suspend-instead-o.patch patches.kernel.org/6.3.3-214-drm-amd-display-merge-dc_link.h-into-dc.h-and-d.patch + patches.kernel.org/6.3.3-215-drm-amd-display-hpd-rx-irq-not-working-with-eDP.patch ######################################################## # Build fixes that apply to the vanilla kernel too.