xf86-video-ati: Branch 'master' - 2 commits

Alex Deucher agd5f at kemper.freedesktop.org
Tue Mar 11 10:39:04 PDT 2008


 src/atombios_output.c |   26 +++++++++++++++++++++----
 src/radeon_output.c   |   52 +++++++++++++++++++++++++++++++++++++++++++++-----
 src/radeon_probe.h    |    1 
 3 files changed, 70 insertions(+), 9 deletions(-)

New commits:
commit 552615ccc5360baafb8bb41698c1ca27816fd4b2
Author: Alex Deucher <alex at cube.(none)>
Date:   Tue Mar 11 13:38:29 2008 -0400

    ATOMBIOS: enable load detection by default on both DACs
    
    Load detection is reliable with atom, so enable it by default
    on both DACA and DACB, rather than just DACA.

diff --git a/src/radeon_output.c b/src/radeon_output.c
index cee3ca9..0fbfdef 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -2177,16 +2177,17 @@ void RADEONInitConnector(xf86OutputPtr output)
     RADEONInfoPtr  info       = RADEONPTR(pScrn);
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
 
-    if (radeon_output->DACType == DAC_PRIMARY)
+    if (info->IsAtomBios &&
+	((radeon_output->DACType == DAC_PRIMARY) ||
+	 (radeon_output->DACType == DAC_TVDAC)))
+	radeon_output->load_detection = 1;
+    else if (radeon_output->DACType == DAC_PRIMARY)
 	radeon_output->load_detection = 1; /* primary dac, only drives vga */
-    /*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 */
+	radeon_output->load_detection = 0;
 
     if (radeon_output->type == OUTPUT_LVDS) {
 	radeon_output->rmx_type = RMX_FULL;
commit 78b10487cf222c96f8944ba25e2ea970506b3535
Author: Alex Deucher <alex at cube.(none)>
Date:   Tue Mar 11 13:16:00 2008 -0400

    DCE3: add output attribute to enable/disable coherent mode
    
    Enabled by default.  The TMDS transmitter can be programmed
    slightly differently depending on the chips in the panel.  If you
    have problems with tmds on a particular panel, try disabling it.

diff --git a/src/atombios_output.c b/src/atombios_output.c
index 7ae004c..1335b36 100644
--- a/src/atombios_output.c
+++ b/src/atombios_output.c
@@ -356,11 +356,20 @@ atombios_output_dig1_setup(xf86OutputPtr output, DisplayModePtr mode)
 
     disp_data.ucAction = 1;
     disp_data.usPixelClock = mode->Clock / 10;
+    disp_data.ucConfig = ATOM_ENCODER_CONFIG_TRANSMITTER1;
+    if (OUTPUT_IS_DVI || (radeon_output->type == OUTPUT_HDMI)) {
+	if (radeon_output->coherent_mode) {
+	    disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_COHERENT;
+	    xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "DIG1: Coherent Mode enabled\n");
+	} else
+	    xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "DIG1: Coherent Mode disabled\n");
+    }
+
     if (mode->Clock > 165000) {
-	disp_data.ucConfig = ATOM_ENCODER_CONFIG_LINKA_B | ATOM_ENCODER_CONFIG_TRANSMITTER1;
+	disp_data.ucConfig |= ATOM_ENCODER_CONFIG_LINKA_B;
 	disp_data.ucLaneNum = 8;
     } else {
-	disp_data.ucConfig = ATOM_ENCODER_CONFIG_LINKA | ATOM_ENCODER_CONFIG_TRANSMITTER1;
+	disp_data.ucConfig |= ATOM_ENCODER_CONFIG_LINKA;
 	disp_data.ucLaneNum = 4;
     }
 
@@ -433,11 +442,20 @@ atombios_output_dig2_setup(xf86OutputPtr output, DisplayModePtr mode)
 
     disp_data.ucAction = 1;
     disp_data.usPixelClock = mode->Clock / 10;
