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

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



 man/r128.man           |    2 
 man/radeon.man         |   14 +-
 src/AtomBios/Decoder.c |    2 
 src/Makefile.am        |    2 
 src/atombios_crtc.c    |   34 ++++-
 src/atombios_output.c  |   66 +++++++++++
 src/legacy_output.c    |   19 ++-
 src/r128_driver.c      |    6 -
 src/radeon.h           |    2 
 src/radeon_atombios.c  |  189 ++++++++++++++++++++++++++-------
 src/radeon_atombios.h  |    5 
 src/radeon_bios.c      |    1 
 src/radeon_crtc.c      |    5 
 src/radeon_driver.c    |   43 +++++--
 src/radeon_modes.c     |   69 +++++++++++-
 src/radeon_output.c    |  278 +++++++++++++++++++++++++++++--------------------
 src/radeon_probe.h     |    2 
 src/radeon_tv.c        |    2 
 18 files changed, 542 insertions(+), 199 deletions(-)

New commits:
commit 10e7636c02478b8ffe183bb0c46229ca0d6584e1
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Wed Jan 9 12:47:39 2008 -0500

    RADEON: fix crtc routing on r4xx cards when using atom to init DVO chip

diff --git a/src/legacy_output.c b/src/legacy_output.c
index 595b243..45706b9 100644
--- a/src/legacy_output.c
+++ b/src/legacy_output.c
@@ -1230,11 +1230,24 @@ legacy_output_mode_set(xf86OutputPtr output, DisplayModePtr mode,
 	    RADEONRestoreFPRegisters(pScrn, info->ModeReg);
 	} else {
 	    ErrorF("restore FP2\n");
-	    RADEONRestoreFP2Registers(pScrn, info->ModeReg);
-	    if (info->IsAtomBios)
+	    if (info->IsAtomBios) {
+		unsigned char *RADEONMMIO = info->MMIO;
+		CARD32 fp2_gen_cntl;
+
 		atombios_external_tmds_setup(output, mode);
-	    else
+		/* r4xx atom seems to have hard coded crtc mappings in the atom code
+		 * Fix it up here.
+		 */
+		fp2_gen_cntl = INREG(RADEON_FP2_GEN_CNTL) & ~R200_FP2_SOURCE_SEL_MASK;
+		if (radeon_crtc->crtc_id == 1)
+		    fp2_gen_cntl |= R200_FP2_SOURCE_SEL_CRTC2;
+		else
+		    fp2_gen_cntl |= R200_FP2_SOURCE_SEL_CRTC1;
+		OUTREG(RADEON_FP2_GEN_CNTL, fp2_gen_cntl);
+	    } else {
 		RADEONRestoreDVOChip(pScrn, output);
+		RADEONRestoreFP2Registers(pScrn, info->ModeReg);
+	    }
 	}
 	break;
     case MT_STV:

commit 3af671f5963810dbfd63abc9889b1d46b68f404c
Author: Alex Deucher <alex@botch2.(none)>
Date:   Wed Jan 9 11:30:25 2008 -0500

    RADEON: restore FP2 regs before external encoders
    
    This may fix krh's dvi problem

diff --git a/src/legacy_output.c b/src/legacy_output.c
index 4b7fded..595b243 100644
--- a/src/legacy_output.c
+++ b/src/legacy_output.c
@@ -1230,11 +1230,11 @@ legacy_output_mode_set(xf86OutputPtr output, DisplayModePtr mode,
 	    RADEONRestoreFPRegisters(pScrn, info->ModeReg);
 	} else {
 	    ErrorF("restore FP2\n");
+	    RADEONRestoreFP2Registers(pScrn, info->ModeReg);
 	    if (info->IsAtomBios)
 		atombios_external_tmds_setup(output, mode);
 	    else
 		RADEONRestoreDVOChip(pScrn, output);
-	    RADEONRestoreFP2Registers(pScrn, info->ModeReg);
 	}
 	break;
     case MT_STV:

commit 2a54c6bb09ade2ec8f998dfc1624017029d47fa3
Author: Alex Deucher <alex@botch2.(none)>
Date:   Tue Jan 8 18:43:54 2008 -0500

    RADEON: Make default output actually work...

