]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/display: Support mappable encoders when transmitting training patterns.
authorJimmy Kizito <Jimmy.Kizito@amd.com>
Wed, 21 Apr 2021 14:34:34 +0000 (10:34 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 8 Jun 2021 16:19:43 +0000 (12:19 -0400)
[Why & How]
Add support for transmitting training pattern sequences for links whose
encoders have been dynamically assigned.

Signed-off-by: Jimmy Kizito <Jimmy.Kizito@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Stylon Wang <stylon.wang@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_hwss.c

index 13c5c4a34a58473d190ab792912ee7ceadc36e32..f7dfc8fefdfafa27b412a1d303c2881085d24bdc 100644 (file)
@@ -332,7 +332,16 @@ void dp_set_hw_test_pattern(
        uint32_t custom_pattern_size)
 {
        struct encoder_set_dp_phy_pattern_param pattern_param = {0};
-       struct link_encoder *encoder = link->link_enc;
+       struct link_encoder *encoder;
+
+       /* Access link encoder based on whether it is statically
+        * or dynamically assigned to a link.
+        */
+       if (link->is_dig_mapping_flexible &&
+                       link->dc->res_pool->funcs->link_encs_assign)
+               encoder = link_enc_cfg_get_link_enc_used_by_link(link->dc->current_state, link);
+       else
+               encoder = link->link_enc;
 
        pattern_param.dp_phy_pattern = test_pattern;
        pattern_param.custom_pattern = custom_pattern;