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

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



 ChangeLog             |   71 +
 configure             |    3 
 configure.ac          |    3 
 debian/changelog      |    9 
 man/radeon.man        |    6 
 src/Makefile.am       |    3 
 src/Makefile.in       |   21 
 src/atombios_crtc.c   |    8 
 src/legacy_crtc.c     | 1847 ++++++++++++++++++++++++++++++++++++++++++++++++++
 src/legacy_output.c   | 1732 ++++++++++++++++++++++++++++++++++++++++++++++
 src/radeon.h          |   41 -
 src/radeon_accel.c    |  337 +++++++++
 src/radeon_atombios.c |    4 
 src/radeon_atombios.h |   11 
 src/radeon_bios.c     |    5 
 src/radeon_crtc.c     |  930 +------------------------
 src/radeon_display.c  |  878 -----------------------
 src/radeon_driver.c   | 1524 +----------------------------------------
 src/radeon_output.c   | 1275 +---------------------------------
 src/radeon_tv.c       |  395 ++++++++++
 20 files changed, 4623 insertions(+), 4480 deletions(-)

New commits:
commit 081a1bb2c726d30fe7366bce798a381cc5eaabf0
Author: Brice Goglin <bgoglin@debian.org>
Date:   Sun Dec 23 23:29:58 2007 +0100

    New upstream snapshot

diff --git a/ChangeLog b/ChangeLog
index dcbfa80..c20bcdd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,74 @@
+commit ad3325f672a241449ca239c8ee3a24b6d7703d76
+Author: Alex Deucher <alex@botch2.(none)>
+Date:   Sun Dec 23 17:18:42 2007 -0500
+
+    RADEON: Add "IgnoreLidStatus" option
+    
+    Generally, users that start X with the laptop lid closed
+    want to use one or more external monitors rather than the
+    internal panel and do not want the internal panel to be on
+    by default.  Others, it seems, want to always have the
+    internal panel on, regardless of the lid.  I can't win.
+    Enable this option to force the latter.
+
+commit 20eedf348a527e1e0a5450bc22d7564895034a66
+Author: Alex Deucher <alex@botch2.(none)>
+Date:   Sun Dec 23 11:27:55 2007 -0500
+
+    RADEON: fix pll input setup on mac cards
+    
+    the function was exiting before the complete setup was finished.
+
+commit 4f2e833e8ebaba3ad85ec5314fff8fa05395b679
+Author: Arkadiusz Miskiewicz <arekm@maven.pl>
+Date:   Fri Dec 21 18:56:34 2007 -0500
+
+    configure.ac fixes
+
+commit 2b6e8e2b8f74e94560de89693ecbc7260536591e
+Author: Arkadiusz Miskiewicz <arekm@maven.pl>
+Date:   Fri Dec 21 18:10:17 2007 -0500
+
+    RADEON: various cleanups
+
+commit 4c6f60e3b19ac55ab1255c79df03b1df5950864e
+Author: Alex Deucher <alex@botch2.(none)>
+Date:   Fri Dec 21 17:33:04 2007 -0500
+
+    RADEON: clean up prototypes
+
+commit 8c761afdcb9baf1649b93449692fb9ab67bc2c80
+Author: Alex Deucher <alex@botch2.(none)>
+Date:   Fri Dec 21 16:24:49 2007 -0500
+
+    RADEON: more re-org
+    
+    move save/restore routines into legacy_crtc/output
+
+commit 910773d3a6c717f9d4762ea7b9ee6c3ae061781e
+Author: Alex Deucher <alex@botch2.(none)>
+Date:   Fri Dec 21 15:53:15 2007 -0500
+
+    RADEON: more re-org.  move XAA Mem init to radeon_accel.c
+
+commit 0631a23bd103f9b74e525da2c41304eab60c6f17
+Author: Alex Deucher <alex@botch2.(none)>
+Date:   Fri Dec 21 15:40:18 2007 -0500
+
+    RADEON: fix rn50 reversion from last merge
+
+commit 5b917797a13c6caa80028d1842a284598e874288
+Author: Alex Deucher <alex@botch2.(none)>
+Date:   Fri Dec 21 15:30:20 2007 -0500
+
+    RADEON: remove no longer used radeon_display.c
+
+commit bf14aa5f88fc3b4e69d71db5b23248b8bb2018d0
+Author: Alex Deucher <alex@botch2.(none)>
+Date:   Fri Dec 21 15:29:47 2007 -0500
+
+    RADEON: re-org legacy crtc/output code into separate files
+
 commit be7f8fd338f5af8b632f16a83db41e15d00af469
 Author: Dave Airlie <airlied@linux.ie>
 Date:   Fri Dec 21 10:03:49 2007 +1000
diff --git a/configure b/configure
index 7913183..a017758 100755
--- a/configure
+++ b/configure
@@ -20265,7 +20265,7 @@ fi
 
 
 if test "x$GCC" = "xyes"; then
-	CFLAGS="$CFLAGS -Wall"
+	CPPFLAGS="$CPPFLAGS -Wall"
 fi
 
 
@@ -21323,6 +21323,7 @@ _ACEOF
 	fi
 fi
 
+save_CFLAGS="$CFLAGS"
 CFLAGS="$XORG_CFLAGS"
 { echo "$as_me:$LINENO: checking for xf86Modes.h" >&5
 echo $ECHO_N "checking for xf86Modes.h... $ECHO_C" >&6; }
diff --git a/debian/changelog b/debian/changelog
index 173397a..4edc6d5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+xserver-xorg-video-ati (1:6.7.198~git20071223.ad3325f6-1) experimental; urgency=low
+
+  * New upstream snapshot, containing commits up to ad3325f6.
+    + Add IgnoreLidStatus option to enable lid even when closed,
+      closes: #457612, #457516.
+    + Fix PLL input setup on mac cards, closes: #457563.
+
+ -- Brice Goglin <bgoglin@debian.org>  Sun, 23 Dec 2007 23:24:43 +0100
+
 xserver-xorg-video-ati (1:6.7.198~git20071221.be7f8fd3-1) experimental; urgency=low
 
   * New upstream snapshot, containing commits up to be7f8fd3.