diff --git a/src/radeon.h b/src/radeon.h
index d16a234..bddbc7b 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -727,6 +727,8 @@ typedef struct {
     void (*PointerMoved)(int, int, int);
     CreateScreenResourcesProcPtr CreateScreenResources;
 
+    /* if no devices are connected at server startup */
+    Bool              first_load_no_devices;
 
     Bool              IsSecondary;
     Bool              IsPrimary;
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index d10d81b..07f96a7 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -2678,6 +2678,7 @@ static Bool RADEONPreInitControllers(ScrnInfoPtr pScrn)
       
     RADEONPrintPortMap(pScrn);
 
+    info->first_load_no_devices = FALSE;
     for (i = 0; i < config->num_output; i++) {
 	xf86OutputPtr	      output = config->output[i];
       
@@ -2694,32 +2695,7 @@ static Bool RADEONPreInitControllers(ScrnInfoPtr pScrn)
     if (!found) {
 	/* nothing connected, light up some defaults so the server comes up */
 	xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No connected devices found!\n");
-	for (i = 0; i < config->num_output; i++) {
-	    xf86OutputPtr output = config->output[i];
-	    RADEONOutputPrivatePtr radeon_output = output->driver_private;
-
-	    if (info->IsMobility) {
-		if (radeon_output->type == OUTPUT_LVDS) {
-		    radeon_output->MonType = MT_LCD;
-		    output->status = XF86OutputStatusConnected;
-		    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Using LVDS default\n");
-		    break;
-		}
-	    } else {
-		if (radeon_output->type == OUTPUT_VGA ||
-		    radeon_output->type == OUTPUT_DVI_I) {
-		    radeon_output->MonType = MT_CRT;
-		    output->status = XF86OutputStatusUnknown;
-		    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Using VGA default\n");
-		    break;
-		} else if (radeon_output->type == OUTPUT_DVI_D) {
-		    radeon_output->MonType = MT_DFP;
-		    output->status = XF86OutputStatusUnknown;
-		    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Using DVI default\n");
-		    break;
-		}
-	    }
-	}
+	info->first_load_no_devices = TRUE;
     }
 
     ErrorF("finished all detect\n");
diff --git a/src/radeon_output.c b/src/radeon_output.c
index b62eeaf..59e01bb 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -626,12 +626,36 @@ static xf86OutputStatus
 radeon_detect(xf86OutputPtr output)
 {
     ScrnInfoPtr	    pScrn = output->scrn;
+    RADEONInfoPtr info = RADEONPTR(pScrn);
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
     Bool connected = TRUE;
 
     radeon_output->MonType = MT_UNKNOWN;
     RADEONConnectorFindMonitor(pScrn, output);
 
+    /* nothing connected, light up some defaults so the server comes up */
+    if (radeon_output->MonType == MT_NONE &&
+	info->first_load_no_devices) {
+	if (info->IsMobility) {
+	    if (radeon_output->type == OUTPUT_LVDS) {
+		radeon_output->MonType = MT_LCD;
+		info->first_load_no_devices = FALSE;
+		xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Using LVDS default\n");
+	    }
+	} else {
+	    if (radeon_output->type == OUTPUT_VGA ||
+		radeon_output->type == OUTPUT_DVI_I) {
+		radeon_output->MonType = MT_CRT;
+		info->first_load_no_devices = FALSE;
+		xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Using VGA default\n");
+	    } else if (radeon_output->type == OUTPUT_DVI_D) {
+		radeon_output->MonType = MT_DFP;
+		info->first_load_no_devices = FALSE;
+		xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Using DVI default\n");
+	    }
+	}
+    }
+
     /* set montype so users can force outputs on even if detection fails */
     if (radeon_output->MonType == MT_NONE) {
 	connected = FALSE;

commit fa3e2055225c27e25465fc46786da1b7574fd3cc
Author: Alex Deucher <alex@botch2.(none)>
Date:   Mon Jan 7 01:13:09 2008 -0500

    RADEON: add default outputs if no connected devices
    
    If no connected devices found at server startup, default
    to something so the server comes up.  LVDS on mobility chips,
    DAC or TMDS on others.

diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 176e80d..d10d81b 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -2653,6 +2653,7 @@ static Bool RADEONPreInitControllers(ScrnInfoPtr pScrn)
     RADEONInfoPtr info = RADEONPTR(pScrn);
     int i;
     int mask;
+    int found = 0;
 
     if (!info->IsPrimary && !info->IsSecondary)
 	mask = 3;
@@ -2677,17 +2678,50 @@ static Bool RADEONPreInitControllers(ScrnInfoPtr pScrn)
       
     RADEONPrintPortMap(pScrn);
 
-    for (i = 0; i < config->num_output; i++) 
-    {
-      xf86OutputPtr	      output = config->output[i];
+    for (i = 0; i < config->num_output; i++) {
+	xf86OutputPtr	      output = config->output[i];
       
-      output->status = (*output->funcs->detect) (output);
-      ErrorF("finished output detect: %d\n", i);
-      if (info->IsPrimary || info->IsSecondary) {
-             if (output->status != XF86OutputStatusConnected)
-	         return FALSE;
-      }
+	output->status = (*output->funcs->detect) (output);
+	ErrorF("finished output detect: %d\n", i);
+	if (info->IsPrimary || info->IsSecondary) {
+	    if (output->status != XF86OutputStatusConnected)
+		return FALSE;
+	}
+	if (output->status != XF86OutputStatusDisconnected)
+	    found++;
+    }
+
+    if (!found) {
+	/* nothing connected, light up some defaults so the server comes up */
+	xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No connected devices found!\n");
+	for (i = 0; i < config->num_output; i++) {
+	    xf86OutputPtr output = config->output[i];
+	    RADEONOutputPrivatePtr radeon_output = output->driver_private;
+
+	    if (info->IsMobility) {
+		if (radeon_output->type == OUTPUT_LVDS) {
+		    radeon_output->MonType = MT_LCD;
+		    output->status = XF86OutputStatusConnected;
+		    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Using LVDS default\n");
+		    break;
+		}
+	    } else {
+		if (radeon_output->type == OUTPUT_VGA ||
+		    radeon_output->type == OUTPUT_DVI_I) {
+		    radeon_output->MonType = MT_CRT;
+		    output->status = XF86OutputStatusUnknown;
+		    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Using VGA default\n");
+		    break;
+		} else if (radeon_output->type == OUTPUT_DVI_D) {
+		    radeon_output->MonType = MT_DFP;
+		    output->status = XF86OutputStatusUnknown;
+		    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Using DVI default\n");
+		    break;
+		}
+	    }
+	}
     }
+
     ErrorF("finished all detect\n");
     return TRUE;
 }
diff --git a/src/radeon_output.c b/src/radeon_output.c
index b9c8165..b62eeaf 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -626,7 +626,6 @@ static xf86OutputStatus
 radeon_detect(xf86OutputPtr output)
 {
     ScrnInfoPtr	    pScrn = output->scrn;
-    RADEONInfoPtr info = RADEONPTR(pScrn);
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
     Bool connected = TRUE;
 
@@ -675,6 +674,7 @@ radeon_detect(xf86OutputPtr output)
 	  break;
       }
 
+#if 0
       if (!connected) {
 	  /* default to unknown for flaky chips/connectors
 	   * so we can get something on the screen
@@ -690,6 +690,7 @@ radeon_detect(xf86OutputPtr output)
 	      return XF86OutputStatusUnknown;
 	  }
       }
+#endif
 
       if (connected)
 	  return XF86OutputStatusConnected;
@@ -755,7 +756,6 @@ radeon_create_resources(xf86OutputPtr output)
     INT32 range[2];
     int data, err;
     const char *s;
-    char *optstr;
 
     /* backlight control */
     if (radeon_output->type == OUTPUT_LVDS) {

commit d972cc9237eb90b49b11f8d2bdc5b61f628911dc
Author: Alex Deucher <alex@botch2.(none)>
Date:   Sat Jan 5 17:19:06 2008 -0500

    RADEON: Fix TVStandard option

diff --git a/src/radeon_bios.c b/src/radeon_bios.c
index 9b28b6f..335bdfe 100644
--- a/src/radeon_bios.c
+++ b/src/radeon_bios.c
@@ -523,7 +523,6 @@ Bool RADEONGetTVInfoFromBIOS (xf86OutputPtr output) {
     if (!info->VBIOS) return FALSE;
 
     if (info->IsAtomBios) {
-	/* no idea where TV table is on ATOM bios */
         return RADEONGetATOMTVInfo(output);
     } else {
 	offset = RADEON_BIOS16(info->ROMHeaderStart + 0x32);
diff --git a/src/radeon_output.c b/src/radeon_output.c
index d2c6e2b..b9c8165 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -951,8 +951,9 @@ radeon_create_resources(xf86OutputPtr output)
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		       "RRConfigureOutputProperty error, %d\n", err);
 	}
+
 	/* Set the current value of the property */
-	switch (radeon_output->default_tvStd) {
+	switch (radeon_output->tvStd) {
 	case TV_STD_PAL:
 	    s = "pal";
 	    break;
@@ -974,25 +975,6 @@ radeon_create_resources(xf86OutputPtr output)
 	    break;
 	}
 
-	optstr = (char *)xf86GetOptValString(info->Options, OPTION_TVSTD);
-	if (optstr) {
-	    if (!strncmp("ntsc", optstr, strlen("ntsc")))
-		radeon_output->tvStd = TV_STD_NTSC;
-	    else if (!strncmp("pal", optstr, strlen("pal")))
-		radeon_output->tvStd = TV_STD_PAL;
-	    else if (!strncmp("pal-m", optstr, strlen("pal-m")))
-		radeon_output->tvStd = TV_STD_PAL_M;
-	    else if (!strncmp("pal-60", optstr, strlen("pal-60")))
-		radeon_output->tvStd = TV_STD_PAL_60;
-	    else if (!strncmp("ntsc-j", optstr, strlen("ntsc-j")))
-		radeon_output->tvStd = TV_STD_NTSC_J;
-	    else if (!strncmp("scart-pal", optstr, strlen("scart-pal")))
-		radeon_output->tvStd = TV_STD_SCART_PAL;
-	    else {
-		xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Invalid TV Standard: %s\n", optstr);
-	    }
-	}
-
 	err = RRChangeOutputProperty(output->randr_output, tv_std_atom,
 				     XA_STRING, 8, PropModeReplace, strlen(s), (pointer)s,
 				     FALSE, FALSE);
@@ -1662,19 +1644,41 @@ RADEONGetTMDSInfo(xf86OutputPtr output)
 static void
 RADEONGetTVInfo(xf86OutputPtr output)
 {
+    ScrnInfoPtr pScrn = output->scrn;
+    RADEONInfoPtr  info       = RADEONPTR(pScrn);
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
+    char *optstr;
 
     radeon_output->hPos = 0;
     radeon_output->vPos = 0;
     radeon_output->hSize = 0;
 
-    if (RADEONGetTVInfoFromBIOS(output)) return;
+    if (!RADEONGetTVInfoFromBIOS(output)) {
+	/* set some reasonable defaults */
+	radeon_output->default_tvStd = TV_STD_NTSC;
+	radeon_output->tvStd = TV_STD_NTSC;
+	radeon_output->TVRefClk = 27.000000000;
+	radeon_output->SupportedTVStds = TV_STD_NTSC | TV_STD_PAL;
+    }
 
-    /* set some reasonable defaults */
-    radeon_output->default_tvStd = TV_STD_NTSC;
-    radeon_output->tvStd = TV_STD_NTSC;
-    radeon_output->TVRefClk = 27.000000000;
-    radeon_output->SupportedTVStds = TV_STD_NTSC | TV_STD_PAL;
+    optstr = (char *)xf86GetOptValString(info->Options, OPTION_TVSTD);
+    if (optstr) {
+	if (!strncmp("ntsc", optstr, strlen("ntsc")))
+	    radeon_output->tvStd = TV_STD_NTSC;
+	else if (!strncmp("pal", optstr, strlen("pal")))
+	    radeon_output->tvStd = TV_STD_PAL;
+	else if (!strncmp("pal-m", optstr, strlen("pal-m")))
+	    radeon_output->tvStd = TV_STD_PAL_M;
+	else if (!strncmp("pal-60", optstr, strlen("pal-60")))
+	    radeon_output->tvStd = TV_STD_PAL_60;
+	else if (!strncmp("ntsc-j", optstr, strlen("ntsc-j")))
+	    radeon_output->tvStd = TV_STD_NTSC_J;
+	else if (!strncmp("scart-pal", optstr, strlen("scart-pal")))
+	    radeon_output->tvStd = TV_STD_SCART_PAL;
+	else {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Invalid TV Standard: %s\n", optstr);
+	}
+    }
 
 }
 

commit 45656b9d5a426053da2a094de39c2690c0c6f799
Author: Alex Deucher <alex@botch2.(none)>
Date:   Sat Jan 5 12:00:55 2008 -0500

    R128: Like powerpc, don't use VGA by default on sparc

diff --git a/man/r128.man b/man/r128.man
index 32bbaae..709c2fe 100644
--- a/man/r128.man
+++ b/man/r128.man
@@ -136,7 +136,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.
 
diff --git a/src/r128_driver.c b/src/r128_driver.c
index 6e26a6e..9c41b7b 100644
--- a/src/r128_driver.c
+++ b/src/r128_driver.c
@@ -1376,7 +1376,7 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn)
 
 static Bool R128PreInitDDC(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
 {
-#if !defined(__powerpc__) && !defined(__alpha__)
+#if !defined(__powerpc__) && !defined(__alpha__) && !defined(__sparc__)
     R128InfoPtr   info = R128PTR(pScrn);
     vbeInfoPtr pVbe;
 #endif
@@ -1384,7 +1384,7 @@ static Bool R128PreInitDDC(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
     if (!xf86LoadSubModule(pScrn, "ddc")) return FALSE;
     xf86LoaderReqSymLists(ddcSymbols, NULL);
 
-#if defined(__powerpc__) || defined(__alpha__)
+#if defined(__powerpc__) || defined(__alpha__) || defined(__sparc__)
     /* Int10 is broken on PPC and some Alphas */
     return TRUE;
 #else
@@ -2127,7 +2127,7 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags)
     xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, info->Options);
 
     /* By default, don't do VGA IOs on ppc */
-#if defined(__powerpc__) || !defined(WITH_VGAHW)
+#if defined(__powerpc__) || defined(__sparc__) || !defined(WITH_VGAHW)
     info->VGAAccess = FALSE;
 #else
     info->VGAAccess = TRUE;

commit b8e8db4675d07e45782de0d7c67ee0fd85eaedb3
Author: Alex Deucher <alex@t41p.hsd1.va.comcast.net>
Date:   Fri Jan 4 20:16:19 2008 -0500

    RADEON: fix tvdac load detection at server start up

diff --git a/src/radeon_output.c b/src/radeon_output.c
index c1a0ba8..d2c6e2b 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -794,12 +794,7 @@ radeon_create_resources(xf86OutputPtr output)
 		       "RRConfigureOutputProperty error, %d\n", err);
 	}
 
-	if (radeon_output->DACType == DAC_PRIMARY)
-	    data = 1; /* primary dac, only drives vga */
-	/*else if (radeon_output->DACType == DAC_TVDAC &&
-		 info->tvdac_use_count < 2)
-		 data = 1;*/ /* only one output with tvdac */
-	else if (xf86ReturnOptValBool(info->Options, OPTION_TVDAC_LOAD_DETECT, FALSE))
+	if (radeon_output->load_detection)
 	    data = 1; /* user forces on tv dac load detection */
 	else
 	    data = 0; /* shared tvdac between vga/dvi/tv */
@@ -1722,6 +1717,9 @@ void RADEONInitConnector(xf86OutputPtr output)
     /*else if (radeon_output->DACType == DAC_TVDAC &&
 	     info->tvdac_use_count < 2)
 	     radeon_output->load_detection = 1;*/ /* only one output with tvdac */
+    else if ((radeon_output->DACType == DAC_TVDAC) &&
+	     (xf86ReturnOptValBool(info->Options, OPTION_TVDAC_LOAD_DETECT, FALSE)))
+	radeon_output->load_detection = 1; /* shared tvdac between vga/dvi/tv */
     else
 	radeon_output->load_detection = 0; /* shared tvdac between vga/dvi/tv */
 

commit 3ba7f393d0669df36848715799de8affc10a5534
Author: Alex Deucher <alex@t41p.hsd1.va.comcast.net>
Date:   Fri Jan 4 20:00:48 2008 -0500

    RADEON: further fixup for pScrn->pScreen issue
    
    the previous fix seems to cause the driver to hang on
    some cards.

diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 1f12e87..176e80d 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -3181,7 +3181,9 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
 {
     ScrnInfoPtr    pScrn = xf86Screens[pScreen->myNum];
     RADEONInfoPtr  info  = RADEONPTR(pScrn);
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
     int            hasDRI = 0;
+    int i;
 #ifdef RENDER
     int            subPixelOrder = SubPixelUnknown;
     char*          s;
@@ -3481,6 +3483,34 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
 
     pScrn->vtSema = TRUE;
 
+    /* xf86CrtcRotate() accesses pScrn->pScreen */
+    pScrn->pScreen = pScreen;
+
+#if 1
+    for (i = 0; i < xf86_config->num_crtc; i++) {
+	xf86CrtcPtr crtc = xf86_config->crtc[i];
+
+	/* Mark that we'll need to re-set the mode for sure */
+	memset(&crtc->mode, 0, sizeof(crtc->mode));
+	if (!crtc->desiredMode.CrtcHDisplay) {
+	    crtc->desiredMode = *RADEONCrtcFindClosestMode (crtc, pScrn->currentMode);
+	    crtc->desiredRotation = RR_Rotate_0;
+	    crtc->desiredX = 0;
+	    crtc->desiredY = 0;
+	}
+
+	if (!xf86CrtcSetMode (crtc, &crtc->desiredMode, crtc->desiredRotation, crtc->desiredX, crtc->desiredY))
+	    return FALSE;
+
+    }
+#else
+    /* seems to do the wrong thing on some cards??? */
+    if (!xf86SetDesiredModes (pScrn))
+	return FALSE;
+#endif
+
+    RADEONSaveScreen(pScreen, SCREEN_SAVER_ON);
+
     /* Backing store setup */
     xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
 		   "Initializing backing store\n");
@@ -3623,6 +3653,9 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
     info->CreateScreenResources = pScreen->CreateScreenResources;
     pScreen->CreateScreenResources = RADEONCreateScreenResources;
 
+   if (!xf86CrtcScreenInit (pScreen))
+       return FALSE;
+
     /* Wrap pointer motion to flip touch screen around */
     info->PointerMoved = pScrn->PointerMoved;
     pScrn->PointerMoved = RADEONPointerMoved;
@@ -3639,16 +3672,6 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
 #endif
 			     | CMAP_RELOAD_ON_MODE_SWITCH)) return FALSE;
 
-#if 1
-    /* xf86CrtcRotate() accesses pScrn->pScreen */
-    pScrn->pScreen = pScreen;
-
-   if (!xf86CrtcScreenInit (pScreen))
-       return FALSE;
-   if (!xf86SetDesiredModes (pScrn))
-       return FALSE;
-#endif
-
     /* Note unused options */
     if (serverGeneration == 1)
 	xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);

commit a0de9c0844f9e066e0f02e8cd8045bdd278e6494
Author: Alex Deucher <alex@t41p.hsd1.va.comcast.net>
Date:   Fri Jan 4 19:48:30 2008 -0500

    RADEON: improve ntsc image centering

diff --git a/src/radeon_tv.c b/src/radeon_tv.c
index ab95a30..51f21d0 100644
--- a/src/radeon_tv.c
+++ b/src/radeon_tv.c
@@ -619,6 +619,8 @@ static Bool RADEONInitTVRestarts(xf86OutputPtr output, RADEONSavePtr save,
     if (radeon_output->tvStd == TV_STD_NTSC ||
 	radeon_output->tvStd == TV_STD_NTSC_J ||
 	radeon_output->tvStd == TV_STD_PAL_M) {
+	/* improve image centering */
+	hOffset -= 50;
 	p1 = hor_timing_NTSC[ H_TABLE_POS1 ];
 	p2 = hor_timing_NTSC[ H_TABLE_POS2 ];
     } else {

commit 03d2f25801c8a8ec15030f06008df112d07c1a2d
Author: Alex Deucher <alex@t41p.hsd1.va.comcast.net>
Date:   Fri Jan 4 18:19:54 2008 -0500

    RADEON: fix compile

diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c
index 8b31a33..bff164d 100644
--- a/src/radeon_atombios.c
+++ b/src/radeon_atombios.c
@@ -1725,7 +1725,6 @@ RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn)
 	else
 	    info->BiosConnector[i].ddc_line =
 	        RADEONLookupGPIOLineForDDC(pScrn, ci.sucI2cId.sbfAccess.bfI2C_LineMux);
-	}
 
 	if (i == ATOM_DEVICE_DFP1_INDEX)
 	    info->BiosConnector[i].TMDSType = TMDS_INT;

commit 308848783ed9ae27aed7c7de6ee813d375ef495e
Author: Dave Airlie <airlied@linux.ie>
Date:   Sat Jan 5 09:11:55 2008 +1000

    i2c: a line mux of 0 is valid

diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c
index 73a185b..8b31a33 100644
--- a/src/radeon_atombios.c
+++ b/src/radeon_atombios.c
@@ -1717,17 +1717,14 @@ RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn)
 	info->BiosConnector[i].ConnectorType = ci.sucConnectorInfo.sbfAccess.bfConnectorType;
 	info->BiosConnector[i].DACType = ci.sucConnectorInfo.sbfAccess.bfAssociatedDAC - 1;
 
-	if (ci.sucI2cId.sbfAccess.bfI2C_LineMux) {
-	    /* don't assign a gpio for tv */
-	    if ((i == ATOM_DEVICE_TV1_INDEX) ||
-		(i == ATOM_DEVICE_TV2_INDEX) ||
-		(i == ATOM_DEVICE_CV_INDEX))
-		info->BiosConnector[i].ddc_line = 0;
-	    else
-		info->BiosConnector[i].ddc_line =
-		    RADEONLookupGPIOLineForDDC(pScrn, ci.sucI2cId.sbfAccess.bfI2C_LineMux);
-	} else {
-	    info->BiosConnector[i].ddc_line = 0;
+	/* don't assign a gpio for tv */
+	if ((i == ATOM_DEVICE_TV1_INDEX) ||
+	    (i == ATOM_DEVICE_TV2_INDEX) ||
+            (i == ATOM_DEVICE_CV_INDEX))
+            info->BiosConnector[i].ddc_line = 0;
+	else
+	    info->BiosConnector[i].ddc_line =
+	        RADEONLookupGPIOLineForDDC(pScrn, ci.sucI2cId.sbfAccess.bfI2C_LineMux);
 	}
 
 	if (i == ATOM_DEVICE_DFP1_INDEX)

commit 94d5a432f72801f821d1c4ce952baba17552659d
Author: Dave Airlie <airlied@linux.ie>
Date:   Fri Jan 4 17:16:54 2008 +1000

    atombios: i2c lines are all done with sw so we can accept any of them.
    
    hch reported this working on his laptop with 0x7e60 as EDID for LVDS

diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c
index 7cf0556..73a185b 100644
--- a/src/radeon_atombios.c
+++ b/src/radeon_atombios.c
@@ -1717,7 +1717,7 @@ RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn)
 	info->BiosConnector[i].ConnectorType = ci.sucConnectorInfo.sbfAccess.bfConnectorType;
 	info->BiosConnector[i].DACType = ci.sucConnectorInfo.sbfAccess.bfAssociatedDAC - 1;
 
