xf86-video-ati: Branch 'randr-1.2' - 2 commits
Alex Deucher
agd5f at kemper.freedesktop.org
Wed Aug 15 16:26:42 PDT 2007
src/radeon_driver.c | 91 +++++++++++++++++-----------------------------------
1 files changed, 31 insertions(+), 60 deletions(-)
New commits:
diff-tree 5793e8753d11432bf95c7c6dd80c811e16aba058 (from 6f011aaabaf18d66ffc255ad76aaf938b2396302)
Author: Alex Deucher <alex at botch2.com>
Date: Wed Aug 15 19:26:36 2007 -0400
RADEON: Remove RADEONRestoreMode()
Since we no longer use it to write modes all it did
was restore some of the regs for a console restore.
Just move the relevant bits into RADEONRestore() and
remove it.
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 09464c1..ae34cf3 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -113,7 +113,6 @@
/* Forward definitions for driver functions */
-void RADEONRestoreMode(ScrnInfoPtr pScrn, RADEONSavePtr restore);
static Bool RADEONCloseScreen(int scrnIndex, ScreenPtr pScreen);
static Bool RADEONSaveScreen(ScreenPtr pScreen, int mode);
static void RADEONSave(ScrnInfoPtr pScrn);
@@ -5041,50 +5040,6 @@ void RADEONChangeSurfaces(ScrnInfoPtr pS
RADEONSaveSurfaces(pScrn, &info->ModeReg);
}
-/* Write out state to define a new video mode */
-void RADEONRestoreMode(ScrnInfoPtr pScrn, RADEONSavePtr restore)
-{
- RADEONInfoPtr info = RADEONPTR(pScrn);
- RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
-
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
- "RADEONRestoreMode(%p)\n", restore);
-
- /* When changing mode with Dual-head card, care must be taken for
- * the special order in setting registers. CRTC2 has to be set
- * before changing CRTC_EXT register. In the dual-head setup, X
- * server calls this routine twice with primary and secondary pScrn
- * pointers respectively. The calls can come with different
- * order. Regardless the order of X server issuing the calls, we
- * have to ensure we set registers in the right order!!! Otherwise
- * we may get a blank screen.
- *
- * We always restore MemMap first, the saverec should be up to date
- * in all cases
- */
- RADEONRestoreMemMapRegisters(pScrn, restore);
- RADEONRestoreCommonRegisters(pScrn, restore);
-
- if (pRADEONEnt->HasCRTC2) {
- RADEONRestoreCrtc2Registers(pScrn, restore);
- RADEONRestorePLL2Registers(pScrn, restore);
- }
-
- RADEONRestoreCrtcRegisters(pScrn, restore);
- RADEONRestorePLLRegisters(pScrn, restore);
- RADEONRestoreRMXRegisters(pScrn, restore);
- RADEONRestoreFPRegisters(pScrn, restore);
- RADEONRestoreFP2Registers(pScrn, restore);
- RADEONRestoreLVDSRegisters(pScrn, restore);
-
- if (info->InternalTVOut)
- RADEONRestoreTVRegisters(pScrn, restore);
-
-#if 0
- RADEONRestorePalette(pScrn, &info->SavedReg);
-#endif
-}
-
/* Read memory map */
static void RADEONSaveMemMapRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save)
{
@@ -5490,6 +5445,7 @@ static void RADEONSave(ScrnInfoPtr pScrn
void RADEONRestore(ScrnInfoPtr pScrn)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
+ RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
unsigned char *RADEONMMIO = info->MMIO;
RADEONSavePtr restore = &info->SavedReg;
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
@@ -5525,7 +5481,24 @@ void RADEONRestore(ScrnInfoPtr pScrn)
OUTREG(RADEON_DAC_CNTL2, restore->dac2_cntl);
#endif
- RADEONRestoreMode(pScrn, restore);
+ RADEONRestoreMemMapRegisters(pScrn, restore);
+ RADEONRestoreCommonRegisters(pScrn, restore);
+
+ if (pRADEONEnt->HasCRTC2) {
+ RADEONRestoreCrtc2Registers(pScrn, restore);
+ RADEONRestorePLL2Registers(pScrn, restore);
+ }
+
+ RADEONRestoreCrtcRegisters(pScrn, restore);
+ RADEONRestorePLLRegisters(pScrn, restore);
+ RADEONRestoreRMXRegisters(pScrn, restore);
+ RADEONRestoreFPRegisters(pScrn, restore);
+ RADEONRestoreFP2Registers(pScrn, restore);
+ RADEONRestoreLVDSRegisters(pScrn, restore);
+
+ if (info->InternalTVOut)
+ RADEONRestoreTVRegisters(pScrn, restore);
+
RADEONRestoreSurfaces(pScrn, restore);
#if 1
diff-tree 6f011aaabaf18d66ffc255ad76aaf938b2396302 (from c8dad98abb042c6abbbee18f9ae4db72084bc513)
Author: Lisa Wu <Lisa.Wu at amd.com>
Date: Wed Aug 15 19:17:51 2007 -0400
RADEON: fix console restore on r3xx and r4xx
When restoring the console we need to:
1) we need to restore DAC registers after all other registers are
restored and CRTCs are enabled.
2) we need to enable CRTC2 registers before CRTC1 registers
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index c1f0c3c..09464c1 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -5076,7 +5076,7 @@ void RADEONRestoreMode(ScrnInfoPtr pScrn
RADEONRestoreFPRegisters(pScrn, restore);
RADEONRestoreFP2Registers(pScrn, restore);
RADEONRestoreLVDSRegisters(pScrn, restore);
- RADEONRestoreDACRegisters(pScrn, restore);
+
if (info->InternalTVOut)
RADEONRestoreTVRegisters(pScrn, restore);
@@ -5553,21 +5553,19 @@ void RADEONRestore(ScrnInfoPtr pScrn)
}
#endif
- /*RADEONUnblank(pScrn);*/
- /* R4xx hangs when unblanking, but seems to restore fine without it.
- * This will probably cause problems with non-VGA consoles.
- */
- if (!info->IsAtomBios) {
- /* need to make sure we don't enable a crtc by accident or we may get a hang */
- if (info->crtc_on) {
- crtc = xf86_config->crtc[0];
- crtc->funcs->dpms(crtc, DPMSModeOn);
- }
- if (info->crtc2_on) {
- crtc = xf86_config->crtc[1];
- crtc->funcs->dpms(crtc, DPMSModeOn);
- }
+ /* need to make sure we don't enable a crtc by accident or we may get a hang */
+ if (info->crtc2_on) {
+ crtc = xf86_config->crtc[1];
+ crtc->funcs->dpms(crtc, DPMSModeOn);
+ }
+ if (info->crtc_on) {
+ crtc = xf86_config->crtc[0];
+ crtc->funcs->dpms(crtc, DPMSModeOn);
}
+ /* to restore console mode, DAC registers should be set after every other registers are set,
+ * otherwise,we may get blank screen
+ */
+ RADEONRestoreDACRegisters(pScrn, restore);
#if 0
RADEONWaitForVerticalSync(pScrn);
More information about the xorg-commit
mailing list