mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-27 14:45:04 +07:00
drm/amd/display: S3 Resume time increase after decoupling DPMS from fast boot
[Why] We incorrectly began powering down the display at boot/resume whenever fast boot was not possible. This should not be done in the case where there exists a stream for the eDP since this implies that we want to turn it on. [How] Add check for eDP stream to decide whether to power off edp. Signed-off-by: SivapiriyanKumarasamy <sivapiriyan.kumarasamy@amd.com> Reviewed-by: Anthony Koo <Anthony.Koo@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Acked-by: Reza Amini <Reza.Amini@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
c08264876f
commit
3de5aa81c5
@ -1507,6 +1507,18 @@ static void disable_vga_and_power_gate_all_controllers(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static struct dc_stream_state *get_edp_stream(struct dc_state *context)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < context->stream_count; i++) {
|
||||||
|
if (context->streams[i]->signal == SIGNAL_TYPE_EDP)
|
||||||
|
return context->streams[i];
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static struct dc_link *get_edp_link(struct dc *dc)
|
static struct dc_link *get_edp_link(struct dc *dc)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -1550,12 +1562,16 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)
|
|||||||
int i;
|
int i;
|
||||||
struct dc_link *edp_link_with_sink = get_edp_link_with_sink(dc, context);
|
struct dc_link *edp_link_with_sink = get_edp_link_with_sink(dc, context);
|
||||||
struct dc_link *edp_link = get_edp_link(dc);
|
struct dc_link *edp_link = get_edp_link(dc);
|
||||||
|
struct dc_stream_state *edp_stream = NULL;
|
||||||
bool can_apply_edp_fast_boot = false;
|
bool can_apply_edp_fast_boot = false;
|
||||||
bool can_apply_seamless_boot = false;
|
bool can_apply_seamless_boot = false;
|
||||||
|
bool keep_edp_vdd_on = false;
|
||||||
|
|
||||||
if (dc->hwss.init_pipes)
|
if (dc->hwss.init_pipes)
|
||||||
dc->hwss.init_pipes(dc, context);
|
dc->hwss.init_pipes(dc, context);
|
||||||
|
|
||||||
|
edp_stream = get_edp_stream(context);
|
||||||
|
|
||||||
// Check fastboot support, disable on DCE8 because of blank screens
|
// Check fastboot support, disable on DCE8 because of blank screens
|
||||||
if (edp_link && dc->ctx->dce_version != DCE_VERSION_8_0 &&
|
if (edp_link && dc->ctx->dce_version != DCE_VERSION_8_0 &&
|
||||||
dc->ctx->dce_version != DCE_VERSION_8_1 &&
|
dc->ctx->dce_version != DCE_VERSION_8_1 &&
|
||||||
@ -1563,15 +1579,16 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)
|
|||||||
|
|
||||||
// enable fastboot if backend is enabled on eDP
|
// enable fastboot if backend is enabled on eDP
|
||||||
if (edp_link->link_enc->funcs->is_dig_enabled(edp_link->link_enc)) {
|
if (edp_link->link_enc->funcs->is_dig_enabled(edp_link->link_enc)) {
|
||||||
/* Find eDP stream and set optimization flag */
|
/* Set optimization flag on eDP stream*/
|
||||||
for (i = 0; i < context->stream_count; i++) {
|
if (edp_stream) {
|
||||||
if (context->streams[i]->signal == SIGNAL_TYPE_EDP) {
|
edp_stream->apply_edp_fast_boot_optimization = true;
|
||||||
context->streams[i]->apply_edp_fast_boot_optimization = true;
|
|
||||||
can_apply_edp_fast_boot = true;
|
can_apply_edp_fast_boot = true;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We are trying to enable eDP, don't power down VDD
|
||||||
|
if (edp_stream)
|
||||||
|
keep_edp_vdd_on = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check seamless boot support
|
// Check seamless boot support
|
||||||
@ -1586,14 +1603,14 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)
|
|||||||
* it should get turned off
|
* it should get turned off
|
||||||
*/
|
*/
|
||||||
if (!can_apply_edp_fast_boot && !can_apply_seamless_boot) {
|
if (!can_apply_edp_fast_boot && !can_apply_seamless_boot) {
|
||||||
if (edp_link_with_sink) {
|
if (edp_link_with_sink && !keep_edp_vdd_on) {
|
||||||
/*turn off backlight before DP_blank and encoder powered down*/
|
/*turn off backlight before DP_blank and encoder powered down*/
|
||||||
dc->hwss.edp_backlight_control(edp_link_with_sink, false);
|
dc->hwss.edp_backlight_control(edp_link_with_sink, false);
|
||||||
}
|
}
|
||||||
/*resume from S3, no vbios posting, no need to power down again*/
|
/*resume from S3, no vbios posting, no need to power down again*/
|
||||||
power_down_all_hw_blocks(dc);
|
power_down_all_hw_blocks(dc);
|
||||||
disable_vga_and_power_gate_all_controllers(dc);
|
disable_vga_and_power_gate_all_controllers(dc);
|
||||||
if (edp_link_with_sink)
|
if (edp_link_with_sink && !keep_edp_vdd_on)
|
||||||
dc->hwss.edp_power_control(edp_link_with_sink, false);
|
dc->hwss.edp_power_control(edp_link_with_sink, false);
|
||||||
}
|
}
|
||||||
bios_set_scratch_acc_mode_change(dc->ctx->dc_bios);
|
bios_set_scratch_acc_mode_change(dc->ctx->dc_bios);
|
||||||
|
Loading…
Reference in New Issue
Block a user