diff --git a/src/Makefile.in b/src/Makefile.in
index faffc73..421abf8 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -149,10 +149,10 @@ radeon_drv_la_LIBADD =
 am__radeon_drv_la_SOURCES_DIST = radeon_accel.c radeon_cursor.c \
 	radeon_dga.c radeon_driver.c radeon_video.c radeon_bios.c \
 	radeon_mm_i2c.c radeon_vip.c radeon_misc.c radeon_probe.c \
-	radeon_display.c radeon_crtc.c radeon_output.c radeon_modes.c \
-	radeon_tv.c AtomBios/CD_Operations.c AtomBios/Decoder.c \
-	AtomBios/hwserv_drv.c AtomBios/includes/atombios.h \
-	AtomBios/includes/CD_binding.h \
+	legacy_crtc.c legacy_output.c radeon_crtc.c radeon_output.c \
+	radeon_modes.c radeon_tv.c AtomBios/CD_Operations.c \
+	AtomBios/Decoder.c AtomBios/hwserv_drv.c \
+	AtomBios/includes/atombios.h AtomBios/includes/CD_binding.h \
 	AtomBios/includes/CD_Common_Types.h \
 	AtomBios/includes/CD_Definitions.h \
 	AtomBios/includes/CD_hw_services.h \
@@ -175,8 +175,8 @@ am__objects_9 = xf86Modes.lo xf86cvt.lo xf86Crtc.lo xf86Cursors.lo \
 am_radeon_drv_la_OBJECTS = radeon_accel.lo radeon_cursor.lo \
 	radeon_dga.lo radeon_driver.lo radeon_video.lo radeon_bios.lo \
 	radeon_mm_i2c.lo radeon_vip.lo radeon_misc.lo radeon_probe.lo \
-	radeon_display.lo radeon_crtc.lo radeon_output.lo \
-	radeon_modes.lo radeon_tv.lo $(am__objects_6) \
+	legacy_crtc.lo legacy_output.lo radeon_crtc.lo \
+	radeon_output.lo radeon_modes.lo radeon_tv.lo $(am__objects_6) \
 	radeon_atombios.lo radeon_atomwrapper.lo $(am__objects_7) \
 	$(am__objects_8) atombios_output.lo atombios_crtc.lo \
 	$(am__objects_10)
@@ -440,9 +440,9 @@ radeon_drv_la_LDFLAGS = -module -avoid-version
 radeon_drv_ladir = @moduledir@/drivers
 radeon_drv_la_SOURCES = radeon_accel.c radeon_cursor.c radeon_dga.c \
 	radeon_driver.c radeon_video.c radeon_bios.c radeon_mm_i2c.c \
-	radeon_vip.c radeon_misc.c radeon_probe.c radeon_display.c \
-	radeon_crtc.c radeon_output.c radeon_modes.c radeon_tv.c \
-	$(RADEON_ATOMBIOS_SOURCES) radeon_atombios.c \
+	radeon_vip.c radeon_misc.c radeon_probe.c legacy_crtc.c \
+	legacy_output.c radeon_crtc.c radeon_output.c radeon_modes.c \
+	radeon_tv.c $(RADEON_ATOMBIOS_SOURCES) radeon_atombios.c \
 	radeon_atomwrapper.c $(RADEON_DRI_SRCS) $(RADEON_EXA_SOURCES) \
 	atombios_output.c atombios_crtc.c $(am__append_1)
 theatre_detect_drv_la_LTLIBRARIES = theatre_detect_drv.la
@@ -850,6 +850,8 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atombios_crtc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atombios_output.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hwserv_drv.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/legacy_crtc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/legacy_output.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r128_accel.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r128_cursor.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r128_dga.Plo@am__quote@
@@ -865,7 +867,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/radeon_crtc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/radeon_cursor.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/radeon_dga.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/radeon_display.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/radeon_dri.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/radeon_driver.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/radeon_exa.Plo@am__quote@

commit ad3325f672a241449ca239c8ee3a24b6d7703d76
Author: Alex Deucher <alex@botch2.(none)>
Date:   Sun Dec 23 17:18:42 2007 -0500

    RADEON: Add "IgnoreLidStatus" option
    
    Generally, users that start X with the laptop lid closed
    want to use one or more external monitors rather than the
    internal panel and do not want the internal panel to be on
    by default.  Others, it seems, want to always have the
    internal panel on, regardless of the lid.  I can't win.
    Enable this option to force the latter.

diff --git a/man/radeon.man b/man/radeon.man
index 3c4df23..49755f4 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -467,6 +467,12 @@ Enable this option to force TV Out to always be detected as attached.
 The default is
 .B off 
 .TP
+.BI "Option \*qIgnoreLidStatus\*q \*q" boolean \*q
+Enable this option to ignore lid status on laptops and always detect
+LVDS as attached.
+The default is
+.B off 
+.TP
 
 .SH SEE ALSO
 __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
