|
@@ -1471,15 +1471,15 @@ static void disable_vga_and_power_gate_all_controllers(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static bool is_eDP_lid_closed(struct dc_state *context)
|
|
|
+static struct dc_link *get_link_for_edp(struct dc *dc)
|
|
|
{
|
|
|
int i;
|
|
|
|
|
|
- for (i = 0; i < context->stream_count; i++) {
|
|
|
- if (context->streams[i]->signal == SIGNAL_TYPE_EDP)
|
|
|
- return context->streams[i]->lid_state_closed;
|
|
|
+ for (i = 0; i < dc->link_count; i++) {
|
|
|
+ if (dc->links[i]->connector_signal == SIGNAL_TYPE_EDP)
|
|
|
+ return dc->links[i];
|
|
|
}
|
|
|
- return false;
|
|
|
+ return NULL;
|
|
|
}
|
|
|
|
|
|
static struct dc_link *get_link_for_edp_not_in_use(
|
|
@@ -1516,41 +1516,22 @@ static struct dc_link *get_link_for_edp_not_in_use(
|
|
|
*/
|
|
|
void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)
|
|
|
{
|
|
|
- /* check eDP lid state and BIOS_SCRATCH_3 to determine fast boot optimization
|
|
|
- * UEFI boot
|
|
|
- * edp_active_status_from_scratch fast boot optimization
|
|
|
- * S4/S5 resume:
|
|
|
- * Lid Open true true
|
|
|
- * Lid Close false false
|
|
|
- *
|
|
|
- * S3/ resume:
|
|
|
- * Lid Open false false
|
|
|
- * Lid Close false false
|
|
|
- *
|
|
|
- * Legacy boot:
|
|
|
- * edp_active_status_from_scratch fast boot optimization
|
|
|
- * S4/S resume:
|
|
|
- * Lid Open true true
|
|
|
- * Lid Close true false
|
|
|
- *
|
|
|
- * S3/ resume:
|
|
|
- * Lid Open false false
|
|
|
- * Lid Close false false
|
|
|
- */
|
|
|
- struct dc_bios *dcb = dc->ctx->dc_bios;
|
|
|
- bool lid_state_closed = is_eDP_lid_closed(context);
|
|
|
struct dc_link *edp_link_to_turnoff = NULL;
|
|
|
- bool edp_active_status_from_scratch =
|
|
|
- (dcb->funcs->get_vga_enabled_displays(dc->ctx->dc_bios) == ATOM_DISPLAY_LCD1_ACTIVE);
|
|
|
+ struct dc_link *edp_link = get_link_for_edp(dc);
|
|
|
+ bool can_eDP_fast_boot_optimize = false;
|
|
|
+
|
|
|
+ if (edp_link) {
|
|
|
+ can_eDP_fast_boot_optimize =
|
|
|
+ edp_link->link_enc->funcs->is_dig_enabled(edp_link->link_enc);
|
|
|
+ }
|
|
|
|
|
|
- /*Lid open*/
|
|
|
- if (!lid_state_closed) {
|
|
|
+ if (can_eDP_fast_boot_optimize) {
|
|
|
edp_link_to_turnoff = get_link_for_edp_not_in_use(dc, context);
|
|
|
|
|
|
/* if OS doesn't light up eDP and eDP link is available, we want to disable
|
|
|
* If resume from S4/S5, should optimization.
|
|
|
*/
|
|
|
- if (!edp_link_to_turnoff && edp_active_status_from_scratch)
|
|
|
+ if (!edp_link_to_turnoff)
|
|
|
dc->apply_edp_fast_boot_optimization = true;
|
|
|
}
|
|
|
|