]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/display: Allow individual control of eDP hotplug support
authorDerek Lai <Derek.Lai@amd.com>
Thu, 5 May 2022 09:59:49 +0000 (17:59 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 26 May 2022 18:56:30 +0000 (14:56 -0400)
[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.Kazlauskas@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Derek Lai <Derek.Lai@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/core/dc_link.c
drivers/gpu/drm/amd/display/dc/dc.h

index b40abd2bf7f6409fccfa8774140811f8521d4855..a789ea8af27f1fabe33500b3520f2331f3ee6263 100644 (file)
@@ -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;
index 26c24db8f1da2711fa466f75d0fbf1606f2713d1..7cfc04a8ef152e4ba30f394b3bed2f7009a58147 100644 (file)
@@ -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;