diff --git a/src/radeon.h b/src/radeon.h
index 4a10860..d16a234 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -166,7 +166,8 @@ typedef enum {
     OPTION_DEFAULT_TMDS_PLL,
     OPTION_TVDAC_LOAD_DETECT,
     OPTION_FORCE_TVOUT,
-    OPTION_TVSTD
+    OPTION_TVSTD,
+    OPTION_IGNORE_LID_STATUS
 } RADEONOpts;
 
 
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 4e4f23e..6885cdc 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -219,6 +219,7 @@ static const OptionInfoRec RADEONOptions[] = {
     { OPTION_TVDAC_LOAD_DETECT, "TVDACLoadDetect", OPTV_BOOLEAN, {0}, FALSE },
     { OPTION_FORCE_TVOUT,    "ForceTVOut",         OPTV_BOOLEAN, {0}, FALSE },
     { OPTION_TVSTD,          "TVStandard",         OPTV_STRING,  {0}, FALSE },
+    { OPTION_IGNORE_LID_STATUS, "IgnoreLidStatus", OPTV_BOOLEAN, {0}, FALSE },
     { -1,                    NULL,               OPTV_NONE,    {0}, FALSE }
 };
 
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 10369d9..814c766 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -437,14 +437,18 @@ RADEONDetectLidStatus(ScrnInfoPtr pScrn)
 
 static RADEONMonitorType RADEONPortCheckNonDDC(ScrnInfoPtr pScrn, xf86OutputPtr output)
 {
+    RADEONInfoPtr info = RADEONPTR(output->scrn);
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
     RADEONMonitorType MonType = MT_NONE;
 
     if (radeon_output->type == OUTPUT_LVDS) {
+	if (xf86ReturnOptValBool(info->Options, OPTION_IGNORE_LID_STATUS, FALSE))
+	    MonType = MT_LCD;
+	else
 #if defined(__powerpc__)
-	MonType = MT_LCD;
+	    MonType = MT_LCD;
 #else
-	MonType = RADEONDetectLidStatus(pScrn);
+	    MonType = RADEONDetectLidStatus(pScrn);
 #endif
     } /*else if (radeon_output->type == OUTPUT_DVI) {
 	if (radeon_output->TMDSType == TMDS_INT) {

commit 20eedf348a527e1e0a5450bc22d7564895034a66
Author: Alex Deucher <alex@botch2.(none)>
Date:   Sun Dec 23 11:27:55 2007 -0500

    RADEON: fix pll input setup on mac cards
    
    the function was exiting before the complete setup was finished.

diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 9c6c0e4..4e4f23e 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -1231,19 +1231,18 @@ static void RADEONGetClockInfo(ScrnInfoPtr pScrn)
 	   pll->pll_out_max = 35000;
        }
 
-       if (RADEONProbePLLParameters(pScrn))
-	   return;
+       if (!RADEONProbePLLParameters(pScrn)) {
+	   if (info->IsIGP)
+	       pll->reference_freq = 1432;
+	   else
+	       pll->reference_freq = 2700;
 
-	if (info->IsIGP)
-	    pll->reference_freq = 1432;
-	else
-	    pll->reference_freq = 2700;
+	   pll->reference_div = 12;
+	   pll->xclk = 10300;
 
-	pll->reference_div = 12;
-	pll->xclk = 10300;
-
-        info->sclk = 200.00;
-        info->mclk = 200.00;
+	   info->sclk = 200.00;
+	   info->mclk = 200.00;
+       }
     }
 
     /* card limits for computing PLLs */

commit 4f2e833e8ebaba3ad85ec5314fff8fa05395b679
Author: Arkadiusz Miskiewicz <arekm@maven.pl>
Date:   Fri Dec 21 18:56:34 2007 -0500

    configure.ac fixes

diff --git a/configure.ac b/configure.ac
index edac3ed..409796d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,7 +40,7 @@ AC_PROG_LIBTOOL
 AC_PROG_CC
 
 if test "x$GCC" = "xyes"; then
-	CFLAGS="$CFLAGS -Wall"
+	CPPFLAGS="$CPPFLAGS -Wall"
 fi
 
 AH_TOP([#include "xorg-server.h"])
@@ -117,6 +117,7 @@ if test "$DRI" = yes; then
 	fi
 fi
 
+save_CFLAGS="$CFLAGS"
 CFLAGS="$XORG_CFLAGS"
 AC_CHECK_HEADER(xf86Modes.h,[XMODES=yes],[XMODES=no],[#include "xorg-server.h"])
 CFLAGS="$save_CFLAGS"

commit 2b6e8e2b8f74e94560de89693ecbc7260536591e
Author: Arkadiusz Miskiewicz <arekm@maven.pl>
Date:   Fri Dec 21 18:10:17 2007 -0500

    RADEON: various cleanups

diff --git a/src/atombios_crtc.c b/src/atombios_crtc.c
index e7ad4a9..ebfadd6 100644
--- a/src/atombios_crtc.c
+++ b/src/atombios_crtc.c
@@ -99,6 +99,7 @@ atombios_blank_crtc(atomBiosHandlePtr atomBIOS, int crtc, int state)
     return ATOM_NOT_IMPLEMENTED;
 }
 
+#if 0
 static void
 atombios_crtc_enable(xf86CrtcPtr crtc, int enable)
 {
@@ -109,6 +110,7 @@ atombios_crtc_enable(xf86CrtcPtr crtc, int enable)
     
     //TODOavivo_wait_idle(avivo);
 }
+#endif
 
 void
 atombios_crtc_dpms(xf86CrtcPtr crtc, int mode)
@@ -185,11 +187,11 @@ atombios_crtc_set_pll(xf86CrtcPtr crtc, DisplayModePtr mode)
     }
 
     xf86DrvMsg(crtc->scrn->scrnIndex, X_INFO,
-	       "crtc(%d) Clock: mode %d, PLL %u\n",
-	       radeon_crtc->crtc_id, mode->Clock, sclock * 10);
+	       "crtc(%d) Clock: mode %d, PLL %lu\n",
+	       radeon_crtc->crtc_id, mode->Clock, (long unsigned int)sclock * 10);
     xf86DrvMsg(crtc->scrn->scrnIndex, X_INFO,
 	       "crtc(%d) PLL  : refdiv %u, fbdiv 0x%X(%u), pdiv %u\n",
-	       radeon_crtc->crtc_id, ref_div, fb_div, fb_div, post_div);
+	       radeon_crtc->crtc_id, (unsigned int)ref_div, (unsigned int)fb_div, (unsigned int)fb_div, (unsigned int)post_div);
 
     atombios_get_command_table_version(info->atomBIOS, index, &major, &minor);
 
diff --git a/src/legacy_output.c b/src/legacy_output.c
index 9caebdd..694e7c7 100644
--- a/src/legacy_output.c
+++ b/src/legacy_output.c
@@ -847,9 +847,6 @@ RADEONEnableDisplay(xf86OutputPtr output, BOOL bEnable)
 void
 legacy_output_dpms(xf86OutputPtr output, int mode)
 {
-    ScrnInfoPtr pScrn  = output->scrn;
-    RADEONInfoPtr info = RADEONPTR(pScrn);
-
     switch(mode) {
     case DPMSModeOn:
 	RADEONEnableDisplay(output, TRUE);
diff --git a/src/radeon.h b/src/radeon.h
index c376cdb..4a10860 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -880,6 +880,8 @@ extern void
 radeon_crtc_set_cursor_colors (xf86CrtcPtr crtc, int bg, int fg);
 extern void
 radeon_crtc_load_cursor_argb (xf86CrtcPtr crtc, CARD32 *image);
+extern void
+radeon_crtc_load_lut(xf86CrtcPtr crtc);
 
 extern void RADEONAdjustCrtcRegistersForTV(ScrnInfoPtr pScrn, RADEONSavePtr save,
 					   DisplayModePtr mode, xf86OutputPtr output);
@@ -894,6 +896,10 @@ extern void RADEONInitTVRegisters(xf86OutputPtr output, RADEONSavePtr save,
 
 extern void RADEONRestoreTVRegisters(ScrnInfoPtr pScrn, RADEONSavePtr restore);
 
+extern void RADEONComputePLL(RADEONPLLPtr pll, unsigned long freq, CARD32 *chosen_dot_clock_freq,
+		CARD32 *chosen_feedback_div, CARD32 *chosen_reference_div,
+		CARD32 *chosen_post_div, int flags);
+
 #ifdef XF86DRI
 #ifdef USE_XAA
 extern void        RADEONAccelInitCP(ScreenPtr pScreen, XAAInfoRecPtr a);
diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c
index a04598d..ae32753 100644
--- a/src/radeon_atombios.c
+++ b/src/radeon_atombios.c
@@ -1512,7 +1512,7 @@ RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn)
 	} else if (ci.sucI2cId.sbfAccess.bfI2C_LineMux) {
 	    /* add support for GPIO line */
 	    ErrorF("Unsupported SW GPIO - device %d: gpio line: 0x%x\n",
-		   i, RADEONLookupGPIOLineForDDC(pScrn, ci.sucI2cId.sbfAccess.bfI2C_LineMux));
+		   i, (unsigned int)RADEONLookupGPIOLineForDDC(pScrn, ci.sucI2cId.sbfAccess.bfI2C_LineMux));
 	    info->BiosConnector[i].ddc_line = 0;
 	} else {
 	    info->BiosConnector[i].ddc_line = 0;
@@ -1591,7 +1591,7 @@ RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn)
     for (i = 0; i < ATOM_MAX_SUPPORTED_DEVICE; i++) {
 	if (info->BiosConnector[i].valid) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Port%d: DDCType-0x%x, DACType-%d, TMDSType-%d, ConnectorType-%d, hpd_mask-0x%x\n",
-		       i, info->BiosConnector[i].ddc_line, info->BiosConnector[i].DACType,
+		       i, (unsigned int)info->BiosConnector[i].ddc_line, info->BiosConnector[i].DACType,
 		       info->BiosConnector[i].TMDSType, info->BiosConnector[i].ConnectorType,
 		       info->BiosConnector[i].hpd_mask);
 	}
