xf86-video-ati: Branch 'randr-1.2'

Alex Deucher agd5f at kemper.freedesktop.org
Thu Jun 28 22:16:13 PDT 2007


 src/radeon.h        |    4 ++++
 src/radeon_driver.c |   42 ++++++++++++++++++++++++++++++------------
 2 files changed, 34 insertions(+), 12 deletions(-)

New commits:
diff-tree bdcae622100c81a4d9a53938542b64908bacd195 (from 21be0d3a1f4700572c6425800596785d6850626f)
Author: Alex Deucher <alex at t41p.hsd1.va.comcast.net>
Date:   Fri Jun 29 01:15:57 2007 -0400

    RADEON: save crtc on/off state for console restore
    
    - prevents a possible hang if console is only using 1 crtc

diff --git a/src/radeon.h b/src/radeon.h
index c8b18b0..c759b75 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -748,6 +748,10 @@ typedef struct {
     RADEONBIOSConnector BiosConnector[RADEON_MAX_BIOS_CONNECTOR];
     RADEONBIOSInitTable BiosTable;
 
+    /* save crtc state for console restore */
+    Bool              crtc_on;
+    Bool              crtc2_on;
+
     Rotation rotation;
     void (*PointerMoved)(int, int, int);
     CreateScreenResourcesProcPtr CreateScreenResources;
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index c555869..71e24ba 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -3375,6 +3375,9 @@ Bool RADEONScreenInit(int scrnIndex, Scr
 
     info->PaletteSavedOnVT = FALSE;
 
+    info->crtc_on = FALSE;
+    info->crtc2_on = FALSE;
+
     RADEONSave(pScrn);
 
     RADEONDisableDisplays(pScrn);
@@ -4812,6 +4815,13 @@ static void RADEONSaveCrtcRegisters(Scrn
 	save->disp_hw_debug    = INREG (RADEON_DISP_HW_DEBUG);
 	save->crtc2_gen_cntl   = INREG(RADEON_CRTC2_GEN_CNTL);
     }
+
+    /* track if the crtc is enabled for text restore */
+    if (save->crtc_ext_cntl & RADEON_CRTC_DISPLAY_DIS)
+	info->crtc_on = FALSE;
+    else
+	info->crtc_on = TRUE;
+
 }
 
 /* Read DAC registers */
@@ -4882,6 +4892,13 @@ static void RADEONSaveCrtc2Registers(Scr
     }
     
     save->disp2_merge_cntl      = INREG(RADEON_DISP2_MERGE_CNTL);
+
+    /* track if the crtc is enabled for text restore */
+    if (save->crtc2_gen_cntl & RADEON_CRTC2_DISP_DIS)
+	info->crtc2_on = FALSE;
+    else
+	info->crtc2_on = TRUE;
+
 }
 
 /* Read PLL registers */
@@ -5015,6 +5032,8 @@ void RADEONRestore(ScrnInfoPtr pScrn)
     RADEONInfoPtr  info       = RADEONPTR(pScrn);
     unsigned char *RADEONMMIO = info->MMIO;
     RADEONSavePtr  restore    = &info->SavedReg;
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+    xf86CrtcPtr crtc;
 
     xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
 		   "RADEONRestore\n");
@@ -5073,19 +5092,18 @@ void RADEONRestore(ScrnInfoPtr pScrn)
        vgaHWLock(hwp);
     }
 #endif
-#if 0
-    {
-        xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
-	int i;
-	for (i = 0; i <= xf86_config->num_crtc; i++) {
-		if (i == 0)
-			xf86_config->crtc[i]->enabled = 1;
-		else
-			xf86_config->crtc[i]->enabled = 0;
-    	}
+
+    /* need to make sure we don't enable a crtc by accident or we may get a hang */
+    /*RADEONUnblank(pScrn);*/
+    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);
     }
-#endif
-    RADEONUnblank(pScrn);
+
 #if 0
     RADEONWaitForVerticalSync(pScrn);
 #endif


More information about the xorg-commit mailing list