From: Joseph Gravenor <[email protected]>

[why]
not turning off the mst hub before detection on reboot
causes us to not be able to light up displays with mst hook

[how]
on hw init, see if any displays are lit up. if so, turn them off

Signed-off-by: Joseph Gravenor <[email protected]>
Reviewed-by: Eric Yang <[email protected]>
Acked-by: Bhawanpreet Lakha <[email protected]>
---
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 22 +++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

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 0225f8d8bb82..42fcfee2c31b 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
@@ -48,8 +48,8 @@
 #include "dc_link_dp.h"
 #include "dccg.h"
 #include "clk_mgr.h"
-
-
+#include "link_hwss.h"
+#include "dpcd_defs.h"
 #include "dsc.h"
 
 #define DC_LOGGER_INIT(logger)
@@ -1322,6 +1322,24 @@ void dcn10_init_hw(struct dc *dc)
                if (hws->funcs.dsc_pg_control != NULL)
                        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) {
+               uint8_t dpcd_power_state = '\0';
+               enum dc_status status = DC_ERROR_UNEXPECTED;
+
+               for (i = 0; i < dc->link_count; i++) {
+                       if (dc->links[i]->connector_signal != 
SIGNAL_TYPE_DISPLAY_PORT) {
+                               continue;
+                       }
+                       /* if any of the displays are lit up turn them off */
+                       status = core_link_read_dpcd(dc->links[i], DP_SET_POWER,
+                                                    &dpcd_power_state, 
sizeof(dpcd_power_state));
+                       if (status == DC_OK && dpcd_power_state == 
DP_POWER_STATE_D0) {
+                               dp_receiver_power_ctrl(dc->links[i], false);
+                       }
+               }
+       }
+
        /* 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
         * pipes we want to use.
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to