diff --git a/src/radeon_atombios.h b/src/radeon_atombios.h
index 33925a5..bfac93e 100644
--- a/src/radeon_atombios.h
+++ b/src/radeon_atombios.h
@@ -110,6 +110,17 @@ extern AtomBiosResult
 RHDAtomBiosFunc(int scrnIndex, atomBiosHandlePtr handle,
 		AtomBiosRequestID id, AtomBiosArgPtr data);
 
+extern Bool
+RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn);
+extern Bool
+RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn);
+
+extern int
+atombios_external_tmds_setup(xf86OutputPtr output, DisplayModePtr mode);
+
+extern void
+atombios_get_command_table_version(atomBiosHandlePtr atomBIOS, int index, int *major, int *minor);
+
 # include "xf86int10.h"
 # ifdef ATOM_BIOS_PARSER
 #  define INT8 INT8
diff --git a/src/radeon_bios.c b/src/radeon_bios.c
index 1a4f99d..9253182 100644
--- a/src/radeon_bios.c
+++ b/src/radeon_bios.c
@@ -305,7 +305,7 @@ static Bool RADEONGetATOMConnectorInfoFromBIOS (ScrnInfoPtr pScrn)
     for (i = 0; i < RADEON_MAX_BIOS_CONNECTOR; i++) {
 	if (info->BiosConnector[i].valid) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Port%d: DDCType-0x%x, DACType-%d, TMDSType-%d, ConnectorType-%d\n",
-		       i, info->BiosConnector[i].ddc_line, info->BiosConnector[i].DACType,
+		       i, (unsigned int)info->BiosConnector[i].ddc_line, info->BiosConnector[i].DACType,
 		       info->BiosConnector[i].TMDSType, info->BiosConnector[i].ConnectorType);
 	}
     }
@@ -494,7 +494,7 @@ static Bool RADEONGetLegacyConnectorInfoFromBIOS (ScrnInfoPtr pScrn)
     for (i = 0; i < RADEON_MAX_BIOS_CONNECTOR; i++) {
 	if (info->BiosConnector[i].valid) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Port%d: DDCType-0x%x, DACType-%d, TMDSType-%d, ConnectorType-%d\n",
-		       i, info->BiosConnector[i].ddc_line, info->BiosConnector[i].DACType,
+		       i, (unsigned int)info->BiosConnector[i].ddc_line, info->BiosConnector[i].DACType,
 		       info->BiosConnector[i].TMDSType, info->BiosConnector[i].ConnectorType);
 	}
     }
diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c
index 9034cf5..2f9034a 100644
--- a/src/radeon_crtc.c
+++ b/src/radeon_crtc.c
@@ -86,9 +86,6 @@ radeon_crtc_mode_fixup(xf86CrtcPtr crtc, DisplayModePtr mode,
 static void
 radeon_crtc_mode_prepare(xf86CrtcPtr crtc)
 {
-    ScrnInfoPtr pScrn = crtc->scrn;
-    RADEONInfoPtr info = RADEONPTR(pScrn);
-
     radeon_crtc_dpms(crtc, DPMSModeOff);
 }
 
@@ -178,10 +175,10 @@ RADEONComputePLL(RADEONPLLPtr pll,
 	}
     }
 
