From: Derek Lai <derek....@amd.com>

[Why]
Second eDP can send display off notification through HPD
but DC isn't hooked up to handle. Some primary eDP panels
will toggle on/off incorrectly if it's enabled generically.

[How]
Extend the debug option to allow individually enabling hotplug
either the first eDP or the second eDP in a dual eDP system.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlaus...@amd.com>
Acked-by: Qingqing Zhuo <qingqing.z...@amd.com>
Signed-off-by: Derek Lai <derek....@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 21 +++++++++++++++++--
 drivers/gpu/drm/amd/display/dc/dc.h           |  2 +-
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c 
b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index b40abd2bf7f6..a789ea8af27f 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -1605,8 +1605,25 @@ static bool dc_link_construct_legacy(struct dc_link 
*link,
                if (link->hpd_gpio) {
                        if (!link->dc->config.allow_edp_hotplug_detection)
                                link->irq_source_hpd = DC_IRQ_SOURCE_INVALID;
-                       link->irq_source_hpd_rx =
-                                       dal_irq_get_rx_source(link->hpd_gpio);
+
+                       switch (link->dc->config.allow_edp_hotplug_detection) {
+                       case 1: // only the 1st eDP handles hotplug
+                               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
+                               if (link->link_index == 1)
+                                       link->irq_source_hpd_rx =
+                                               
dal_irq_get_rx_source(link->hpd_gpio);
+                               else
+                                       link->irq_source_hpd = 
DC_IRQ_SOURCE_INVALID;
+                               break;
+                       default:
+                               break;
+                       }
                }
 
                break;
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h 
b/drivers/gpu/drm/amd/display/dc/dc.h
index 26c24db8f1da..7cfc04a8ef15 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -329,7 +329,7 @@ struct dc_config {
        bool disable_dmcu;
        bool enable_4to1MPC;
        bool enable_windowed_mpo_odm;
-       bool allow_edp_hotplug_detection;
+       uint32_t allow_edp_hotplug_detection;
        bool clamp_min_dcfclk;
        uint64_t vblank_alignment_dto_params;
        uint8_t  vblank_alignment_max_frame_time_diff;
-- 
2.25.1

Reply via email to