]> git.baikalelectronics.ru Git - kernel.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 13:03:17 +0000 (14:03 +0100)
commit eeefe7c4820b6baa0462a8b723ea0a3b5846ccae upstream.

[Why]
This is the fix for the defect of commit 7da9694efabd
("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: 7da9694efabd ("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>
(cherry picked from commit eeefe7c4820b6baa0462a8b723ea0a3b5846ccae)
Hand modified for missing file rename changes and symbol moves in 6.1.y.
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/display/dc/core/dc_link.c
drivers/gpu/drm/amd/display/dc/dc_types.h

index 6299130663a3d7c6e18a39303c0eac26d505b4cf..5d53e54ebe90b9bc6fb08bdd6b6a04f1aefcd97d 100644 (file)
@@ -1634,14 +1634,18 @@ static bool dc_link_construct_legacy(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);
@@ -1649,6 +1653,7 @@ static bool dc_link_construct_legacy(struct dc_link *link,
                                        link->irq_source_hpd = DC_IRQ_SOURCE_INVALID;
                                break;
                        default:
+                               link->irq_source_hpd = DC_IRQ_SOURCE_INVALID;
                                break;
                        }
                }
index ad9041472ccae1aadf460500225f11ae83b71cfa..6050a3469a57ca43b5c1e0c53f1fa815d3a2b280 100644 (file)
@@ -993,4 +993,10 @@ struct display_endpoint_id {
        enum display_endpoint_type ep_type;
 };
 
+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_ */