[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-video-ati: Changes to 'upstream-experimental'



 man/radeon.man                   |    4 -
 src/AtomBios/includes/atombios.h |    2 
 src/atombios_crtc.c              |   59 +++++++++++++++++-----
 src/atombios_output.c            |    3 +
 src/legacy_output.c              |    8 +--
 src/radeon_atombios.c            |  101 +++++++++++++++++++++++++++++++++++++++
 src/radeon_atombios.h            |    6 ++
 src/radeon_bios.c                |    2 
 src/radeon_driver.c              |   65 +++++++++++++++++--------
 src/radeon_output.c              |    4 -
 src/radeon_reg.h                 |   13 ++++-
 src/radeon_tv.c                  |    4 -
 12 files changed, 223 insertions(+), 48 deletions(-)

New commits:
commit f65374f5e15bfd391a1838a686cd87d3bab8043d
Author: Maciej Cencora <m.cencora@gmail.com>
Date:   Mon Dec 31 09:44:34 2007 +1000

    atombios: initial rs690 patches

diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 6e10282..d68b18f 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -784,7 +784,11 @@ unsigned RADEONINMC(ScrnInfoPtr pScrn, int addr)
     unsigned char *RADEONMMIO = info->MMIO;
     CARD32         data;
 
-    if (IS_AVIVO_VARIANT) {
+    if (info->ChipFamily == CHIP_FAMILY_RS690)
+    {
+        OUTREG(RS690_MC_INDEX, (addr & RS690_MC_INDEX_MASK));
+        data = INREG(RS690_MC_DATA);
+    } else if (IS_AVIVO_VARIANT) {
 	OUTREG(AVIVO_MC_INDEX, (addr & 0xff) | 0x7f0000);
 	(void)INREG(AVIVO_MC_INDEX);
 	data = INREG(AVIVO_MC_DATA);
@@ -809,7 +813,13 @@ void RADEONOUTMC(ScrnInfoPtr pScrn, int addr, CARD32 data)
     RADEONInfoPtr  info       = RADEONPTR(pScrn);
     unsigned char *RADEONMMIO = info->MMIO;
 
-    if (IS_AVIVO_VARIANT) {
+    if (info->ChipFamily == CHIP_FAMILY_RS690)
+    {
+        OUTREG(RS690_MC_INDEX, ((addr & RS690_MC_INDEX_MASK) |
+                        RS690_MC_INDEX_WR_EN));
+        OUTREG(RS690_MC_DATA, data);
+        OUTREG(RS690_MC_INDEX, RS690_MC_INDEX_WR_ACK);
+    } else if (IS_AVIVO_VARIANT) {
 	OUTREG(AVIVO_MC_INDEX, (addr & 0xff) | 0xff0000);
 	(void)INREG(AVIVO_MC_INDEX);
 	OUTREG(AVIVO_MC_DATA, data);
@@ -865,6 +875,11 @@ void radeon_write_mc_fb_agp_location(ScrnInfoPtr pScrn, int mask, CARD32 fb_loc,
 	if (mask & LOC_AGP)
 	    OUTMC(pScrn, RV515_MC_AGP_LOCATION, agp_loc);
 	(void)INMC(pScrn, RV515_MC_AGP_LOCATION);
+    } else if (info->ChipFamily == CHIP_FAMILY_RS690) {
+	if (mask & LOC_FB)
+	    OUTMC(pScrn, RS690_MC_FB_LOCATION, fb_loc);
+	if (mask & LOC_AGP)
+	    OUTMC(pScrn, RS690_MC_AGP_LOCATION, agp_loc);
     } else if (info->ChipFamily >= CHIP_FAMILY_R520) { 
 	if (mask & LOC_FB)
 	    OUTMC(pScrn, R520_MC_FB_LOCATION, fb_loc);
@@ -898,6 +913,13 @@ void radeon_read_mc_fb_agp_location(ScrnInfoPtr pScrn, int mask, CARD32 *fb_loc,
 	    *agp_loc = INMC(pScrn, RV515_MC_AGP_LOCATION);
 	    *agp_loc_hi = 0;
 	}
+    } else if (info->ChipFamily == CHIP_FAMILY_RS690) {
+	if (mask & LOC_FB)
+	    *fb_loc = INMC(pScrn, RS690_MC_FB_LOCATION);
+	if (mask & LOC_AGP) {
+	    *agp_loc = INMC(pScrn, RS690_MC_AGP_LOCATION);
+	    *agp_loc_hi = 0;
+	}
     } else if (info->ChipFamily >= CHIP_FAMILY_R520) {
 	if (mask & LOC_FB)
 	    *fb_loc = INMC(pScrn, R520_MC_FB_LOCATION);
@@ -1416,7 +1438,7 @@ static void RADEONInitMemoryMap(ScrnInfoPtr pScrn)
     }
 
     if (mem_size == 0)
-	    mem_size = 0x800000;
+	mem_size = 0x800000;
 
     /* Fix for RN50, M6, M7 with 8/16/32(??) MBs of VRAM - 
        Novell bug 204882 + along with lots of ubuntu ones */
@@ -1431,7 +1453,7 @@ static void RADEONInitMemoryMap(ScrnInfoPtr pScrn)
     }
 #endif
 
-    {
+    if (info->ChipFamily != CHIP_FAMILY_RS690) {
 	if (info->IsIGP)
 	    info->mc_fb_location = INREG(RADEON_NB_TOM);
 	else
@@ -1626,7 +1648,9 @@ static Bool RADEONPreInitVRAM(ScrnInfoPtr pScrn)
     MessageType    from = X_PROBED;
     CARD32         accessible, bar_size;
 
-    if ((info->IsIGP)) {
+    if (info->ChipFamily == CHIP_FAMILY_RS690) {
+	pScrn->videoRam = INREG(RADEON_CONFIG_MEMSIZE);
+    } else if (info->IsIGP) {
         CARD32 tom = INREG(RADEON_NB_TOM);
 
 	pScrn->videoRam = (((tom >> 16) -
diff --git a/src/radeon_reg.h b/src/radeon_reg.h
index d1ef0a9..09be229 100644
--- a/src/radeon_reg.h
+++ b/src/radeon_reg.h
@@ -3272,6 +3272,15 @@
 #define RADEON_RS480_UNK_e38			0xe38
 #define RADEON_RS480_UNK_e3c			0xe3c
 
+#define RS690_MC_INDEX				0x78
+#	define RS690_MC_INDEX_MASK		0x1ff
+#	define RS690_MC_INDEX_WR_EN		(1 << 9)
+#	define RS690_MC_INDEX_WR_ACK		0x7f
+#define RS690_MC_DATA				0x7c
+
+#define RS690_MC_FB_LOCATION			0x100
+#define RS690_MC_AGP_LOCATION			0x101
+#define RS690_MC_AGP_BASE			0x102
 
 #define AVIVO_MC_INDEX						0x0070
 #define R520_MC_STATUS 0x00

commit a674f683e6699c30664d9cd468a64de991c3fd7e
Author: Dave Airlie <airlied@linux.ie>
Date:   Sun Dec 30 17:43:17 2007 +1000

    atombios: enable TV-out detection code - tv out works for me with this

diff --git a/src/atombios_output.c b/src/atombios_output.c
index f84afd0..45e5696 100644
--- a/src/atombios_output.c
+++ b/src/atombios_output.c
@@ -480,6 +480,9 @@ atombios_set_output_crtc_source(xf86OutputPtr output)
 	    } else if (radeon_output->MonType == MT_LCD) {
 		if (radeon_output->devices & ATOM_DEVICE_LCD1_SUPPORT)
 		    crtc_src_param.ucDevice = ATOM_DEVICE_LCD1_INDEX;
+	    } else if (OUTPUT_IS_TV || (radeon_output->MonType == MT_CV)) {
+		if (radeon_output->devices & ATOM_DEVICE_TV1_SUPPORT)
+		    crtc_src_param.ucDevice = ATOM_DEVICE_TV1_INDEX;
 	    }
 	    break;
 	}
diff --git a/src/radeon_output.c b/src/radeon_output.c
index c5f796b..9efa056 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -359,7 +359,7 @@ void RADEONConnectorFindMonitor(ScrnInfoPtr pScrn, xf86OutputPtr output)
 			else
 			    radeon_output->MonType = MT_CTV;
 		    } else
-			radeon_output->MonType = MT_NONE;
+		        radeon_output->MonType = atombios_dac_detect(pScrn, output);
 		} else
 		    radeon_output->MonType = atombios_dac_detect(pScrn, output);
 	    }

commit aa7c28cbd943bb525698515d444cb5097880e364
Author: Dave Airlie <airlied@linux.ie>
Date:   Sun Dec 30 17:40:37 2007 +1000

    atombios: enable support for using tv timings
    
    enable support for the atombios tv timings selection by programming the crtc
    with the tv timings if a tv is detected on the output

diff --git a/src/atombios_crtc.c b/src/atombios_crtc.c
index ebfadd6..6769988 100644
--- a/src/atombios_crtc.c
+++ b/src/atombios_crtc.c
@@ -244,10 +244,12 @@ atombios_crtc_mode_set(xf86CrtcPtr crtc,
     ScrnInfoPtr pScrn = crtc->scrn;
     RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
     RADEONInfoPtr  info = RADEONPTR(pScrn);
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
     unsigned char *RADEONMMIO = info->MMIO;
     unsigned long fb_location = crtc->scrn->fbOffset + info->fbLocation;
     Bool           tilingOld   = info->tilingEnabled;
-
+    int need_tv_timings = 0;
+    int i, ret;
     SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION crtc_timing;
 
     memset(&crtc_timing, 0, sizeof(crtc_timing));
@@ -267,22 +269,51 @@ atombios_crtc_mode_set(xf86CrtcPtr crtc,
 #endif
     }
 
-    crtc_timing.ucCRTC = radeon_crtc->crtc_id;
-    crtc_timing.usH_Total = adjusted_mode->CrtcHTotal;
-    crtc_timing.usH_Disp = adjusted_mode->CrtcHDisplay;
-    crtc_timing.usH_SyncStart = adjusted_mode->CrtcHSyncStart;
-    crtc_timing.usH_SyncWidth = adjusted_mode->CrtcHSyncEnd - adjusted_mode->CrtcHSyncStart;
+    for (i = 0; i < xf86_config->num_output; i++) {
+	xf86OutputPtr output = xf86_config->output[i];
+	RADEONOutputPrivatePtr radeon_output = output->driver_private;
 
-    crtc_timing.usV_Total = adjusted_mode->CrtcVTotal;
-    crtc_timing.usV_Disp = adjusted_mode->CrtcVDisplay;
-    crtc_timing.usV_SyncStart = adjusted_mode->CrtcVSyncStart;
-    crtc_timing.usV_SyncWidth = adjusted_mode->CrtcVSyncEnd - adjusted_mode->CrtcVSyncStart;
+	if (output->crtc == crtc) {
+	    if (radeon_output->MonType == MT_STV || radeon_output->MonType == MT_CTV) {
+		if (radeon_output->tvStd == TV_STD_NTSC ||
+		    radeon_output->tvStd == TV_STD_NTSC_J ||
+		    radeon_output->tvStd == TV_STD_PAL_M)
+		    need_tv_timings = 1;
+		else
+		    need_tv_timings = 2;
 
-    if (adjusted_mode->Flags & V_NVSYNC)
-      crtc_timing.susModeMiscInfo.usAccess |= ATOM_VSYNC_POLARITY;
+	    }
+	}
+    }
 
-    if (adjusted_mode->Flags & V_NHSYNC)
-      crtc_timing.susModeMiscInfo.usAccess |= ATOM_HSYNC_POLARITY;
+    crtc_timing.ucCRTC = radeon_crtc->crtc_id;
+    if (need_tv_timings) {
+      ret = RADEONATOMGetTVTimings(pScrn, need_tv_timings - 1, &crtc_timing, &adjusted_mode->Clock);
+      if (ret == FALSE) {
+	  need_tv_timings = 0;
+      } else {
+	  adjusted_mode->CrtcHDisplay = crtc_timing.usH_Disp;
+      }
+    }
+	    
+    if (!need_tv_timings) {
+	crtc_timing.usH_Total = adjusted_mode->CrtcHTotal;
+	crtc_timing.usH_Disp = adjusted_mode->CrtcHDisplay;
+	crtc_timing.usH_SyncStart = adjusted_mode->CrtcHSyncStart;
+	crtc_timing.usH_SyncWidth = adjusted_mode->CrtcHSyncEnd - adjusted_mode->CrtcHSyncStart;
+	
+	crtc_timing.usV_Total = adjusted_mode->CrtcVTotal;
+	crtc_timing.usV_Disp = adjusted_mode->CrtcVDisplay;
+	crtc_timing.usV_SyncStart = adjusted_mode->CrtcVSyncStart;
+	crtc_timing.usV_SyncWidth = adjusted_mode->CrtcVSyncEnd - adjusted_mode->CrtcVSyncStart;
+	
+	if (adjusted_mode->Flags & V_NVSYNC)
+	    crtc_timing.susModeMiscInfo.usAccess |= ATOM_VSYNC_POLARITY;
+	
+	if (adjusted_mode->Flags & V_NHSYNC)
+	    crtc_timing.susModeMiscInfo.usAccess |= ATOM_HSYNC_POLARITY;
+	
+    }
 
     ErrorF("Mode %dx%d - %d %d %d\n", adjusted_mode->CrtcHDisplay, adjusted_mode->CrtcVDisplay,
 	   adjusted_mode->CrtcHTotal, adjusted_mode->CrtcVTotal, adjusted_mode->Flags);
diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c
index 0c0122e..ff16368 100644
--- a/src/radeon_atombios.c
+++ b/src/radeon_atombios.c
@@ -1531,6 +1531,38 @@ RADEONGetATOMTVInfo(xf86OutputPtr output)
 }
 
 Bool
+RADEONATOMGetTVTimings(ScrnInfoPtr pScrn, int index, SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION *crtc_timing, uint32_t *pixel_clock)
+{
+    RADEONInfoPtr  info       = RADEONPTR(pScrn);
+    ATOM_ANALOG_TV_INFO *tv_info;
+
+    tv_info = info->atomBIOS->atomDataPtr->AnalogTV_Info;    
+
+    if (index > MAX_SUPPORTED_TV_TIMING)
+	return FALSE;
+
+    crtc_timing->usH_Total = tv_info->aModeTimings[index].usCRTC_H_Total;
+    crtc_timing->usH_Disp = tv_info->aModeTimings[index].usCRTC_H_Disp;
+    crtc_timing->usH_SyncStart = tv_info->aModeTimings[index].usCRTC_H_SyncStart;
+    crtc_timing->usH_SyncWidth = tv_info->aModeTimings[index].usCRTC_H_SyncWidth;
+
+    crtc_timing->usV_Total = tv_info->aModeTimings[index].usCRTC_V_Total;
+    crtc_timing->usV_Disp = tv_info->aModeTimings[index].usCRTC_V_Disp;
+    crtc_timing->usV_SyncStart = tv_info->aModeTimings[index].usCRTC_V_SyncStart;
+    crtc_timing->usV_SyncWidth = tv_info->aModeTimings[index].usCRTC_V_SyncWidth;
+
+    crtc_timing->susModeMiscInfo = tv_info->aModeTimings[index].susModeMiscInfo;
+
+    crtc_timing->ucOverscanRight = tv_info->aModeTimings[index].usCRTC_OverscanRight;
+    crtc_timing->ucOverscanLeft = tv_info->aModeTimings[index].usCRTC_OverscanLeft;
+    crtc_timing->ucOverscanBottom = tv_info->aModeTimings[index].usCRTC_OverscanBottom;
+    crtc_timing->ucOverscanTop = tv_info->aModeTimings[index].usCRTC_OverscanTop;
+    *pixel_clock = tv_info->aModeTimings[index].usPixelClock * 10;
+
+    return TRUE;
+}
+
+Bool
 RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn)
 {
     RADEONInfoPtr info = RADEONPTR (pScrn);
diff --git a/src/radeon_atombios.h b/src/radeon_atombios.h
index 111fb45..d4dc1e4 100644
--- a/src/radeon_atombios.h
+++ b/src/radeon_atombios.h
@@ -246,4 +246,7 @@ typedef struct _atomBiosHandle {
 
 # endif
 
+extern Bool
+RADEONATOMGetTVTimings(ScrnInfoPtr pScrn, int index, SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION *crtc_timing, uint32_t *pixel_clock);
+
 #endif /*  RHD_ATOMBIOS_H_ */

commit 0bc3fd595a73e12a424571697d164a09a6a4c072
Author: Dave Airlie <airlied@linux.ie>
Date:   Sun Dec 30 16:39:58 2007 +1000

    atombios: add support for reading tv standard from atombios
    
    fix typo in atombios header file

diff --git a/src/AtomBios/includes/atombios.h b/src/AtomBios/includes/atombios.h
index e58e302..863de2e 100644
--- a/src/AtomBios/includes/atombios.h
+++ b/src/AtomBios/includes/atombios.h
@@ -2009,7 +2009,7 @@ typedef struct _ATOM_SPREAD_SPECTRUM_INFO
 typedef struct _ATOM_ANALOG_TV_INFO
 {
   ATOM_COMMON_TABLE_HEADER sHeader;  
-  UCHAR                    ucTV_SuppportedStandard;
+  UCHAR                    ucTV_SupportedStandard;
   UCHAR                    ucTV_BootUpDefaultStandard; 
   UCHAR                    ucExt_TV_ASIC_ID;
   UCHAR                    ucExt_TV_ASIC_SlaveAddr;
diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c
index ae32753..0c0122e 100644
--- a/src/radeon_atombios.c
+++ b/src/radeon_atombios.c
@@ -1460,6 +1460,75 @@ RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn)
     return TRUE;
 }
 
+Bool
+RADEONGetATOMTVInfo(xf86OutputPtr output)
+{
+    ScrnInfoPtr pScrn = output->scrn;
+    RADEONInfoPtr  info       = RADEONPTR(pScrn);
+    RADEONOutputPrivatePtr radeon_output = output->driver_private;
+    ATOM_ANALOG_TV_INFO *tv_info;
+
+    tv_info = info->atomBIOS->atomDataPtr->AnalogTV_Info;
+
+    if (!tv_info)
+	return FALSE;
+
+    switch(tv_info->ucTV_BootUpDefaultStandard) {
+    case NTSC_SUPPORT:
+	radeon_output->default_tvStd = TV_STD_NTSC;
+	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Default TV standard: NTSC\n");
+	break;
+    case NTSCJ_SUPPORT:
+	radeon_output->default_tvStd = TV_STD_NTSC_J;
+	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Default TV standard: NTSC-J\n");
+	break;
+    case PAL_SUPPORT:
+	radeon_output->default_tvStd = TV_STD_PAL;
+	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Default TV standard: PAL\n");
+	break;
+    case PALM_SUPPORT:
+	radeon_output->default_tvStd = TV_STD_PAL_M;
+	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Default TV standard: PAL-M\n");
+	break;
+    case PAL60_SUPPORT:
+	radeon_output->default_tvStd = TV_STD_PAL_60;
+	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Default TV standard: PAL-60\n");
+	break;
+    }
+
+    radeon_output->tvStd = radeon_output->default_tvStd;
+
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "TV standards supported by chip: ");
+    radeon_output->SupportedTVStds = radeon_output->default_tvStd;
+    if (tv_info->ucTV_SupportedStandard & NTSC_SUPPORT) {
+	ErrorF("NTSC ");
+	radeon_output->SupportedTVStds |= TV_STD_NTSC;
+    }
+    if (tv_info->ucTV_SupportedStandard & NTSCJ_SUPPORT) {
+	ErrorF("NTSC-J ");
+	radeon_output->SupportedTVStds |= TV_STD_NTSC_J;
+    }
+    if (tv_info->ucTV_SupportedStandard & PAL_SUPPORT) {
+	ErrorF("PAL ");
+	radeon_output->SupportedTVStds |= TV_STD_PAL;
+    }
+    if (tv_info->ucTV_SupportedStandard & PALM_SUPPORT) {
+	ErrorF("PAL-M ");
+	radeon_output->SupportedTVStds |= TV_STD_PAL_M;
+    }
+    if (tv_info->ucTV_SupportedStandard & PAL60_SUPPORT) {
+	ErrorF("PAL-60 ");
+	radeon_output->SupportedTVStds |= TV_STD_PAL_60;
+    }
+    ErrorF("\n");
+
+    if (tv_info->ucExt_TV_ASIC_ID) {
+	xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unknown external TV ASIC\n");
+	return FALSE;
+    }
+
+    return TRUE;
+}
 
 Bool
 RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn)
diff --git a/src/radeon_atombios.h b/src/radeon_atombios.h
index bfac93e..111fb45 100644
--- a/src/radeon_atombios.h
+++ b/src/radeon_atombios.h
@@ -115,6 +115,9 @@ RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn);
 extern Bool
 RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn);
 
+extern Bool
+RADEONGetATOMTVInfo(xf86OutputPtr output);
+
 extern int
 atombios_external_tmds_setup(xf86OutputPtr output, DisplayModePtr mode);
 
diff --git a/src/radeon_bios.c b/src/radeon_bios.c
index 9253182..9b28b6f 100644
--- a/src/radeon_bios.c
+++ b/src/radeon_bios.c
@@ -524,7 +524,7 @@ Bool RADEONGetTVInfoFromBIOS (xf86OutputPtr output) {
 
     if (info->IsAtomBios) {
 	/* no idea where TV table is on ATOM bios */
-	return FALSE;
+        return RADEONGetATOMTVInfo(output);
     } else {
 	offset = RADEON_BIOS16(info->ROMHeaderStart + 0x32);
 	if (offset) {

commit bfa22d676a6f333503104041f62222f4de9bb7d8
Author: Alex Deucher <alex@t41p.hsd1.va.comcast.net>
Date:   Wed Dec 26 12:29:47 2007 -0500

    RADEON: fix typo that broke tv load detection

diff --git a/src/legacy_output.c b/src/legacy_output.c
index 694e7c7..4b7fded 100644
--- a/src/legacy_output.c
+++ b/src/legacy_output.c
@@ -562,15 +562,15 @@ legacy_dac_detect(ScrnInfoPtr pScrn, xf86OutputPtr output)
     if (OUTPUT_IS_TV) {
 	if (xf86ReturnOptValBool(info->Options, OPTION_FORCE_TVOUT, FALSE)) {
 	    if (radeon_output->type == OUTPUT_STV)
-		radeon_output->MonType = MT_STV;
+		found = MT_STV;
 	    else
-		radeon_output->MonType = MT_CTV;
+		found = MT_CTV;
 	} else {
 	    if (info->InternalTVOut) {
 		if (radeon_output->load_detection)
-		    radeon_output->MonType = radeon_detect_tv(pScrn);
+		    found = radeon_detect_tv(pScrn);
 		else
-		    radeon_output->MonType = MT_NONE;
+		    found = MT_NONE;
 	    }
 	}
     } else {

commit 0c99554c6fab1192f5e8595469c21b5f33e1eb4f
Author: David Miller <davem@davemloft.net>
Date:   Wed Dec 26 02:19:12 2007 -0500

    [RADEON]: Add missing break in SCLK calculation.

diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index f5167b7..6e10282 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -1173,7 +1173,7 @@ static Bool RADEONProbePLLParameters(ScrnInfoPtr pScrn)
     case 2: info->sclk = spll / 2.0; break;
     case 3: info->sclk = spll / 4.0; break;
     case 4: info->sclk = spll / 8.0; break;
-    case 7: info->sclk = mpll;
+    case 7: info->sclk = mpll; break;
     default:
            info->sclk = 200.00;
            xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unsupported SCLK source"

commit 6e0d5cc1c62fbfc1962fa0d6333f0c0a8c6327bd
Author: David Miller <davem@davemloft.net>
Date:   Wed Dec 26 02:17:34 2007 -0500

    [RADEON]: Like powerpc, don't use VGA by default on sparc.

diff --git a/man/radeon.man b/man/radeon.man
index 2a561a6..141342e 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -362,7 +362,7 @@ shouldn't be if the console is using radeonfb or some other graphic
 mode driver. Some platforms like PowerPC have issues with those, and they aren't
 necessary unless you have a real text mode in console. The default is
 .B off
-on PowerPC and
+on PowerPC and SPARC and
 .B on
 on other architectures.
 .TP
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 7ce9236..f5167b7 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -2111,7 +2111,7 @@ static Bool RADEONPreInitAccel(ScrnInfoPtr pScrn)
 
 static Bool RADEONPreInitInt10(ScrnInfoPtr pScrn, xf86Int10InfoPtr *ppInt10)
 {
-#if !defined(__powerpc__)
+#if !defined(__powerpc__) && !defined(__sparc__)
     RADEONInfoPtr  info = RADEONPTR(pScrn);
     unsigned char *RADEONMMIO = info->MMIO;
     CARD32 fp2_gen_ctl_save   = 0;
@@ -2826,8 +2826,8 @@ _X_EXPORT Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags)
     memcpy(info->Options, RADEONOptions, sizeof(RADEONOptions));
     xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, info->Options);
 
-    /* By default, don't do VGA IOs on ppc */
-#if defined(__powerpc__) || !defined(WITH_VGAHW)
+    /* By default, don't do VGA IOs on ppc/sparc */
+#if defined(__powerpc__) || defined(__sparc__) || !defined(WITH_VGAHW)
     info->VGAAccess = FALSE;
 #else
     info->VGAAccess = TRUE;

commit 2b1fae668ddabbc72e5fc31365302ea722174df1
Author: Alex Deucher <alex@t41p.hsd1.va.comcast.net>
Date:   Wed Dec 26 02:04:06 2007 -0500

    RADEON: fix PAL tv-out
    
    Many thanks to Andrew Randrianasulu for providing me with
    pll reg dumps

diff --git a/src/radeon_reg.h b/src/radeon_reg.h
index dce29e2..d1ef0a9 100644
--- a/src/radeon_reg.h
+++ b/src/radeon_reg.h
@@ -3244,9 +3244,9 @@
 #define RADEON_TV_PLL_FINE_CNTL			     0x0020	/* PLL */
 #define RADEON_TV_PLL_CNTL                           0x0021	/* PLL */
 #       define RADEON_TV_M0LO_MASK               0xff
-#       define RADEON_TV_M0HI_MASK               0x3
+#       define RADEON_TV_M0HI_MASK               0x7
 #       define RADEON_TV_M0HI_SHIFT              18
-#       define RADEON_TV_N0LO_MASK               0xff
+#       define RADEON_TV_N0LO_MASK               0x1ff
 #       define RADEON_TV_N0LO_SHIFT              8
 #       define RADEON_TV_N0HI_MASK               0x3
 #       define RADEON_TV_N0HI_SHIFT              21
diff --git a/src/radeon_tv.c b/src/radeon_tv.c
index 9959295..ab95a30 100644
--- a/src/radeon_tv.c
+++ b/src/radeon_tv.c
@@ -869,13 +869,13 @@ void RADEONInitTVRegisters(xf86OutputPtr output, RADEONSavePtr save,
 	save->tv_pll_cntl = (NTSC_TV_PLL_M & RADEON_TV_M0LO_MASK) |
 	    (((NTSC_TV_PLL_M >> 8) & RADEON_TV_M0HI_MASK) << RADEON_TV_M0HI_SHIFT) |
 	    ((NTSC_TV_PLL_N & RADEON_TV_N0LO_MASK) << RADEON_TV_N0LO_SHIFT) |
-	    (((NTSC_TV_PLL_N >> 8) & RADEON_TV_N0HI_MASK) << RADEON_TV_N0HI_SHIFT) |
+	    (((NTSC_TV_PLL_N >> 9) & RADEON_TV_N0HI_MASK) << RADEON_TV_N0HI_SHIFT) |
 	    ((NTSC_TV_PLL_P & RADEON_TV_P_MASK) << RADEON_TV_P_SHIFT);
     else
 	save->tv_pll_cntl = (PAL_TV_PLL_M & RADEON_TV_M0LO_MASK) |
 	    (((PAL_TV_PLL_M >> 8) & RADEON_TV_M0HI_MASK) << RADEON_TV_M0HI_SHIFT) |
 	    ((PAL_TV_PLL_N & RADEON_TV_N0LO_MASK) << RADEON_TV_N0LO_SHIFT) |
-	    (((PAL_TV_PLL_N >> 8) & RADEON_TV_N0HI_MASK) << RADEON_TV_N0HI_SHIFT) |
+	    (((PAL_TV_PLL_N >> 9) & RADEON_TV_N0HI_MASK) << RADEON_TV_N0HI_SHIFT) |
 	    ((PAL_TV_PLL_P & RADEON_TV_P_MASK) << RADEON_TV_P_SHIFT);
 
     save->tv_pll_cntl1 =  (((4 & RADEON_TVPCP_MASK)<< RADEON_TVPCP_SHIFT) |

commit d736eb5732da573162c70712dc4e8b0114986702
Author: Alex Deucher <alex@botch2.(none)>
Date:   Mon Dec 24 12:34:15 2007 -0500

    RADEON: default "IgnoreLidStatus" to TRUE
    
    Seems there are lots of busted ACPI lid status and people
    starting X with the lid closed.

diff --git a/man/radeon.man b/man/radeon.man
index 49755f4..2a561a6 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -471,7 +471,7 @@ The default is
 Enable this option to ignore lid status on laptops and always detect
 LVDS as attached.
 The default is
-.B off 
+.B on. 
 .TP
 
 .SH SEE ALSO
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 814c766..c5f796b 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -442,7 +442,7 @@ static RADEONMonitorType RADEONPortCheckNonDDC(ScrnInfoPtr pScrn, xf86OutputPtr
     RADEONMonitorType MonType = MT_NONE;
 
     if (radeon_output->type == OUTPUT_LVDS) {
-	if (xf86ReturnOptValBool(info->Options, OPTION_IGNORE_LID_STATUS, FALSE))
+	if (xf86ReturnOptValBool(info->Options, OPTION_IGNORE_LID_STATUS, TRUE))
 	    MonType = MT_LCD;
 	else
 #if defined(__powerpc__)

commit 653da558148cc601bc1f80253e92ef98c75ef37a
Author: Alex Deucher <alex@botch2.(none)>
Date:   Mon Dec 24 01:11:56 2007 -0500

    RADEON: restore crtc regs before VGA regs.
    
    It seems some radeons don't restore text console properly if
    the crtc regs are restored after the VGA regs.
    Thanks to Sverre Froyen for helping me track this down

diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 6885cdc..7ce9236 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -4590,6 +4590,18 @@ void RADEONRestore(ScrnInfoPtr pScrn)
     usleep(100000);
 #endif
 
+    /* need to make sure we don't enable a crtc by accident or we may get a hang */
+    if (pRADEONEnt->HasCRTC2 && !info->IsSecondary) {
+	if (info->crtc2_on && xf86_config->num_crtc > 1) {
+	    crtc = xf86_config->crtc[1];
+	    crtc->funcs->dpms(crtc, DPMSModeOn);
+	}
+    }
+    if (info->crtc_on) {
+	crtc = xf86_config->crtc[0];
+	crtc->funcs->dpms(crtc, DPMSModeOn);
+    }
+
 #ifdef WITH_VGAHW
     if (info->VGAAccess) {
        vgaHWPtr hwp = VGAHWPTR(pScrn);
@@ -4606,17 +4618,6 @@ void RADEONRestore(ScrnInfoPtr pScrn)
     }
 #endif
 
-    /* need to make sure we don't enable a crtc by accident or we may get a hang */
-    if (pRADEONEnt->HasCRTC2 && !info->IsSecondary) {
-	if (info->crtc2_on && xf86_config->num_crtc > 1) {
-	    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 
      */


Reply to: