diff options
author | Eric Yang <Eric.Yang2@amd.com> | 2018-02-28 14:45:36 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-03-07 16:28:39 -0500 |
commit | abca24007e0838ee8bfff37a188bf8df00703c52 (patch) | |
tree | 2efb6b237c4f14e40c32e4b0ff14a6a9fc209070 | |
parent | bd9bc355be45dd2295ca746aa05b058be4cf94cc (diff) |
drm/amd/display: early return if not in vga mode in disable_vga
The work around for hw bug causes S3 resume failure. Don't execute
disable vga logic if not in vga mode.
Signed-off-by: Eric Yang <Eric.Yang2@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 10 |
2 files changed, 13 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h b/drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h index ad7131d6f821..a993279a8f2d 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h | |||
@@ -495,10 +495,11 @@ struct dce_hwseq_registers { | |||
495 | HWS_SF(, DOMAIN6_PG_STATUS, DOMAIN6_PGFSM_PWR_STATUS, mask_sh), \ | 495 | HWS_SF(, DOMAIN6_PG_STATUS, DOMAIN6_PGFSM_PWR_STATUS, mask_sh), \ |
496 | HWS_SF(, DOMAIN7_PG_STATUS, DOMAIN7_PGFSM_PWR_STATUS, mask_sh), \ | 496 | HWS_SF(, DOMAIN7_PG_STATUS, DOMAIN7_PGFSM_PWR_STATUS, mask_sh), \ |
497 | HWS_SF(, DC_IP_REQUEST_CNTL, IP_REQUEST_EN, mask_sh), \ | 497 | HWS_SF(, DC_IP_REQUEST_CNTL, IP_REQUEST_EN, mask_sh), \ |
498 | HWS_SF(, LVTMA_PWRSEQ_CNTL, LVTMA_BLON, mask_sh), \ | 498 | HWS_SF(, D1VGA_CONTROL, D1VGA_MODE_ENABLE, mask_sh),\ |
499 | HWS_SF(, LVTMA_PWRSEQ_STATE, LVTMA_PWRSEQ_TARGET_STATE_R, mask_sh), \ | ||
500 | HWS_SF(, VGA_TEST_CONTROL, VGA_TEST_ENABLE, mask_sh),\ | 499 | HWS_SF(, VGA_TEST_CONTROL, VGA_TEST_ENABLE, mask_sh),\ |
501 | HWS_SF(, VGA_TEST_CONTROL, VGA_TEST_RENDER_START, mask_sh) | 500 | HWS_SF(, VGA_TEST_CONTROL, VGA_TEST_RENDER_START, mask_sh),\ |
501 | HWS_SF(, LVTMA_PWRSEQ_CNTL, LVTMA_BLON, mask_sh), \ | ||
502 | HWS_SF(, LVTMA_PWRSEQ_STATE, LVTMA_PWRSEQ_TARGET_STATE_R, mask_sh) | ||
502 | 503 | ||
503 | #define HWSEQ_REG_FIELD_LIST(type) \ | 504 | #define HWSEQ_REG_FIELD_LIST(type) \ |
504 | type DCFE_CLOCK_ENABLE; \ | 505 | type DCFE_CLOCK_ENABLE; \ |
@@ -589,7 +590,8 @@ struct dce_hwseq_registers { | |||
589 | type DENTIST_DPPCLK_WDIVIDER; \ | 590 | type DENTIST_DPPCLK_WDIVIDER; \ |
590 | type DENTIST_DISPCLK_WDIVIDER; \ | 591 | type DENTIST_DISPCLK_WDIVIDER; \ |
591 | type VGA_TEST_ENABLE; \ | 592 | type VGA_TEST_ENABLE; \ |
592 | type VGA_TEST_RENDER_START; | 593 | type VGA_TEST_RENDER_START; \ |
594 | type D1VGA_MODE_ENABLE; | ||
593 | 595 | ||
594 | struct dce_hwseq_shift { | 596 | struct dce_hwseq_shift { |
595 | HWSEQ_REG_FIELD_LIST(uint8_t) | 597 | HWSEQ_REG_FIELD_LIST(uint8_t) |
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c index f07a8a3d5c25..072e4485e85e 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | |||
@@ -238,10 +238,14 @@ static void enable_power_gating_plane( | |||
238 | static void disable_vga( | 238 | static void disable_vga( |
239 | struct dce_hwseq *hws) | 239 | struct dce_hwseq *hws) |
240 | { | 240 | { |
241 | unsigned int in_vga_mode = 0; | ||
242 | |||
243 | REG_GET(D1VGA_CONTROL, D1VGA_MODE_ENABLE, &in_vga_mode); | ||
244 | |||
245 | if (in_vga_mode == 0) | ||
246 | return; | ||
247 | |||
241 | REG_WRITE(D1VGA_CONTROL, 0); | 248 | REG_WRITE(D1VGA_CONTROL, 0); |
242 | REG_WRITE(D2VGA_CONTROL, 0); | ||
243 | REG_WRITE(D3VGA_CONTROL, 0); | ||
244 | REG_WRITE(D4VGA_CONTROL, 0); | ||
245 | 249 | ||
246 | /* HW Engineer's Notes: | 250 | /* HW Engineer's Notes: |
247 | * During switch from vga->extended, if we set the VGA_TEST_ENABLE and | 251 | * During switch from vga->extended, if we set the VGA_TEST_ENABLE and |