drm/amd/display: Apply correct panel mode when reinitializing hardware
authorMichael Mityushkin <michael.mityushkin@amd.com>
Thu, 30 Mar 2023 15:35:08 +0000 (11:35 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Apr 2023 02:34:29 +0000 (22:34 -0400)
[Why]
When link training during engine recovery, ASSR might fail causing panel
mode to be reset to default. This should not happen for eDP as it
will prevent the panel from turning back on.

[How]
Added dp_panel_mode to struct dc_link to remember previously applied
panel mode. Do not reset panel mode to default while performing link
training if previously used panel mode = eDP.

Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Michael Mityushkin <michael.mityushkin@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.h
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c

index 23ee63b98dcde28f2517653709bb094469f5cec3..30f0ba05a6e6c3043b9652aa0ed54c39130fccfd 100644 (file)
@@ -1454,6 +1454,7 @@ struct dc_link {
 
        struct ddc_service *ddc;
 
+       enum dp_panel_mode panel_mode;
        bool aux_mode;
 
        /* Private to DC core */
index 170f3383593018c73849ac08ecfff4da5079f9ee..579fa222810d4ad0a7508d35275649ad4c2e1b4d 100644 (file)
@@ -1596,7 +1596,10 @@ bool perform_link_training_with_retries(
                                 * Report and continue with eDP panel mode to
                                 * perform eDP link training with right settings
                                 */
-                               cp_psp->funcs.enable_assr(cp_psp->handle, link);
+                               bool result;
+                               result = cp_psp->funcs.enable_assr(cp_psp->handle, link);
+                               if (!result && link->panel_mode != DP_PANEL_MODE_EDP)
+                                       panel_mode = DP_PANEL_MODE_DEFAULT;
                        }
                }
 
index d895046787bc45cae853a70a2ff8e8c40ba741ec..8d1df863659ce6e26b2c2352ed14993522e7a0c8 100644 (file)
@@ -83,6 +83,7 @@ void dp_set_panel_mode(struct dc_link *link, enum dp_panel_mode panel_mode)
                        ASSERT(result == DC_OK);
                }
        }
+       link->panel_mode = panel_mode;
        DC_LOG_DETECTION_DP_CAPS("Link: %d eDP panel mode supported: %d "
                 "eDP panel mode enabled: %d \n",
                 link->link_index,