From: Jarif Aftab <[email protected]>

[WHY]
- We only ever want seamless boots on eDPs
- The naming and logic did not match the context

[HOW]
- Removed unnecessary if statements
- Renamed power_down_display_on_boot to seamless_boot_edp_requested and
swapped the logic

Reviewed-by: Martin Leung <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Jarif Aftab <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c    |  4 ++--
 drivers/gpu/drm/amd/display/dc/core/dc_link.c        | 12 ------------
 drivers/gpu/drm/amd/display/dc/dc.h                  |  2 +-
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c    |  5 ++---
 drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c   |  7 +++----
 drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c   |  5 ++---
 6 files changed, 10 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 17fd37ee6251..921e5a718ecf 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -1496,10 +1496,10 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
                init_data.flags.allow_lttpr_non_transparent_mode.bits.DP2_0 = 
true;
 #endif
 
-       init_data.flags.power_down_display_on_boot = true;
+       init_data.flags.seamless_boot_edp_requested = false;
 
        if (check_seamless_boot_capability(adev)) {
-               init_data.flags.power_down_display_on_boot = false;
+               init_data.flags.seamless_boot_edp_requested = true;
                init_data.flags.allow_seamless_boot_optimization = true;
                DRM_INFO("Seamless boot condition check passed\n");
        }
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 b5e570d33ca9..0c64dea4fdd8 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -1019,18 +1019,6 @@ static bool dc_link_detect_helper(struct dc_link *link,
                                        link->type != dc_connection_mst_branch)
                                dm_helpers_dp_mst_stop_top_mgr(link->ctx, link);
 
-
-                       // For seamless boot, to skip verify link cap, we read 
UEFI settings and set them as verified.
-                       if (reason == DETECT_REASON_BOOT &&
-                                       
!dc_ctx->dc->config.power_down_display_on_boot &&
-                                       link->link_status.link_active)
-                               perform_dp_seamless_boot = true;
-
-                       if (perform_dp_seamless_boot) {
-                               read_current_link_settings_on_detect(link);
-                               link->verified_link_cap = 
link->reported_link_cap;
-                       }
-
                        break;
                }
 
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h 
b/drivers/gpu/drm/amd/display/dc/dc.h
index 288e7b01f561..263f7edd42a4 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -322,7 +322,7 @@ struct dc_config {
        bool fbc_support;
        bool disable_fractional_pwm;
        bool allow_seamless_boot_optimization;
-       bool power_down_display_on_boot;
+       bool seamless_boot_edp_requested;
        bool edp_not_connected;
        bool edp_no_power_sequencing;
        bool force_enum_edp;
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c 
b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
index 530a72e3eefe..915eecb40788 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
@@ -1505,8 +1505,7 @@ void dcn10_init_hw(struct dc *dc)
                dmub_enable_outbox_notification(dc);
 
        /* we want to turn off all dp displays before doing detection */
-       if (dc->config.power_down_display_on_boot)
-               dc_link_blank_all_dp_displays(dc);
+       dc_link_blank_all_dp_displays(dc);
 
        /* If taking control over from VBIOS, we may want to optimize our first
         * mode set, so we need to skip powering down pipes until we know which
@@ -1514,7 +1513,7 @@ void dcn10_init_hw(struct dc *dc)
         * Otherwise, if taking control is not possible, we need to power
         * everything down.
         */
-       if (dcb->funcs->is_accelerated_mode(dcb) || 
dc->config.power_down_display_on_boot) {
+       if (dcb->funcs->is_accelerated_mode(dcb) || 
!dc->config.seamless_boot_edp_requested) {
                if (!is_optimized_init_done) {
                        hws->funcs.init_pipes(dc, dc->current_state);
                        if 
(dc->res_pool->hubbub->funcs->allow_self_refresh_control)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c 
b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c
index 1db1ca19411d..ed0a0e5fd805 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c
@@ -545,8 +545,7 @@ void dcn30_init_hw(struct dc *dc)
                        hws->funcs.dsc_pg_control(hws, res_pool->dscs[i]->inst, 
false);
 
        /* we want to turn off all dp displays before doing detection */
-       if (dc->config.power_down_display_on_boot)
-               dc_link_blank_all_dp_displays(dc);
+       dc_link_blank_all_dp_displays(dc);
 
        /* If taking control over from VBIOS, we may want to optimize our first
         * mode set, so we need to skip powering down pipes until we know which
@@ -554,7 +553,7 @@ void dcn30_init_hw(struct dc *dc)
         * Otherwise, if taking control is not possible, we need to power
         * everything down.
         */
-       if (dcb->funcs->is_accelerated_mode(dcb) || 
dc->config.power_down_display_on_boot) {
+       if (dcb->funcs->is_accelerated_mode(dcb) || 
!dc->config.seamless_boot_edp_requested) {
                hws->funcs.init_pipes(dc, dc->current_state);
                if (dc->res_pool->hubbub->funcs->allow_self_refresh_control)
                        
dc->res_pool->hubbub->funcs->allow_self_refresh_control(dc->res_pool->hubbub,
@@ -566,7 +565,7 @@ void dcn30_init_hw(struct dc *dc)
         * To avoid this, power down hardware on boot
         * if DIG is turned on and seamless boot not enabled
         */
-       if (dc->config.power_down_display_on_boot) {
+       if (!dc->config.seamless_boot_edp_requested) {
                struct dc_link *edp_links[MAX_NUM_EDP];
                struct dc_link *edp_link = NULL;
 
diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c 
b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c
index 4206ce5bf9a9..b2cfd277b913 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c
@@ -197,8 +197,7 @@ void dcn31_init_hw(struct dc *dc)
                dmub_enable_outbox_notification(dc);
 
        /* we want to turn off all dp displays before doing detection */
-       if (dc->config.power_down_display_on_boot)
-               dc_link_blank_all_dp_displays(dc);
+       dc_link_blank_all_dp_displays(dc);
 
        /* If taking control over from VBIOS, we may want to optimize our first
         * mode set, so we need to skip powering down pipes until we know which
@@ -206,7 +205,7 @@ void dcn31_init_hw(struct dc *dc)
         * Otherwise, if taking control is not possible, we need to power
         * everything down.
         */
-       if (dcb->funcs->is_accelerated_mode(dcb) || 
dc->config.power_down_display_on_boot) {
+       if (dcb->funcs->is_accelerated_mode(dcb) || 
!dc->config.seamless_boot_edp_requested) {
                hws->funcs.init_pipes(dc, dc->current_state);
                if (dc->res_pool->hubbub->funcs->allow_self_refresh_control)
                        
dc->res_pool->hubbub->funcs->allow_self_refresh_control(dc->res_pool->hubbub,
-- 
2.25.1

Reply via email to