-    ErrorF("best_freq: %u\n", best_freq);
-    ErrorF("best_feedback_div: %u\n", best_feedback_div);
-    ErrorF("best_ref_div: %u\n", best_ref_div);
-    ErrorF("best_post_div: %u\n", best_post_div);
+    ErrorF("best_freq: %u\n", (unsigned int)best_freq);
+    ErrorF("best_feedback_div: %u\n", (unsigned int)best_feedback_div);
+    ErrorF("best_ref_div: %u\n", (unsigned int)best_ref_div);
+    ErrorF("best_post_div: %u\n", (unsigned int)best_post_div);
 
     *chosen_dot_clock_freq = best_freq / 10000;
     *chosen_feedback_div = best_feedback_div;
@@ -207,9 +204,6 @@ radeon_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
 static void
 radeon_crtc_mode_commit(xf86CrtcPtr crtc)
 {
-    ScrnInfoPtr pScrn = crtc->scrn;
-    RADEONInfoPtr info = RADEONPTR(pScrn);
-
     radeon_crtc_dpms(crtc, DPMSModeOn);
 }
 
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index b9a05f3..9c6c0e4 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -144,6 +144,8 @@ extern void
 RADEONSaveFPRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save);
 extern void
 RADEONSaveDACRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save);
+extern void
+RADEONSaveTVRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save);
 
 #ifdef USE_XAA
 #ifdef XF86DRI
