aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorYongqiang Sun <yongqiang.sun@amd.com>2018-04-04 17:27:18 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-05-15 14:43:24 -0400
commit339cc82ae67700cb25a5bb10842cca5b09a79afe (patch)
tree5a0c32f82f62c55a8a5a019edc719df1515a2dfc /drivers/gpu
parentd0f6f1c0319d39b792a7969bf511d5b1870f1f0e (diff)
drm/amd/display: Check lid state to determine fast boot optimization.
For legacy enable boot up with lid closed, eDP information couldn't be read correctly via SBIOS_SCRATCH_3 results in eDP cannot be light up properly when open lid. Check lid state instead can resolve the issue. Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com> Reviewed-by: Eric Yang <eric.yang2@amd.com> Acked-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/display/dc/dc_stream.h1
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c24
2 files changed, 17 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dc_stream.h b/drivers/gpu/drm/amd/display/dc/dc_stream.h
index d7e6d53bb383..11b3433d6432 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_stream.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_stream.h
@@ -92,6 +92,7 @@ struct dc_stream_state {
92 int phy_pix_clk; 92 int phy_pix_clk;
93 enum signal_type signal; 93 enum signal_type signal;
94 bool dpms_off; 94 bool dpms_off;
95 bool lid_state_closed;
95 96
96 struct dc_stream_status status; 97 struct dc_stream_status status;
97 98
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
index 1b5c11c8fa1f..4a4b3bcd4230 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
@@ -1471,6 +1471,17 @@ static void disable_vga_and_power_gate_all_controllers(
1471 } 1471 }
1472} 1472}
1473 1473
1474static bool is_eDP_lid_closed(struct dc_state *context)
1475{
1476 int i;
1477
1478 for (i = 0; i < context->stream_count; i++) {
1479 if (context->streams[i]->signal == SIGNAL_TYPE_EDP)
1480 return context->streams[i]->lid_state_closed;
1481 }
1482 return false;
1483}
1484
1474static struct dc_link *get_link_for_edp_not_in_use( 1485static struct dc_link *get_link_for_edp_not_in_use(
1475 struct dc *dc, 1486 struct dc *dc,
1476 struct dc_state *context) 1487 struct dc_state *context)
@@ -1505,20 +1516,17 @@ static struct dc_link *get_link_for_edp_not_in_use(
1505 */ 1516 */
1506void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context) 1517void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)
1507{ 1518{
1508 struct dc_bios *dcb = dc->ctx->dc_bios; 1519 /* check eDP lid state:
1509 1520 * If lid is open, vbios already light up eDP, so we can leverage vbios and skip eDP
1510 /* vbios already light up eDP, so we can leverage vbios and skip eDP
1511 * programming 1521 * programming
1512 */ 1522 */
1513 bool can_eDP_fast_boot_optimize = 1523 bool lid_state_closed = is_eDP_lid_closed(context);
1514 (dcb->funcs->get_vga_enabled_displays(dc->ctx->dc_bios) == ATOM_DISPLAY_LCD1_ACTIVE);
1515
1516 /* if OS doesn't light up eDP and eDP link is available, we want to disable */
1517 struct dc_link *edp_link_to_turnoff = NULL; 1524 struct dc_link *edp_link_to_turnoff = NULL;
1518 1525
1519 if (can_eDP_fast_boot_optimize) { 1526 if (!lid_state_closed) {
1520 edp_link_to_turnoff = get_link_for_edp_not_in_use(dc, context); 1527 edp_link_to_turnoff = get_link_for_edp_not_in_use(dc, context);
1521 1528
1529 /* if OS doesn't light up eDP and eDP link is available, we want to disable */
1522 if (!edp_link_to_turnoff) 1530 if (!edp_link_to_turnoff)
1523 dc->apply_edp_fast_boot_optimization = true; 1531 dc->apply_edp_fast_boot_optimization = true;
1524 } 1532 }