diff options
author | Alex Deucher <alex@samba.(none)> | 2008-03-21 16:21:54 -0400 |
---|---|---|
committer | Alex Deucher <alex@samba.(none)> | 2008-03-21 16:21:54 -0400 |
commit | 6d5066a451017a2683addc9e2496987626795dda (patch) | |
tree | a23111f938b5b8f7c7a2553d45eb8b07b47ee1ec /src/legacy_crtc.c | |
parent | fb1cffac05ae20c8365b25a2042b0ae961880faf (diff) |
RS4xx: attempt to set up disp/disp2 fifos correctly
If you have an XPRESS chip, please test!!!
Diffstat (limited to 'src/legacy_crtc.c')
-rw-r--r-- | src/legacy_crtc.c | 55 |
1 files changed, 42 insertions, 13 deletions
diff --git a/src/legacy_crtc.c b/src/legacy_crtc.c index 4257b8ae..248ca37b 100644 --- a/src/legacy_crtc.c +++ b/src/legacy_crtc.c @@ -78,6 +78,13 @@ RADEONRestoreCommonRegisters(ScrnInfoPtr pScrn, OUTREG(RADEON_BUS_CNTL, restore->bus_cntl); OUTREG(RADEON_SURFACE_CNTL, restore->surface_cntl); + if (info->ChipFamily == CHIP_FAMILY_RS400) { + OUTREG(RS400_DISP2_REQ_CNTL1, restore->disp2_req_cntl1); + OUTREG(RS400_DISP2_REQ_CNTL2, restore->disp2_req_cntl2); + OUTREG(RS400_DMIF_MEM_CNTL1, restore->dmif_mem_cntl1); + OUTREG(RS400_DISP1_REQ_CNTL1, restore->disp1_req_cntl1); + } + /* Workaround for the VT switching problem in dual-head mode. This * problem only occurs on RV style chips, typically when a FP and * CRT are connected. @@ -178,12 +185,6 @@ RADEONRestoreCrtc2Registers(ScrnInfoPtr pScrn, OUTREG(RADEON_CRTC2_PITCH, restore->crtc2_pitch); OUTREG(RADEON_DISP2_MERGE_CNTL, restore->disp2_merge_cntl); - if (info->ChipFamily == CHIP_FAMILY_RS400) { - OUTREG(RS400_DISP2_REQ_CNTL1, restore->disp2_req_cntl1); - OUTREG(RS400_DISP2_REQ_CNTL2, restore->disp2_req_cntl2); - OUTREG(RS400_DMIF_MEM_CNTL1, restore->dmif_mem_cntl1); - OUTREG(RS400_DISP1_REQ_CNTL1, restore->disp1_req_cntl1); - } OUTREG(RADEON_CRTC2_GEN_CNTL, restore->crtc2_gen_cntl); } @@ -489,6 +490,13 @@ RADEONSaveCommonRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save) save->surface_cntl = INREG(RADEON_SURFACE_CNTL); save->grph_buffer_cntl = INREG(RADEON_GRPH_BUFFER_CNTL); save->grph2_buffer_cntl = INREG(RADEON_GRPH2_BUFFER_CNTL); + + if (info->ChipFamily == CHIP_FAMILY_RS400) { + save->disp2_req_cntl1 = INREG(RS400_DISP2_REQ_CNTL1); + save->disp2_req_cntl2 = INREG(RS400_DISP2_REQ_CNTL2); + save->dmif_mem_cntl1 = INREG(RS400_DMIF_MEM_CNTL1); + save->disp1_req_cntl1 = INREG(RS400_DISP1_REQ_CNTL1); + } } /* Read CRTC registers */ @@ -550,13 +558,6 @@ RADEONSaveCrtc2Registers(ScrnInfoPtr pScrn, RADEONSavePtr save) save->fp_h2_sync_strt_wid = INREG (RADEON_FP_H2_SYNC_STRT_WID); save->fp_v2_sync_strt_wid = INREG (RADEON_FP_V2_SYNC_STRT_WID); - if (info->ChipFamily == CHIP_FAMILY_RS400) { - save->disp2_req_cntl1 = INREG(RS400_DISP2_REQ_CNTL1); - save->disp2_req_cntl2 = INREG(RS400_DISP2_REQ_CNTL2); - save->dmif_mem_cntl1 = INREG(RS400_DMIF_MEM_CNTL1); - save->disp1_req_cntl1 = INREG(RS400_DISP1_REQ_CNTL1); - } - save->disp2_merge_cntl = INREG(RADEON_DISP2_MERGE_CNTL); /* track if the crtc is enabled for text restore */ @@ -677,6 +678,14 @@ RADEONInitCommonRegisters(RADEONSavePtr save, RADEONInfoPtr info) save->cap0_trig_cntl = 0; save->cap1_trig_cntl = 0; save->bus_cntl = info->BusCntl; + + if (info->ChipFamily == CHIP_FAMILY_RS400) { + save->disp2_req_cntl1 = info->SavedReg->disp2_req_cntl1; + save->disp2_req_cntl2 = info->SavedReg->disp2_req_cntl2; + save->dmif_mem_cntl1 = info->SavedReg->dmif_mem_cntl1; + save->disp1_req_cntl1 = info->SavedReg->disp1_req_cntl1; + } + /* * If bursts are enabled, turn on discards * Radeon doesn't have write bursts @@ -1554,6 +1563,16 @@ RADEONInitDispBandwidth2(ScrnInfoPtr pScrn, RADEONInfoPtr info, int pixel_bytes2 OUTREG(RADEON_GRPH_BUFFER_CNTL, ((temp & ~RADEON_GRPH_CRITICAL_POINT_MASK) | (critical_point << RADEON_GRPH_CRITICAL_POINT_SHIFT))); + if (info->ChipFamily == CHIP_FAMILY_RS400) { + /* attempt to program RS400 disp regs correctly ??? */ + temp = info->SavedReg->disp1_req_cntl1; + temp &= ~(RS400_DISP1_START_REQ_LEVEL_MASK | + RS400_DISP1_STOP_REQ_LEVEL_MASK); + OUTREG(RS400_DISP1_REQ_CNTL1, (temp | + (critical_point << RS400_DISP1_START_REQ_LEVEL_SHIFT) | + (critical_point << RS400_DISP1_STOP_REQ_LEVEL_SHIFT))); + } + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG, "GRPH_BUFFER_CNTL from %x to %x\n", (unsigned int)info->SavedReg->grph_buffer_cntl, @@ -1604,6 +1623,16 @@ RADEONInitDispBandwidth2(ScrnInfoPtr pScrn, RADEONInfoPtr info, int pixel_bytes2 OUTREG(RADEON_GRPH2_BUFFER_CNTL, ((temp & ~RADEON_GRPH_CRITICAL_POINT_MASK) | (critical_point2 << RADEON_GRPH_CRITICAL_POINT_SHIFT))); + if (info->ChipFamily == CHIP_FAMILY_RS400) { + /* attempt to program RS400 disp2 regs correctly ??? */ + temp = info->SavedReg->disp2_req_cntl1; + temp &= ~(RS400_DISP2_START_REQ_LEVEL_MASK | + RS400_DISP2_STOP_REQ_LEVEL_MASK); + OUTREG(RS400_DISP2_REQ_CNTL1, (temp | + (critical_point2 << RS400_DISP1_START_REQ_LEVEL_SHIFT) | + (critical_point2 << RS400_DISP1_STOP_REQ_LEVEL_SHIFT))); + } + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG, "GRPH2_BUFFER_CNTL from %x to %x\n", (unsigned int)info->SavedReg->grph2_buffer_cntl, |