-	if (ci.sucI2cId.sbfAccess.bfHW_Capable) {
+	if (ci.sucI2cId.sbfAccess.bfI2C_LineMux) {
 	    /* don't assign a gpio for tv */
 	    if ((i == ATOM_DEVICE_TV1_INDEX) ||
 		(i == ATOM_DEVICE_TV2_INDEX) ||
@@ -1726,11 +1726,6 @@ RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn)
 	    else
 		info->BiosConnector[i].ddc_line =
 		    RADEONLookupGPIOLineForDDC(pScrn, ci.sucI2cId.sbfAccess.bfI2C_LineMux);
-	} else if (ci.sucI2cId.sbfAccess.bfI2C_LineMux) {
-	    /* add support for GPIO line */
-	    ErrorF("Unsupported SW GPIO - device %d: gpio line: 0x%x\n",
-		   i, (unsigned int)RADEONLookupGPIOLineForDDC(pScrn, ci.sucI2cId.sbfAccess.bfI2C_LineMux));
-	    info->BiosConnector[i].ddc_line = 0;
 	} else {
 	    info->BiosConnector[i].ddc_line = 0;
 	}

commit 2e4473b63d65801ae8ac5a8391de232b2201d958
Author: Alex Deucher <alex@samba.(none)>
Date:   Thu Jan 3 15:47:50 2008 -0500

    RADEON: fix crash when setting rotation in the config file
    
    xf86CrtcRotate() accesses pScrn->pScreen which is not set
    during ScreenInit().  This should also be fixed in the server.
    See bug 12129

diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c
index 207a5a6..585b452 100644
--- a/src/radeon_crtc.c
+++ b/src/radeon_crtc.c
@@ -361,7 +361,8 @@ static void *
 radeon_crtc_shadow_allocate (xf86CrtcPtr crtc, int width, int height)
 {
     ScrnInfoPtr pScrn = crtc->scrn;
-    ScreenPtr pScreen = pScrn->pScreen;
+    /* if this is called during ScreenInit() we don't have pScrn->pScreen yet */
+    ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
     RADEONInfoPtr  info = RADEONPTR(pScrn);
     RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
     unsigned long rotate_pitch;
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index d68b18f..1f12e87 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -3181,9 +3181,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
 {
     ScrnInfoPtr    pScrn = xf86Screens[pScreen->myNum];
     RADEONInfoPtr  info  = RADEONPTR(pScrn);
-    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
     int            hasDRI = 0;
-    int i;
 #ifdef RENDER
     int            subPixelOrder = SubPixelUnknown;
     char*          s;
@@ -3483,27 +3481,6 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
 
     pScrn->vtSema = TRUE;
 
-    for (i = 0; i < xf86_config->num_crtc; i++) {
-	xf86CrtcPtr	crtc = xf86_config->crtc[i];
-	    
-	/* Mark that we'll need to re-set the mode for sure */
-	memset(&crtc->mode, 0, sizeof(crtc->mode));
-	if (!crtc->desiredMode.CrtcHDisplay) {
-	    crtc->desiredMode = *RADEONCrtcFindClosestMode (crtc, pScrn->currentMode);
-	    crtc->desiredRotation = RR_Rotate_0;
-	    crtc->desiredX = 0;
-	    crtc->desiredY = 0;
-	}
-
-	if (!xf86CrtcSetMode (crtc, &crtc->desiredMode, crtc->desiredRotation, crtc->desiredX, crtc->desiredY))
-	    return FALSE;
-
-    }
-
-    RADEONSaveScreen(pScreen, SCREEN_SAVER_ON);
-
-    //    pScrn->AdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
-
     /* Backing store setup */
     xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
 		   "Initializing backing store\n");
@@ -3646,9 +3623,6 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
     info->CreateScreenResources = pScreen->CreateScreenResources;
     pScreen->CreateScreenResources = RADEONCreateScreenResources;
 
-   if (!xf86CrtcScreenInit (pScreen))
-       return FALSE;
-
     /* Wrap pointer motion to flip touch screen around */
     info->PointerMoved = pScrn->PointerMoved;
     pScrn->PointerMoved = RADEONPointerMoved;
@@ -3665,6 +3639,16 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
 #endif
 			     | CMAP_RELOAD_ON_MODE_SWITCH)) return FALSE;
 