@@ -1191,7 +1193,6 @@ static Bool RADEONProbePLLParameters(ScrnInfoPtr pScrn)
 static void RADEONGetClockInfo(ScrnInfoPtr pScrn)
 {
     RADEONInfoPtr info = RADEONPTR (pScrn);
-    RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
     RADEONPLLPtr pll = &info->pll;
     double min_dotclock;
 
@@ -1468,7 +1469,7 @@ static void RADEONInitMemoryMap(ScrnInfoPtr pScrn)
 	    if (info->ChipFamily >= CHIP_FAMILY_R600) {
 		info->mc_fb_location = (aper0_base >> 24) |
 		    (((aper0_base + mem_size - 1) & 0xff000000U) >> 8);
-		ErrorF("mc fb loc is %08x\n", info->mc_fb_location);
+		ErrorF("mc fb loc is %08x\n", (unsigned int)info->mc_fb_location);
 	    } else {
 		info->mc_fb_location = (aper0_base >> 16) |
 		    ((aper0_base + mem_size - 1) & 0xffff0000U);
@@ -2607,10 +2608,8 @@ static void RADEONPreInitBIOS(ScrnInfoPtr pScrn, xf86Int10InfoPtr  pInt10)
 
 static void RADEONFixZaphodOutputs(ScrnInfoPtr pScrn)
 {
-    RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
     RADEONInfoPtr info = RADEONPTR(pScrn);
     xf86CrtcConfigPtr   config = XF86_CRTC_CONFIG_PTR(pScrn);
-    int i;
 
     if (info->IsPrimary) {
 	xf86OutputDestroy(config->output[0]);
@@ -2627,7 +2626,6 @@ static void RADEONFixZaphodOutputs(ScrnInfoPtr pScrn)
 static Bool RADEONPreInitControllers(ScrnInfoPtr pScrn)
 {
     xf86CrtcConfigPtr   config = XF86_CRTC_CONFIG_PTR(pScrn);
-    RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
     RADEONInfoPtr info = RADEONPTR(pScrn);
     int i;
     int mask;
@@ -3672,7 +3670,7 @@ void RADEONRestoreMemMapRegisters(ScrnInfoPtr pScrn,
 	       "RADEONRestoreMemMapRegisters() : \n");
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 	       "  MC_FB_LOCATION   : 0x%08x 0x%08x\n",
-	       (unsigned)restore->mc_fb_location, mc_fb_loc);
+	       (unsigned)restore->mc_fb_location, (unsigned int)mc_fb_loc);
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 	       "  MC_AGP_LOCATION  : 0x%08x\n",
 	       (unsigned)restore->mc_agp_location);
@@ -3789,7 +3787,7 @@ void RADEONRestoreMemMapRegisters(ScrnInfoPtr pScrn,
 			       "Timeout trying to update memory controller settings !\n");
 		    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 			       "MC_STATUS = 0x%08x (on entry = 0x%08x)\n",
-			       INREG(RADEON_MC_STATUS), (unsigned int)old_mc_status);
+			       (unsigned int)INREG(RADEON_MC_STATUS), (unsigned int)old_mc_status);
 		    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 			       "You will probably crash now ... \n");
 		    /* Nothing we can do except maybe try to kill the server,
@@ -3891,10 +3889,10 @@ static void RADEONAdjustMemMapRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save)
 		   "DRI init changed memory map, adjusting ...\n");
 	xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
 		   "  MC_FB_LOCATION  was: 0x%08lx is: 0x%08lx\n",
-		   info->mc_fb_location, fb);
+		   (long unsigned int)info->mc_fb_location, (long unsigned int)fb);
 	xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
 		   "  MC_AGP_LOCATION was: 0x%08lx is: 0x%08lx\n",
-		   info->mc_agp_location, agp);
+		   (long unsigned int)info->mc_agp_location, (long unsigned int)agp);
 	info->mc_fb_location = fb;
 	info->mc_agp_location = agp;
 	if (info->ChipFamily >= CHIP_FAMILY_R600)
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 84b1dd9..10369d9 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -198,7 +198,7 @@ void RADEONPrintPortMap(ScrnInfoPtr pScrn)
 		   ConnectorTypeName[radeon_output->ConnectorType],
 		   DACTypeName[radeon_output->DACType+1],
 		   TMDSTypeName[radeon_output->TMDSType+1],
-		   radeon_output->ddc_line);
+		   (unsigned int)radeon_output->ddc_line);
     }
 
 }
@@ -232,7 +232,7 @@ avivo_display_ddc_connected(ScrnInfoPtr pScrn, xf86OutputPtr output)
     } else MonType = MT_NONE;
     
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-	       "DDC Type: 0x%x, Detected Monitor Type: %d\n", radeon_output->ddc_line, MonType);
+	       "DDC Type: 0x%x, Detected Monitor Type: %d\n", (unsigned int)radeon_output->ddc_line, MonType);
 
     return MonType;
 }
@@ -332,7 +332,7 @@ RADEONDisplayDDCConnected(ScrnInfoPtr pScrn, xf86OutputPtr output)
     } else MonType = MT_NONE;
 
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-	       "DDC Type: 0x%x, Detected Monitor Type: %d\n", radeon_output->ddc_line, MonType);
+	       "DDC Type: 0x%x, Detected Monitor Type: %d\n", (unsigned int)radeon_output->ddc_line, MonType);
 
     return MonType;
 }
@@ -1196,6 +1196,7 @@ void RADEONSetOutputType(ScrnInfoPtr pScrn, RADEONOutputPrivatePtr radeon_output
     radeon_output->type = output;
 }
 
+#if 0
 static
 Bool AVIVOI2CReset(ScrnInfoPtr pScrn)
 {
@@ -1207,6 +1208,7 @@ Bool AVIVOI2CReset(ScrnInfoPtr pScrn)
   OUTREG(AVIVO_I2C_STOP, 0x0);
   return TRUE;
 }
+#endif
 
 static
 Bool AVIVOI2CDoLock(ScrnInfoPtr pScrn, int lock_state, int gpio_reg)
@@ -1669,7 +1671,7 @@ void RADEONInitConnector(xf86OutputPtr output)
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
     char stmp[16];
     char *name;
-    sprintf(stmp, "DDC_0x%x", radeon_output->ddc_line);
+    sprintf(stmp, "DDC_0x%x", (unsigned int)radeon_output->ddc_line);
     name = xnfalloc(strlen(stmp) + 1);
     strcpy(name, stmp);
 
@@ -2224,11 +2226,11 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn)
 	info->BiosConnector[0].valid = TRUE;
 	info->BiosConnector[1].valid = TRUE;
 	if (sscanf(optstr, "%u,%d,%d,%u,%u,%d,%d,%u",
-		   &info->BiosConnector[0].ddc_line,
+		   (unsigned int *)&info->BiosConnector[0].ddc_line,
 		   &info->BiosConnector[0].DACType,
 		   &info->BiosConnector[0].TMDSType,
 		   &info->BiosConnector[0].ConnectorType,
-		   &info->BiosConnector[1].ddc_line,
+		   (unsigned int *)&info->BiosConnector[1].ddc_line,
 		   &info->BiosConnector[1].DACType,
 		   &info->BiosConnector[1].TMDSType,
 		   &info->BiosConnector[1].ConnectorType) != 8) {

commit 4c6f60e3b19ac55ab1255c79df03b1df5950864e
Author: Alex Deucher <alex@botch2.(none)>
Date:   Fri Dec 21 17:33:04 2007 -0500

    RADEON: clean up prototypes

diff --git a/src/legacy_output.c b/src/legacy_output.c
index 799aa2e..9caebdd 100644
--- a/src/legacy_output.c
+++ b/src/legacy_output.c
@@ -212,7 +212,6 @@ RADEONSaveFPRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save)
     }
 }
 
-
 Bool
 RADEONDVOReadByte(I2CDevPtr dvo, int addr, CARD8 *ch)
 {
diff --git a/src/radeon.h b/src/radeon.h
index 5c15888..c376cdb 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -849,22 +849,15 @@ extern void        RADEONGetPanelInfo(ScrnInfoPtr pScrn);
 extern void        RADEONUnblank(ScrnInfoPtr pScrn);
 extern void        RADEONUnblank(ScrnInfoPtr pScrn);
 extern void        RADEONBlank(ScrnInfoPtr pScrn);
-extern void        RADEONDisplayPowerManagementSet(ScrnInfoPtr pScrn,
-						   int PowerManagementMode,
-						   int flags);
+
 extern Bool RADEONAllocateControllers(ScrnInfoPtr pScrn, int mask);
 extern Bool RADEONAllocateConnectors(ScrnInfoPtr pScrn);
-extern int RADEONValidateMergeModes(ScrnInfoPtr pScrn);
-extern int RADEONValidateDDCModes(ScrnInfoPtr pScrn1, char **ppModeName,
-				  RADEONMonitorType DisplayType, int crtc2);
+
 extern void RADEONSetPitch (ScrnInfoPtr pScrn);
 extern void RADEONUpdateHVPosition(xf86OutputPtr output, DisplayModePtr mode);
 
-DisplayModePtr
+extern DisplayModePtr
 RADEONProbeOutputModes(xf86OutputPtr output);
-extern Bool RADEONInit2(ScrnInfoPtr pScrn, DisplayModePtr crtc1,
-			DisplayModePtr crtc2, int crtc_mask,
-			RADEONSavePtr save, RADEONMonitorType montype);
 
 extern Bool
 RADEONDVOReadByte(I2CDevPtr dvo, int addr, CARD8 *ch);
@@ -875,20 +868,18 @@ RADEONGetExtTMDSInfoFromBIOS (xf86OutputPtr output);
 extern Bool
 RADEONInitExtTMDSInfoFromBIOS (xf86OutputPtr output);
 
-void
+extern void
 radeon_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y);
-void
+extern void
 radeon_crtc_show_cursor (xf86CrtcPtr crtc);
-void
+extern void
 radeon_crtc_hide_cursor (xf86CrtcPtr crtc);
-void
+extern void
 radeon_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y);
-void
+extern void
 radeon_crtc_set_cursor_colors (xf86CrtcPtr crtc, int bg, int fg);
-void
+extern void
 radeon_crtc_load_cursor_argb (xf86CrtcPtr crtc, CARD32 *image);
-void
-RADEONEnableOutputs(ScrnInfoPtr pScrn, int crtc_num);
 
 extern void RADEONAdjustCrtcRegistersForTV(ScrnInfoPtr pScrn, RADEONSavePtr save,
 					   DisplayModePtr mode, xf86OutputPtr output);
diff --git a/src/radeon_bios.c b/src/radeon_bios.c
index 752b31e..1a4f99d 100644
--- a/src/radeon_bios.c
+++ b/src/radeon_bios.c
@@ -65,6 +65,7 @@ typedef enum
     CONNECTOR_UNSUPPORTED_LEGACY
 } RADEONLegacyConnectorType;
 
+
 /* Read the Video BIOS block and the FP registers (if applicable). */
 Bool RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr  pInt10)
 {
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 1662e04..b9a05f3 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -128,6 +128,31 @@ static void RADEONAdjustMemMapRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save);
 extern DisplayModePtr
 RADEONCrtcFindClosestMode(xf86CrtcPtr crtc, DisplayModePtr pMode);
 