+    disp_data.ucConfig = ATOM_ENCODER_CONFIG_TRANSMITTER2;
+    if (OUTPUT_IS_DVI || (radeon_output->type == OUTPUT_HDMI)) {
+	if (radeon_output->coherent_mode) {
+	    disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_COHERENT;
+	    xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "DIG2: Coherent Mode enabled\n");
+	} else
+	    xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "DIG2: Coherent Mode disabled\n");
+    }
+
     if (mode->Clock > 165000) {
-	disp_data.ucConfig = ATOM_ENCODER_CONFIG_LINKA_B | ATOM_ENCODER_CONFIG_TRANSMITTER2;
+	disp_data.ucConfig |= ATOM_ENCODER_CONFIG_LINKA_B;
 	disp_data.ucLaneNum = 8;
     } else {
-	disp_data.ucConfig = ATOM_ENCODER_CONFIG_LINKA | ATOM_ENCODER_CONFIG_TRANSMITTER2;
+	disp_data.ucConfig |= ATOM_ENCODER_CONFIG_LINKA;
 	disp_data.ucLaneNum = 4;
     }
 
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 62cc5d4..cee3ca9 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -1168,6 +1168,7 @@ static Atom tmds_pll_atom;
 static Atom rmx_atom;
 static Atom monitor_type_atom;
 static Atom load_detection_atom;
+static Atom coherent_mode_atom;
 static Atom tv_hsize_atom;
 static Atom tv_hpos_atom;
 static Atom tv_vpos_atom;
@@ -1235,6 +1236,30 @@ radeon_create_resources(xf86OutputPtr output)
 	}
     }
 
+    if (IS_DCE3_VARIANT &&
+	(OUTPUT_IS_DVI || (radeon_output->type == OUTPUT_HDMI))) {
+	coherent_mode_atom = MAKE_ATOM("coherent_mode");
+
+	range[0] = 0; /* off */
+	range[1] = 1; /* on */
+	err = RRConfigureOutputProperty(output->randr_output, coherent_mode_atom,
+					FALSE, TRUE, FALSE, 2, range);
+	if (err != 0) {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "RRConfigureOutputProperty error, %d\n", err);
+	}
+
+	data = 1; /* use coherent mode by default */
+
+	err = RRChangeOutputProperty(output->randr_output, coherent_mode_atom,
+				     XA_INTEGER, 32, PropModeReplace, 1, &data,
+				     FALSE, TRUE);
+	if (err != 0) {
+	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		       "RRChangeOutputProperty error, %d\n", err);
+	}
+    }
+
     if (OUTPUT_IS_DVI && radeon_output->TMDSType == TMDS_INT) {
 	tmds_pll_atom = MAKE_ATOM("tmds_pll");
 
@@ -1451,6 +1476,19 @@ radeon_set_property(xf86OutputPtr output, Atom property,
 
 	radeon_output->load_detection = val;
 
+    } else if (property == coherent_mode_atom) {
+	if (value->type != XA_INTEGER ||
+	    value->format != 32 ||
+	    value->size != 1) {
+	    return FALSE;
+	}
+
+	val = *(INT32 *)value->data;
+	if (val < 0 || val > 1)
+	    return FALSE;
+
+	radeon_output->coherent_mode = val;
+
     } else if (property == rmx_atom) {
 	const char *s;
 	if (value->type != XA_STRING || value->format != 8)
@@ -2189,6 +2227,9 @@ void RADEONInitConnector(xf86OutputPtr output)
 	RADEONGetTVDacAdjInfo(output);
     }
 
+    if (OUTPUT_IS_DVI || (radeon_output->type == OUTPUT_HDMI))
+	radeon_output->coherent_mode = TRUE;
+
     if (radeon_output->ddc_i2c.valid)
 	RADEONI2CInit(output, &radeon_output->pI2CBus, output->name, FALSE);
 
diff --git a/src/radeon_probe.h b/src/radeon_probe.h
index ae24003..5d368fe 100644
--- a/src/radeon_probe.h
+++ b/src/radeon_probe.h
@@ -253,6 +253,7 @@ typedef struct _RADEONOutputPrivateRec {
     int               load_detection;
     /* dig block */
     int transmitter_config;
+    Bool coherent_mode;
 
     char              *name;
     int               output_id;


More information about the xorg-commit mailing list