+#if 1
+    /* xf86CrtcRotate() accesses pScrn->pScreen */
+    pScrn->pScreen = pScreen;
+
+   if (!xf86CrtcScreenInit (pScreen))
+       return FALSE;
+   if (!xf86SetDesiredModes (pScrn))
+       return FALSE;
+#endif
+
     /* Note unused options */
     if (serverGeneration == 1)
 	xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);

commit c652208861bffca94f06b7f67688ce220e050bfb
Author: Michel Dänzer <michel@tungstengraphics.com>
Date:   Thu Jan 3 17:54:58 2008 +0100

    radeon: Adapt manpage to reality wrt AGP options.

diff --git a/man/radeon.man b/man/radeon.man
index 141342e..b8f4f93 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -154,26 +154,28 @@ The default value is either 1536 (for most chips) or 1920.
 Set AGP data transfer rate.
 (used only when DRI is enabled)
 .br
-1      \-\- 1x (before AGPv3 only)
+1      \-\- 1x (before AGP v3 only)
 .br
-2      \-\- 2x (before AGPv3 only)
+2      \-\- 2x (before AGP v3 only)
 .br
 4      \-\- 4x
 .br
-8      \-\- 8x (AGPv3 only)
+8      \-\- 8x (AGP v3 only)
 .br
 others \-\- invalid
 .br
 The default is to