+extern void
+RADEONSaveCommonRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save);
+extern void
+RADEONSaveBIOSRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save);
+extern void
+RADEONSaveCrtcRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save);
+extern void
+RADEONSaveCrtc2Registers(ScrnInfoPtr pScrn, RADEONSavePtr save);
+extern void
+RADEONSavePLLRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save);
+extern void
+RADEONSavePLL2Registers(ScrnInfoPtr pScrn, RADEONSavePtr save);
+extern void
+RADEONSaveFPRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save);
+extern void
+RADEONSaveDACRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save);
+
+#ifdef USE_XAA
+#ifdef XF86DRI
+extern Bool
+RADEONSetupMemXAA_DRI(int scrnIndex, ScreenPtr pScreen);
+#endif /* XF86DRI */
+extern Bool
+RADEONSetupMemXAA(int scrnIndex, ScreenPtr pScreen);
+#endif /* USE_XAA */
 
 static const OptionInfoRec RADEONOptions[] = {
     { OPTION_NOACCEL,        "NoAccel",          OPTV_BOOLEAN, {0}, FALSE },
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 2346932..84b1dd9 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -177,6 +177,7 @@ extern void legacy_output_dpms(xf86OutputPtr output, int mode);
 extern RADEONMonitorType atombios_dac_detect(ScrnInfoPtr pScrn, xf86OutputPtr output);
 extern RADEONMonitorType legacy_dac_detect(ScrnInfoPtr pScrn, xf86OutputPtr output);
 extern int atombios_external_tmds_setup(xf86OutputPtr output, DisplayModePtr mode);
+extern I2CDevPtr RADEONDVODeviceInit(I2CBusPtr b, I2CSlaveAddr addr);
 
 
 void RADEONPrintPortMap(ScrnInfoPtr pScrn)

commit 8c761afdcb9baf1649b93449692fb9ab67bc2c80
Author: Alex Deucher <alex@botch2.(none)>
Date:   Fri Dec 21 16:24:49 2007 -0500

    RADEON: more re-org
    
    move save/restore routines into legacy_crtc/output

diff --git a/src/legacy_crtc.c b/src/legacy_crtc.c
index f1bf9be..4a7071a 100644
--- a/src/legacy_crtc.c
+++ b/src/legacy_crtc.c
@@ -53,6 +53,585 @@
 #include "sarea.h"
 #endif
 
+/* Write common registers */
+void
+RADEONRestoreCommonRegisters(ScrnInfoPtr pScrn,
+			     RADEONSavePtr restore)
+{
+    RADEONInfoPtr  info       = RADEONPTR(pScrn);
+    RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
+    unsigned char *RADEONMMIO = info->MMIO;
+
+    if (info->IsSecondary)
+      return;
+
+    OUTREG(RADEON_OVR_CLR,            restore->ovr_clr);
+    OUTREG(RADEON_OVR_WID_LEFT_RIGHT, restore->ovr_wid_left_right);
+    OUTREG(RADEON_OVR_WID_TOP_BOTTOM, restore->ovr_wid_top_bottom);
+    OUTREG(RADEON_OV0_SCALE_CNTL,     restore->ov0_scale_cntl);
+    OUTREG(RADEON_SUBPIC_CNTL,        restore->subpic_cntl);
+    OUTREG(RADEON_VIPH_CONTROL,       restore->viph_control);
+    OUTREG(RADEON_I2C_CNTL_1,         restore->i2c_cntl_1);
+    OUTREG(RADEON_GEN_INT_CNTL,       restore->gen_int_cntl);
+    OUTREG(RADEON_CAP0_TRIG_CNTL,     restore->cap0_trig_cntl);
+    OUTREG(RADEON_CAP1_TRIG_CNTL,     restore->cap1_trig_cntl);
+    OUTREG(RADEON_BUS_CNTL,           restore->bus_cntl);
+    OUTREG(RADEON_SURFACE_CNTL,       restore->surface_cntl);
+
+    /* 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.
+     */
+    if (pRADEONEnt->HasCRTC2 &&
+	info->ChipFamily != CHIP_FAMILY_R200 &&
+	!IS_R300_VARIANT) {
+	CARD32        tmp;
+
+	tmp = INREG(RADEON_DAC_CNTL2);
+	OUTREG(RADEON_DAC_CNTL2, tmp & ~RADEON_DAC2_DAC_CLK_SEL);
+	usleep(100000);
+    }
+}
+
+
+/* Write CRTC registers */
+void
+RADEONRestoreCrtcRegisters(ScrnInfoPtr pScrn,
+			   RADEONSavePtr restore)
+{
+    RADEONInfoPtr  info       = RADEONPTR(pScrn);
+    unsigned char *RADEONMMIO = info->MMIO;
+
+    xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
+		   "Programming CRTC1, offset: 0x%08x\n",
+		   (unsigned)restore->crtc_offset);
+
+    /* We prevent the CRTC from hitting the memory controller until
+     * fully programmed
+     */
+    OUTREG(RADEON_CRTC_GEN_CNTL, restore->crtc_gen_cntl |
+	   RADEON_CRTC_DISP_REQ_EN_B);
+
+    OUTREGP(RADEON_CRTC_EXT_CNTL,
+	    restore->crtc_ext_cntl,
+	    RADEON_CRTC_VSYNC_DIS |
+	    RADEON_CRTC_HSYNC_DIS |
+	    RADEON_CRTC_DISPLAY_DIS);
+
+    OUTREG(RADEON_CRTC_H_TOTAL_DISP,    restore->crtc_h_total_disp);
+    OUTREG(RADEON_CRTC_H_SYNC_STRT_WID, restore->crtc_h_sync_strt_wid);
+    OUTREG(RADEON_CRTC_V_TOTAL_DISP,    restore->crtc_v_total_disp);
+    OUTREG(RADEON_CRTC_V_SYNC_STRT_WID, restore->crtc_v_sync_strt_wid);
+
+    OUTREG(RADEON_FP_H_SYNC_STRT_WID,   restore->fp_h_sync_strt_wid);
+    OUTREG(RADEON_FP_V_SYNC_STRT_WID,   restore->fp_v_sync_strt_wid);
+    OUTREG(RADEON_FP_CRTC_H_TOTAL_DISP, restore->fp_crtc_h_total_disp);
+    OUTREG(RADEON_FP_CRTC_V_TOTAL_DISP, restore->fp_crtc_v_total_disp);
+
+    if (IS_R300_VARIANT)
+	OUTREG(R300_CRTC_TILE_X0_Y0, restore->crtc_tile_x0_y0);
+    OUTREG(RADEON_CRTC_OFFSET_CNTL,     restore->crtc_offset_cntl);
+    OUTREG(RADEON_CRTC_OFFSET,          restore->crtc_offset);
+
+    OUTREG(RADEON_CRTC_PITCH,           restore->crtc_pitch);
+    OUTREG(RADEON_DISP_MERGE_CNTL,      restore->disp_merge_cntl);
+    OUTREG(RADEON_CRTC_MORE_CNTL,       restore->crtc_more_cntl);
+
+    if (info->IsDellServer) {
+	OUTREG(RADEON_TV_DAC_CNTL, restore->tv_dac_cntl);
+	OUTREG(RADEON_DISP_HW_DEBUG, restore->disp_hw_debug);
+	OUTREG(RADEON_DAC_CNTL2, restore->dac2_cntl);
+	OUTREG(RADEON_CRTC2_GEN_CNTL, restore->crtc2_gen_cntl);
+    }
+
+    OUTREG(RADEON_CRTC_GEN_CNTL, restore->crtc_gen_cntl);
+}
+
+/* Write CRTC2 registers */
+void
+RADEONRestoreCrtc2Registers(ScrnInfoPtr pScrn,
+			    RADEONSavePtr restore)
+{
+    RADEONInfoPtr  info       = RADEONPTR(pScrn);
+    unsigned char *RADEONMMIO = info->MMIO;
+    /*    CARD32	   crtc2_gen_cntl;*/
+
+    xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
+		   "Programming CRTC2, offset: 0x%08x\n",
+		   (unsigned)restore->crtc2_offset);
+
+    /* We prevent the CRTC from hitting the memory controller until
+     * fully programmed
+     */
+    OUTREG(RADEON_CRTC2_GEN_CNTL,
+	   restore->crtc2_gen_cntl | RADEON_CRTC2_VSYNC_DIS |
+	   RADEON_CRTC2_HSYNC_DIS | RADEON_CRTC2_DISP_DIS |
+	   RADEON_CRTC2_DISP_REQ_EN_B);
+
+    OUTREG(RADEON_CRTC2_H_TOTAL_DISP,    restore->crtc2_h_total_disp);
+    OUTREG(RADEON_CRTC2_H_SYNC_STRT_WID, restore->crtc2_h_sync_strt_wid);
+    OUTREG(RADEON_CRTC2_V_TOTAL_DISP,    restore->crtc2_v_total_disp);
+    OUTREG(RADEON_CRTC2_V_SYNC_STRT_WID, restore->crtc2_v_sync_strt_wid);
+
+    OUTREG(RADEON_FP_H2_SYNC_STRT_WID,   restore->fp_h2_sync_strt_wid);
+    OUTREG(RADEON_FP_V2_SYNC_STRT_WID,   restore->fp_v2_sync_strt_wid);
+
+    if (IS_R300_VARIANT)
+	OUTREG(R300_CRTC2_TILE_X0_Y0, restore->crtc2_tile_x0_y0);
+    OUTREG(RADEON_CRTC2_OFFSET_CNTL,     restore->crtc2_offset_cntl);
+    OUTREG(RADEON_CRTC2_OFFSET,          restore->crtc2_offset);
+
+    OUTREG(RADEON_CRTC2_PITCH,           restore->crtc2_pitch);
+    OUTREG(RADEON_DISP2_MERGE_CNTL,      restore->disp2_merge_cntl);
+
+    if (info->ChipFamily == CHIP_FAMILY_RS400) {
+	OUTREG(RADEON_RS480_UNK_e30, restore->rs480_unk_e30);
+	OUTREG(RADEON_RS480_UNK_e34, restore->rs480_unk_e34);
+	OUTREG(RADEON_RS480_UNK_e38, restore->rs480_unk_e38);
+	OUTREG(RADEON_RS480_UNK_e3c, restore->rs480_unk_e3c);
+    }
+    OUTREG(RADEON_CRTC2_GEN_CNTL, restore->crtc2_gen_cntl);
+
+}
+
+static void
+RADEONPLLWaitForReadUpdateComplete(ScrnInfoPtr pScrn)
+{
+    int i = 0;
+
+    /* FIXME: Certain revisions of R300 can't recover here.  Not sure of
+       the cause yet, but this workaround will mask the problem for now.
+       Other chips usually will pass at the very first test, so the
+       workaround shouldn't have any effect on them. */
+    for (i = 0;
+	 (i < 10000 &&
+	  INPLL(pScrn, RADEON_PPLL_REF_DIV) & RADEON_PPLL_ATOMIC_UPDATE_R);


Reply to: