diff options
author | Charlene Liu <charlene.liu@amd.com> | 2017-08-09 14:03:34 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-09-26 18:16:39 -0400 |
commit | b8e9eb7259f744fdc2e34f008e4af211ce0df19a (patch) | |
tree | 01e38c3da0334c7e79cf16294ef0f9f7ec891139 /drivers | |
parent | 65111f25f1fea751f3b4321a59c993c2898b7dbf (diff) |
drm/amd/display: fix eDP bootup/S4 backlight on
also pass-in correct dispclk tor DMCU
Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
4 files changed, 22 insertions, 16 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index 1d69bd25e07b..0d33e179d9f7 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c | |||
@@ -169,16 +169,14 @@ static void update_num_audio( | |||
169 | unsigned int *num_audio, | 169 | unsigned int *num_audio, |
170 | struct audio_support *aud_support) | 170 | struct audio_support *aud_support) |
171 | { | 171 | { |
172 | aud_support->dp_audio = true; | ||
173 | aud_support->hdmi_audio_native = false; | ||
174 | aud_support->hdmi_audio_on_dongle = false; | ||
175 | |||
172 | if (straps->hdmi_disable == 0) { | 176 | if (straps->hdmi_disable == 0) { |
173 | aud_support->hdmi_audio_native = true; | ||
174 | aud_support->hdmi_audio_on_dongle = true; | ||
175 | aud_support->dp_audio = true; | ||
176 | } else { | ||
177 | if (straps->dc_pinstraps_audio & 0x2) { | 177 | if (straps->dc_pinstraps_audio & 0x2) { |
178 | aud_support->hdmi_audio_on_dongle = true; | 178 | aud_support->hdmi_audio_on_dongle = true; |
179 | aud_support->dp_audio = true; | 179 | aud_support->hdmi_audio_native = true; |
180 | } else { | ||
181 | aud_support->dp_audio = true; | ||
182 | } | 180 | } |
183 | } | 181 | } |
184 | 182 | ||
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c b/drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c index a73228b97da5..7bb2eaf07da5 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c | |||
@@ -327,13 +327,14 @@ static bool dce_clock_set_min_clocks_state( | |||
327 | return true; | 327 | return true; |
328 | } | 328 | } |
329 | 329 | ||
330 | static void dce_set_clock( | 330 | static int dce_set_clock( |
331 | struct display_clock *clk, | 331 | struct display_clock *clk, |
332 | int requested_clk_khz) | 332 | int requested_clk_khz) |
333 | { | 333 | { |
334 | struct dce_disp_clk *clk_dce = TO_DCE_CLOCKS(clk); | 334 | struct dce_disp_clk *clk_dce = TO_DCE_CLOCKS(clk); |
335 | struct bp_pixel_clock_parameters pxl_clk_params = { 0 }; | 335 | struct bp_pixel_clock_parameters pxl_clk_params = { 0 }; |
336 | struct dc_bios *bp = clk->ctx->dc_bios; | 336 | struct dc_bios *bp = clk->ctx->dc_bios; |
337 | int actual_clock = requested_clk_khz; | ||
337 | 338 | ||
338 | /* Make sure requested clock isn't lower than minimum threshold*/ | 339 | /* Make sure requested clock isn't lower than minimum threshold*/ |
339 | if (requested_clk_khz > 0) | 340 | if (requested_clk_khz > 0) |
@@ -351,15 +352,17 @@ static void dce_set_clock( | |||
351 | /* Cache the fixed display clock*/ | 352 | /* Cache the fixed display clock*/ |
352 | clk_dce->dfs_bypass_disp_clk = | 353 | clk_dce->dfs_bypass_disp_clk = |
353 | pxl_clk_params.dfs_bypass_display_clock; | 354 | pxl_clk_params.dfs_bypass_display_clock; |
355 | actual_clock = pxl_clk_params.dfs_bypass_display_clock; | ||
354 | } | 356 | } |
355 | 357 | ||
356 | /* from power down, we need mark the clock state as ClocksStateNominal | 358 | /* from power down, we need mark the clock state as ClocksStateNominal |
357 | * from HWReset, so when resume we will call pplib voltage regulator.*/ | 359 | * from HWReset, so when resume we will call pplib voltage regulator.*/ |
358 | if (requested_clk_khz == 0) | 360 | if (requested_clk_khz == 0) |
359 | clk->cur_min_clks_state = DM_PP_CLOCKS_STATE_NOMINAL; | 361 | clk->cur_min_clks_state = DM_PP_CLOCKS_STATE_NOMINAL; |
362 | return actual_clock; | ||
360 | } | 363 | } |
361 | 364 | ||
362 | static void dce_psr_set_clock( | 365 | static int dce_psr_set_clock( |
363 | struct display_clock *clk, | 366 | struct display_clock *clk, |
364 | int requested_clk_khz) | 367 | int requested_clk_khz) |
365 | { | 368 | { |
@@ -367,13 +370,15 @@ static void dce_psr_set_clock( | |||
367 | struct dc_context *ctx = clk_dce->base.ctx; | 370 | struct dc_context *ctx = clk_dce->base.ctx; |
368 | struct core_dc *core_dc = DC_TO_CORE(ctx->dc); | 371 | struct core_dc *core_dc = DC_TO_CORE(ctx->dc); |
369 | struct dmcu *dmcu = core_dc->res_pool->dmcu; | 372 | struct dmcu *dmcu = core_dc->res_pool->dmcu; |
373 | int actual_clk_khz = requested_clk_khz; | ||
370 | 374 | ||
371 | dce_set_clock(clk, requested_clk_khz); | 375 | actual_clk_khz = dce_set_clock(clk, requested_clk_khz); |
372 | 376 | ||
373 | dmcu->funcs->set_psr_wait_loop(dmcu, requested_clk_khz / 1000 / 7); | 377 | dmcu->funcs->set_psr_wait_loop(dmcu, actual_clk_khz / 1000 / 7); |
378 | return actual_clk_khz; | ||
374 | } | 379 | } |
375 | 380 | ||
376 | static void dce112_set_clock( | 381 | static int dce112_set_clock( |
377 | struct display_clock *clk, | 382 | struct display_clock *clk, |
378 | int requested_clk_khz) | 383 | int requested_clk_khz) |
379 | { | 384 | { |
@@ -383,7 +388,7 @@ static void dce112_set_clock( | |||
383 | struct core_dc *core_dc = DC_TO_CORE(clk->ctx->dc); | 388 | struct core_dc *core_dc = DC_TO_CORE(clk->ctx->dc); |
384 | struct abm *abm = core_dc->res_pool->abm; | 389 | struct abm *abm = core_dc->res_pool->abm; |
385 | struct dmcu *dmcu = core_dc->res_pool->dmcu; | 390 | struct dmcu *dmcu = core_dc->res_pool->dmcu; |
386 | 391 | int actual_clock = requested_clk_khz; | |
387 | /* Prepare to program display clock*/ | 392 | /* Prepare to program display clock*/ |
388 | memset(&dce_clk_params, 0, sizeof(dce_clk_params)); | 393 | memset(&dce_clk_params, 0, sizeof(dce_clk_params)); |
389 | 394 | ||
@@ -397,6 +402,7 @@ static void dce112_set_clock( | |||
397 | dce_clk_params.clock_type = DCECLOCK_TYPE_DISPLAY_CLOCK; | 402 | dce_clk_params.clock_type = DCECLOCK_TYPE_DISPLAY_CLOCK; |
398 | 403 | ||
399 | bp->funcs->set_dce_clock(bp, &dce_clk_params); | 404 | bp->funcs->set_dce_clock(bp, &dce_clk_params); |
405 | actual_clock = dce_clk_params.target_clock_frequency; | ||
400 | 406 | ||
401 | /* from power down, we need mark the clock state as ClocksStateNominal | 407 | /* from power down, we need mark the clock state as ClocksStateNominal |
402 | * from HWReset, so when resume we will call pplib voltage regulator.*/ | 408 | * from HWReset, so when resume we will call pplib voltage regulator.*/ |
@@ -415,8 +421,8 @@ static void dce112_set_clock( | |||
415 | 421 | ||
416 | if (abm->funcs->is_dmcu_initialized(abm)) | 422 | if (abm->funcs->is_dmcu_initialized(abm)) |
417 | dmcu->funcs->set_psr_wait_loop(dmcu, | 423 | dmcu->funcs->set_psr_wait_loop(dmcu, |
418 | requested_clk_khz / 1000 / 7); | 424 | actual_clock / 1000 / 7); |
419 | 425 | return actual_clock; | |
420 | } | 426 | } |
421 | 427 | ||
422 | static void dce_clock_read_integrated_info(struct dce_disp_clk *clk_dce) | 428 | static void dce_clock_read_integrated_info(struct dce_disp_clk *clk_dce) |
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c index 7e9afab8fca0..0dab5bacde3c 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c | |||
@@ -1288,6 +1288,8 @@ void dce110_link_encoder_disable_output( | |||
1288 | /* OF_SKIP_POWER_DOWN_INACTIVE_ENCODER */ | 1288 | /* OF_SKIP_POWER_DOWN_INACTIVE_ENCODER */ |
1289 | return; | 1289 | return; |
1290 | } | 1290 | } |
1291 | if (enc110->base.connector.id == CONNECTOR_ID_EDP) | ||
1292 | dce110_link_encoder_edp_backlight_control(enc, false); | ||
1291 | /* Power-down RX and disable GPU PHY should be paired. | 1293 | /* Power-down RX and disable GPU PHY should be paired. |
1292 | * Disabling PHY without powering down RX may cause | 1294 | * Disabling PHY without powering down RX may cause |
1293 | * symbol lock loss, on which we will get DP Sink interrupt. */ | 1295 | * symbol lock loss, on which we will get DP Sink interrupt. */ |
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/display_clock.h b/drivers/gpu/drm/amd/display/dc/inc/hw/display_clock.h index 879c3db7cba6..f5f69cd81f6f 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/hw/display_clock.h +++ b/drivers/gpu/drm/amd/display/dc/inc/hw/display_clock.h | |||
@@ -62,7 +62,7 @@ struct display_clock { | |||
62 | }; | 62 | }; |
63 | 63 | ||
64 | struct display_clock_funcs { | 64 | struct display_clock_funcs { |
65 | void (*set_clock)(struct display_clock *disp_clk, | 65 | int (*set_clock)(struct display_clock *disp_clk, |
66 | int requested_clock_khz); | 66 | int requested_clock_khz); |
67 | 67 | ||
68 | enum dm_pp_clocks_state (*get_required_clocks_state)( | 68 | enum dm_pp_clocks_state (*get_required_clocks_state)( |