-.B leave it unchanged.
+.B leave it unchanged for AGP v3
+and
+.B 1x otherwise.
 .TP
 .BI "Option \*qAGPFastWrite\*q \*q" boolean \*q
 Enable AGP fast writes.  Enabling this is frequently the cause of
 instability. Used only when the DRI is enabled. If you enable
 this option you will get *NO* support from developers.
 .br
-The default is to
-.B leave it unchanged.
+The default is
+.B off.
 .TP
 .BI "Option \*qBusType\*q \*q" string \*q
 Used to replace previous ForcePCIMode option.

commit ab451e4b7a5423d61b57cf0646599267d8504af4
Author: Michel Dänzer <michel@tungstengraphics.com>
Date:   Thu Jan 3 17:52:39 2008 +0100

    radeon: Miscellaneous warning fixes.

diff --git a/src/AtomBios/Decoder.c b/src/AtomBios/Decoder.c
index 95908d5..cdaa9ef 100644
--- a/src/AtomBios/Decoder.c
+++ b/src/AtomBios/Decoder.c
@@ -46,7 +46,7 @@ Revision History:
 
 
 
-#define INDIRECT_IO_TABLE (((UINT16)&((ATOM_MASTER_LIST_OF_DATA_TABLES*)0)->IndirectIOAccess)/sizeof(TABLE_UNIT_TYPE) )
+#define INDIRECT_IO_TABLE (((UINT16)(ULONG_PTR)&((ATOM_MASTER_LIST_OF_DATA_TABLES*)0)->IndirectIOAccess)/sizeof(TABLE_UNIT_TYPE) )
 extern COMMANDS_PROPERTIES CallTable[];
 
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 7b25e4b..5e95dd7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -77,7 +77,7 @@ ATIMISC_EXA_SOURCES = atimach64exa.c
 RADEON_EXA_SOURCES = radeon_exa.c
 endif
 
