drm/amd/display: hpd rx irq not working with eDP interface
authorRobin Chen <robin.chen@amd.com>
Fri, 17 Feb 2023 12:47:57 +0000 (20:47 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 15 Mar 2023 22:45:13 +0000 (18:45 -0400)
[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 <mario.limonciello@amd.com>
Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Robin Chen <robin.chen@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc_types.h
drivers/gpu/drm/amd/display/dc/link/link_factory.c

index 4b47fa00610b4b2c9b8ac5c5efc3ea9f8496db0e..45ab48fe5d004b9c02d81458814e741a2437b905 100644 (file)
@@ -1080,4 +1080,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_ */
index 995032a341b38d0f70038bfecdc2072d3328cb48..3951d48118c4a67c5dd3459564ec8407dbffa3be 100644 (file)
@@ -528,14 +528,18 @@ static bool 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);
@@ -543,6 +547,7 @@ static bool 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;
                        }
                }