Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.

Commit bd9bc35

Browse files
Bhawanpreet Lakhaalexdeucher
authored andcommitted
drm/amd/display: Fix takover from VGA mode
HW Engineer's Notes: During switch from vga->extended, if we set the VGA_TEST_ENABLE and then hit the VGA_TEST_RENDER_START, then the DCHUBP timing gets updated correctly. Then vBIOS will have it poll for the VGA_TEST_RENDER_DONE and unset VGA_TEST_ENABLE, to leave it in the same state as before. Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@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>
1 parent 9fe8f03 commit bd9bc35

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@
236236
SR(D2VGA_CONTROL), \
237237
SR(D3VGA_CONTROL), \
238238
SR(D4VGA_CONTROL), \
239+
SR(VGA_TEST_CONTROL), \
239240
SR(DC_IP_REQUEST_CNTL), \
240241
BL_REG_LIST()
241242

@@ -337,6 +338,7 @@ struct dce_hwseq_registers {
337338
uint32_t D2VGA_CONTROL;
338339
uint32_t D3VGA_CONTROL;
339340
uint32_t D4VGA_CONTROL;
341+
uint32_t VGA_TEST_CONTROL;
340342
/* MMHUB registers. read only. temporary hack */
341343
uint32_t VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32;
342344
uint32_t VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32;
@@ -494,7 +496,9 @@ struct dce_hwseq_registers {
494496
HWS_SF(, DOMAIN7_PG_STATUS, DOMAIN7_PGFSM_PWR_STATUS, mask_sh), \
495497
HWS_SF(, DC_IP_REQUEST_CNTL, IP_REQUEST_EN, mask_sh), \
496498
HWS_SF(, LVTMA_PWRSEQ_CNTL, LVTMA_BLON, mask_sh), \
497-
HWS_SF(, LVTMA_PWRSEQ_STATE, LVTMA_PWRSEQ_TARGET_STATE_R, 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),\
501+
HWS_SF(, VGA_TEST_CONTROL, VGA_TEST_RENDER_START, mask_sh)
498502

499503
#define HWSEQ_REG_FIELD_LIST(type) \
500504
type DCFE_CLOCK_ENABLE; \
@@ -583,7 +587,9 @@ struct dce_hwseq_registers {
583587
type DCFCLK_GATE_DIS; \
584588
type DCHUBBUB_GLOBAL_TIMER_REFDIV; \
585589
type DENTIST_DPPCLK_WDIVIDER; \
586-
type DENTIST_DISPCLK_WDIVIDER;
590+
type DENTIST_DISPCLK_WDIVIDER; \
591+
type VGA_TEST_ENABLE; \
592+
type VGA_TEST_RENDER_START;
587593

588594
struct dce_hwseq_shift {
589595
HWSEQ_REG_FIELD_LIST(uint8_t)

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,16 @@ static void disable_vga(
242242
REG_WRITE(D2VGA_CONTROL, 0);
243243
REG_WRITE(D3VGA_CONTROL, 0);
244244
REG_WRITE(D4VGA_CONTROL, 0);
245+
246+
/* HW Engineer's Notes:
247+
* During switch from vga->extended, if we set the VGA_TEST_ENABLE and
248+
* then hit the VGA_TEST_RENDER_START, then the DCHUBP timing gets updated correctly.
249+
*
250+
* Then vBIOS will have it poll for the VGA_TEST_RENDER_DONE and unset
251+
* VGA_TEST_ENABLE, to leave it in the same state as before.
252+
*/
253+
REG_UPDATE(VGA_TEST_CONTROL, VGA_TEST_ENABLE, 1);
254+
REG_UPDATE(VGA_TEST_CONTROL, VGA_TEST_RENDER_START, 1);
245255
}
246256

247257
static void dpp_pg_control(

0 commit comments

Comments
 (0)