-AM_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ @XMODES_CFLAGS@ -DDISABLE_EASF -DENABLE_ALL_SERVICE_FUNCTIONS -DATOM_BIOS -DATOM_BIOS_PARSER
+AM_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ @XMODES_CFLAGS@ -DDISABLE_EASF -DENABLE_ALL_SERVICE_FUNCTIONS -DATOM_BIOS -DATOM_BIOS_PARSER -DFGL_LINUX -DDRIVER_PARSER
 INCLUDES = -I$(srcdir)/AtomBios/includes
 
 ati_drv_la_LTLIBRARIES = ati_drv.la
diff --git a/src/atombios_output.c b/src/atombios_output.c
index 8098185..5ec3098 100644
--- a/src/atombios_output.c
+++ b/src/atombios_output.c
@@ -316,6 +316,8 @@ atombios_output_lvds_setup(xf86OutputPtr output, DisplayModePtr mode)
     return ATOM_NOT_IMPLEMENTED;
 }
 
+#if 0
+
 static int
 atombios_output_scaler_setup(xf86OutputPtr output, DisplayModePtr mode)
 {
@@ -354,6 +356,8 @@ atombios_output_scaler_setup(xf86OutputPtr output, DisplayModePtr mode)
 
 }
 
+#endif
+
 static AtomBiosResult
 atombios_display_device_control(atomBiosHandlePtr atomBIOS, int device, Bool state)
 {
diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c
index b352a56..7cf0556 100644
--- a/src/radeon_atombios.c
+++ b/src/radeon_atombios.c
@@ -36,9 +36,6 @@
 #include "radeon_macros.h"
 
 #include "xorg-server.h"
-#if XSERVER_LIBPCIACCESS
-#warning pciaccess defined
-#endif
 
 /* only for testing now */
 #include "xf86DDC.h"
@@ -190,6 +187,8 @@ enum {
 
 #   define LOG_CAIL LOG_DEBUG + 1
 
+#if 0
+
 static void
 RHDDebug(int scrnIndex, const char *format, ...)
 {
@@ -210,6 +209,8 @@ RHDDebugCont(const char *format, ...)
     va_end(ap);
 }
 
+#endif
+
 static void
 CailDebug(int scrnIndex, const char *format, ...)
 {
@@ -1644,7 +1645,7 @@ RADEONGetATOMTVInfo(xf86OutputPtr output)
 }
 
 Bool
-RADEONATOMGetTVTimings(ScrnInfoPtr pScrn, int index, SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION *crtc_timing, uint32_t *pixel_clock)
+RADEONATOMGetTVTimings(ScrnInfoPtr pScrn, int index, SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION *crtc_timing, int32_t *pixel_clock)
 {
     RADEONInfoPtr  info       = RADEONPTR(pScrn);
     ATOM_ANALOG_TV_INFO *tv_info;
diff --git a/src/radeon_atombios.h b/src/radeon_atombios.h
index 4b15ec1..9cb279e 100644
--- a/src/radeon_atombios.h
+++ b/src/radeon_atombios.h
@@ -248,6 +248,6 @@ typedef struct _atomBiosHandle {
 # endif
 
 extern Bool
-RADEONATOMGetTVTimings(ScrnInfoPtr pScrn, int index, SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION *crtc_timing, uint32_t *pixel_clock);
+RADEONATOMGetTVTimings(ScrnInfoPtr pScrn, int index, SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION *crtc_timing, int32_t *pixel_clock);
 
 #endif /*  RHD_ATOMBIOS_H_ */
diff --git a/src/radeon_output.c b/src/radeon_output.c
index ec4f3dc..c1a0ba8 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -2254,23 +2254,28 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn)
     optstr = (char *)xf86GetOptValString(info->Options, OPTION_CONNECTORTABLE);
 
     if (optstr) {
+	unsigned int ddc_line[2];
+
 	for (i = 2; i < RADEON_MAX_BIOS_CONNECTOR; i++) {
 	    info->BiosConnector[i].valid = FALSE;
 	}
 	info->BiosConnector[0].valid = TRUE;
 	info->BiosConnector[1].valid = TRUE;
 	if (sscanf(optstr, "%u,%d,%d,%u,%u,%d,%d,%u",
-		   (unsigned int *)&info->BiosConnector[0].ddc_line,
+		   &ddc_line[0],
 		   &info->BiosConnector[0].DACType,
 		   &info->BiosConnector[0].TMDSType,
 		   &info->BiosConnector[0].ConnectorType,
-		   (unsigned int *)&info->BiosConnector[1].ddc_line,
+		   &ddc_line[1],
 		   &info->BiosConnector[1].DACType,
 		   &info->BiosConnector[1].TMDSType,
 		   &info->BiosConnector[1].ConnectorType) != 8) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Invalid ConnectorTable option: %s\n", optstr);
 	    return FALSE;
 	}
+
+	info->BiosConnector[0].ddc_line = ddc_line[0];
+	info->BiosConnector[1].ddc_line = ddc_line[1];
     }
 
     info->tvdac_use_count = 0;

commit 394c52273328e90518568b694ee79dc1a8dab651
Author: Dave Airlie <airlied@linux.ie>
Date:   Thu Jan 3 18:56:16 2008 +1000

    r500: tvout avoid doing dpms here it makes my tv mode go all crappy
    
    need to investigate further

diff --git a/src/atombios_output.c b/src/atombios_output.c
index 83b5d92..8098185 100644
--- a/src/atombios_output.c
+++ b/src/atombios_output.c
@@ -473,12 +473,11 @@ atombios_output_dpms(xf86OutputPtr output, int mode)
        ErrorF("AGD: cv dpms\n");
        if (radeon_output->devices & ATOM_DEVICE_CV_SUPPORT)


Reply to: