drm/amd/display: stop doing unnecessary detection when going to D3
authorJoseph Gravenor <joseph.gravenor@amd.com>
Thu, 12 Dec 2019 20:40:50 +0000 (15:40 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 16 Jan 2020 19:12:07 +0000 (14:12 -0500)
[Why]
Don't want to start HW discovery unless we have lost power,
as doing rediscovery otherwise is both unnecessary and time consuming.
Before this change it takes 40 seconds to go in to suspend, after it
takes 27 seconds

[How]
Accelerated mode gets cleared if we lose power. Only do detection if
this register is cleared

Signed-off-by: Joseph Gravenor <joseph.gravenor@amd.com>
Reviewed-by: Eric Yang <eric.yang2@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/dc.h

index 46f2b54c3526cb0b60d34aea441a8480b054c468..c918a0cd8c604ba2af58152efbfd2eed6f0da77e 100644 (file)
@@ -1318,6 +1318,12 @@ bool dc_commit_state(struct dc *dc, struct dc_state *context)
        return (result == DC_OK);
 }
 
+bool dc_is_hw_initialized(struct dc *dc)
+{
+       struct dc_bios *dcb = dc->ctx->dc_bios;
+       return dcb->funcs->is_accelerated_mode(dcb);
+}
+
 bool dc_post_update_surfaces_to_stream(struct dc *dc)
 {
        int i;
index 29762b0531fc44360afbe61133bad2d00d283431..d1d57432bc7e3d277915de9e13159aaa05e966eb 100644 (file)
@@ -1069,6 +1069,7 @@ unsigned int dc_get_current_backlight_pwm(struct dc *dc);
 unsigned int dc_get_target_backlight_pwm(struct dc *dc);
 
 bool dc_is_dmcu_initialized(struct dc *dc);
+bool dc_is_hw_initialized(struct dc *dc);
 
 enum dc_status dc_set_clock(struct dc *dc, enum dc_clock_type clock_type, uint32_t clk_khz, uint32_t stepping);
 void dc_get_clock(struct dc *dc, enum dc_clock_type clock_type, struct dc_clock_config *clock_cfg);