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

Alex Deucher agd5f at kemper.freedesktop.org
Mon Jun 4 18:17:45 PDT 2007


 src/radeon_output.c |  159 ++++++++++++++++++++++++++++++----------------------
 1 files changed, 94 insertions(+), 65 deletions(-)

New commits:
diff-tree 7886405308e3288d5c86b6f2c7dbfa8ff865139c (from f54ad565a69deb52547fd04e123f56fc1294cd0a)
Author: Alex Deucher <alex at t41p.hsd1.va.comcast.net>
Date:   Mon Jun 4 21:16:56 2007 -0400

    RADEON: fix indenting

diff --git a/src/radeon_output.c b/src/radeon_output.c
index 2f5674f..c3548dd 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -158,20 +158,19 @@ void RADEONPrintPortMap(ScrnInfoPtr pScr
     int o;
 
     for (o = 0; o < xf86_config->num_output; o++) {
-      output = xf86_config->output[o];
-      radeon_output = output->driver_private;
-
-      xf86DrvMsg(pScrn->scrnIndex, X_INFO, 
-		 "Port%d:\n Monitor   -- %s\n Connector -- %s\n DAC Type  -- %s\n TMDS Type -- %s\n DDC Type  -- %s\n", 
-	  o,
-	  MonTypeName[radeon_output->MonType+1],
-	  info->IsAtomBios ? 
-	  ConnectorTypeNameATOM[radeon_output->ConnectorType]:
-	  ConnectorTypeName[radeon_output->ConnectorType],
-	  DACTypeName[radeon_output->DACType+1],
-	  TMDSTypeName[radeon_output->TMDSType+1],
-	  DDCTypeName[radeon_output->DDCType]);
+	output = xf86_config->output[o];
+	radeon_output = output->driver_private;
 
+	xf86DrvMsg(pScrn->scrnIndex, X_INFO, 
+		   "Port%d:\n Monitor   -- %s\n Connector -- %s\n DAC Type  -- %s\n TMDS Type -- %s\n DDC Type  -- %s\n", 
+		   o,
+		   MonTypeName[radeon_output->MonType+1],
+		   info->IsAtomBios ? 
+		   ConnectorTypeNameATOM[radeon_output->ConnectorType]:
+		   ConnectorTypeName[radeon_output->ConnectorType],
+		   DACTypeName[radeon_output->DACType+1],
+		   TMDSTypeName[radeon_output->TMDSType+1],
+		   DDCTypeName[radeon_output->DDCType]);
     }
 
 }
diff-tree f54ad565a69deb52547fd04e123f56fc1294cd0a (from 687879bff716ad01f9f158860deb8ba770faab99)
Author: Alex Deucher <alex at t41p.hsd1.va.comcast.net>
Date:   Mon Jun 4 21:13:16 2007 -0400

    RADEON: no need to go through all the crtcs, we've got what we need

diff --git a/src/radeon_output.c b/src/radeon_output.c
index b13fd29..2f5674f 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -967,18 +967,11 @@ radeon_mode_set(xf86OutputPtr output, Di
 {
     ScrnInfoPtr	    pScrn = output->scrn;
     RADEONInfoPtr info = RADEONPTR(pScrn);
-    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
-    int i;
+    xf86CrtcPtr	crtc = output->crtc;
+    RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
 
-    /* get the outputs connected to this CRTC */
-    for (i = 0; i < xf86_config->num_crtc; i++) {
-	xf86CrtcPtr	crtc = xf86_config->crtc[i];
-	RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
-	if (output->crtc == crtc) {
-	    RADEONInitOutputRegisters(pScrn, &info->ModeReg, adjusted_mode, output, radeon_crtc->crtc_id);
-	}
-    }
+    RADEONInitOutputRegisters(pScrn, &info->ModeReg, adjusted_mode, output, radeon_crtc->crtc_id);
 
     switch(radeon_output->MonType) {
     case MT_LCD:
diff-tree 687879bff716ad01f9f158860deb8ba770faab99 (from e6161e472ff266f69547704a61040228a8704b06)
Author: Alex Deucher <alex at t41p.hsd1.va.comcast.net>
Date:   Mon Jun 4 21:08:40 2007 -0400

    RADEON: add support for RMX on DVI, make sure RMX is only enabled on crtc1

diff --git a/src/radeon_output.c b/src/radeon_output.c
index 3e2881f..b13fd29 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -147,6 +147,7 @@ static const RADEONTMDSPll default_tmds_
 };
 
 static RADEONMonitorType RADEONPortCheckNonDDC(ScrnInfoPtr pScrn, xf86OutputPtr output);
+static void RADEONUpdatePanelSize(xf86OutputPtr output);
 
 void RADEONPrintPortMap(ScrnInfoPtr pScrn)
 {
@@ -528,19 +529,23 @@ void RADEONConnectorFindMonitor(ScrnInfo
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
     
     if (radeon_output->MonType == MT_UNKNOWN) {
-      if ((radeon_output->MonType = RADEONDisplayDDCConnected(pScrn, output)));
-      else if((radeon_output->MonType = RADEONPortCheckNonDDC(pScrn, output)));
-      else if (radeon_output->DACType == DAC_PRIMARY) 
-	  radeon_output->MonType = RADEONCrtIsPhysicallyConnected(pScrn, !(radeon_output->DACType));
+	if ((radeon_output->MonType = RADEONDisplayDDCConnected(pScrn, output)));
+	else if((radeon_output->MonType = RADEONPortCheckNonDDC(pScrn, output)));
+	else if (radeon_output->DACType == DAC_PRIMARY) 
+	    radeon_output->MonType = RADEONCrtIsPhysicallyConnected(pScrn, !(radeon_output->DACType));
     }
 
+    /* update panel info for RMX */
+    if (radeon_output->MonType == MT_LCD || radeon_output->MonType == MT_DFP)
+	RADEONUpdatePanelSize(output);
+
     if (output->MonInfo) {
-      xf86DrvMsg(pScrn->scrnIndex, X_INFO, "EDID data from the display on connector: %s ----------------------\n",
-		 info->IsAtomBios ?
-		 ConnectorTypeNameATOM[radeon_output->ConnectorType]:
-		 ConnectorTypeName[radeon_output->ConnectorType]
-		 );
-      xf86PrintEDID( output->MonInfo );
+	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "EDID data from the display on connector: %s ----------------------\n",
+		   info->IsAtomBios ?
+		   ConnectorTypeNameATOM[radeon_output->ConnectorType]:
+		   ConnectorTypeName[radeon_output->ConnectorType]
+		   );
+	xf86PrintEDID( output->MonInfo );
     }
 }
 
@@ -622,25 +627,29 @@ radeon_mode_fixup(xf86OutputPtr output, 
     RADEONInfoPtr info = RADEONPTR(pScrn);
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
 
-    if (radeon_output->type != OUTPUT_LVDS)
-	return TRUE;
+    if (radeon_output->MonType == MT_LCD || radeon_output->MonType == MT_DFP) {
+	xf86CrtcPtr crtc = output->crtc;
+	RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
+
+	if ((mode->HDisplay < radeon_output->PanelXRes ||
+	     mode->VDisplay < radeon_output->PanelYRes) &&
+	    radeon_crtc->crtc_id == 0)
+	    adjusted_mode->Flags |= RADEON_USE_RMX;
+
+	if (adjusted_mode->Flags & RADEON_USE_RMX) {
+	    adjusted_mode->CrtcHTotal     = mode->CrtcHDisplay + radeon_output->HBlank;
+	    adjusted_mode->CrtcHSyncStart = mode->CrtcHDisplay + radeon_output->HOverPlus;
+	    adjusted_mode->CrtcHSyncEnd   = mode->CrtcHSyncStart + radeon_output->HSyncWidth;
+	    adjusted_mode->CrtcVTotal     = mode->CrtcVDisplay + radeon_output->VBlank;
+	    adjusted_mode->CrtcVSyncStart = mode->CrtcVDisplay + radeon_output->VOverPlus;
+	    adjusted_mode->CrtcVSyncEnd   = mode->CrtcVSyncStart + radeon_output->VSyncWidth;
+	    adjusted_mode->Clock          = radeon_output->DotClock;
+	    adjusted_mode->Flags          = radeon_output->Flags | RADEON_USE_RMX;
+	    /* FIXME: do this properly in radeon_video.c */
+	    info->PanelYRes = radeon_output->PanelYRes;
+	    info->PanelXRes = radeon_output->PanelXRes;
+	}
 
-    if (mode->HDisplay < radeon_output->PanelXRes ||
-	mode->VDisplay < radeon_output->PanelYRes)
-	adjusted_mode->Flags |= RADEON_USE_RMX;
-
-    if (adjusted_mode->Flags & RADEON_USE_RMX) {
-	adjusted_mode->CrtcHTotal     = mode->CrtcHDisplay + radeon_output->HBlank;
-	adjusted_mode->CrtcHSyncStart = mode->CrtcHDisplay + radeon_output->HOverPlus;
-	adjusted_mode->CrtcHSyncEnd   = mode->CrtcHSyncStart + radeon_output->HSyncWidth;
-	adjusted_mode->CrtcVTotal     = mode->CrtcVDisplay + radeon_output->VBlank;
-	adjusted_mode->CrtcVSyncStart = mode->CrtcVDisplay + radeon_output->VOverPlus;
-	adjusted_mode->CrtcVSyncEnd   = mode->CrtcVSyncStart + radeon_output->VSyncWidth;
-	adjusted_mode->Clock          = radeon_output->DotClock;
-	adjusted_mode->Flags          = radeon_output->Flags | RADEON_USE_RMX;
-	/* save these for Xv with RMX */
-	info->PanelYRes = radeon_output->PanelYRes;
-	info->PanelXRes = radeon_output->PanelXRes;
     }
 
     return TRUE;
@@ -1121,7 +1130,7 @@ radeon_create_resources(xf86OutputPtr ou
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		       "RRConfigureOutputProperty error, %d\n", err);
 	}
-	/* Set the current value of the backlight property */
+	/* Set the current value of the property */
 	data = 0;
 	err = RRChangeOutputProperty(output->randr_output, rmx_atom,
 				     XA_INTEGER, 32, PropModeReplace, 1, &data,
@@ -1395,7 +1404,8 @@ RADEONUpdatePanelSize(xf86OutputPtr outp
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
     int             j;
     /* XXX: fixme */
-    xf86MonPtr      ddc  = pScrn->monitor->DDC;
+    //xf86MonPtr      ddc  = pScrn->monitor->DDC;
+    xf86MonPtr ddc = output->MonInfo;
     DisplayModePtr  p;
 
     // crtc should handle?
diff-tree e6161e472ff266f69547704a61040228a8704b06 (from be0ce38232ea4f5679c5829ab663939144c6e617)
Author: Alex Deucher <alex at t41p.hsd1.va.comcast.net>
Date:   Mon Jun 4 20:32:55 2007 -0400

    RADEON: remove some cruft

diff --git a/src/radeon_output.c b/src/radeon_output.c
index 8060b4c..3e2881f 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -891,7 +891,6 @@ static void RADEONInitDAC2Registers(xf86
     RADEONInitTvDacCntl(pScrn, save);
 
     if (IsPrimary) {
-	/*save->crtc2_gen_cntl = info->SavedReg.crtc2_gen_cntl | RADEON_CRTC2_CRT2_ON;*/
         save->dac2_cntl = info->SavedReg.dac2_cntl | RADEON_DAC2_DAC2_CLK_SEL;
         if (IS_R300_VARIANT) {
             save->disp_output_cntl = info->SavedReg.disp_output_cntl &
@@ -901,10 +900,6 @@ static void RADEONInitDAC2Registers(xf86
 	    save->fp2_gen_cntl = info->SavedReg.fp2_gen_cntl &
 				  ~(R200_FP2_SOURCE_SEL_MASK |
 				    RADEON_FP2_DVO_RATE_SEL_SDR);
-            /*save->fp2_gen_cntl = info->SavedReg.fp2_gen_cntl |
-				    (RADEON_FP2_ON |
-				     RADEON_FP2_BLANK_EN |
-				     RADEON_FP2_DVO_EN);*/
 	} else {
             save->disp_hw_debug = info->SavedReg.disp_hw_debug | RADEON_CRT2_DISP1_SEL;
         }
@@ -919,12 +914,7 @@ static void RADEONInitDAC2Registers(xf86
 	    save->fp2_gen_cntl = info->SavedReg.fp2_gen_cntl &
 				  ~(R200_FP2_SOURCE_SEL_MASK |
 				    RADEON_FP2_DVO_RATE_SEL_SDR);
-            save->fp2_gen_cntl |= (R200_FP2_SOURCE_SEL_CRTC2 /*|
-				   RADEON_FP2_BLANK_EN |
-                                   RADEON_FP2_ON |
-                                   RADEON_FP2_DVO_EN*/);
-	    /*save->fp_h2_sync_strt_wid = save->crtc2_h_sync_strt_wid;
-	    save->fp_v2_sync_strt_wid = save->crtc2_v_sync_strt_wid;*/
+            save->fp2_gen_cntl |= R200_FP2_SOURCE_SEL_CRTC2;
         } else {
             save->dac2_cntl = info->SavedReg.dac2_cntl | RADEON_DAC2_DAC2_CLK_SEL;
             save->disp_hw_debug = info->SavedReg.disp_hw_debug &
diff-tree be0ce38232ea4f5679c5829ab663939144c6e617 (from 8ec617f6493dd0aea5d11f92e3d58c3feef8c8fd)
Author: Alex Deucher <alex at t41p.hsd1.va.comcast.net>
Date:   Mon Jun 4 20:22:15 2007 -0400

    RADEON: number the outputs if there are more than one of the same

diff --git a/src/radeon_output.c b/src/radeon_output.c
index 99b6544..8060b4c 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -1754,7 +1754,44 @@ Bool RADEONSetupConnectors(ScrnInfoPtr p
 		    radeon_output->TMDSType = info->BiosConnector[i].TMDSType;
 	    }
 	    RADEONSetOutputType(pScrn, radeon_output);
-	    output = xf86OutputCreate(pScrn, &radeon_output_funcs, OutputType[radeon_output->type]);
+	    if (info->IsAtomBios) {
+		if (((info->BiosConnector[0].ConnectorType == CONNECTOR_DVI_D_ATOM) ||
+		     (info->BiosConnector[0].ConnectorType == CONNECTOR_DVI_I_ATOM) ||
+		     (info->BiosConnector[0].ConnectorType == CONNECTOR_DVI_A_ATOM)) &&
+		    ((info->BiosConnector[1].ConnectorType == CONNECTOR_DVI_D_ATOM) ||
+		     (info->BiosConnector[1].ConnectorType == CONNECTOR_DVI_I_ATOM) ||
+		     (info->BiosConnector[1].ConnectorType == CONNECTOR_DVI_A_ATOM))) {
+		    if (i > 0)
+			output = xf86OutputCreate(pScrn, &radeon_output_funcs, "DVI-1");
+		    else
+			output = xf86OutputCreate(pScrn, &radeon_output_funcs, "DVI-0");
+		} else if ((info->BiosConnector[0].ConnectorType == CONNECTOR_VGA_ATOM) &&
+			   (info->BiosConnector[1].ConnectorType == CONNECTOR_VGA_ATOM)) {
+		    if (i > 0)
+			output = xf86OutputCreate(pScrn, &radeon_output_funcs, "VGA-1");
+		    else
+			output = xf86OutputCreate(pScrn, &radeon_output_funcs, "VGA-0");
+		} else
+		    output = xf86OutputCreate(pScrn, &radeon_output_funcs, OutputType[radeon_output->type]);
+	    } else {
+		if (((info->BiosConnector[0].ConnectorType == CONNECTOR_DVI_D) ||
+		     (info->BiosConnector[0].ConnectorType == CONNECTOR_DVI_I)) &&
+		    ((info->BiosConnector[1].ConnectorType == CONNECTOR_DVI_D) ||
+		     (info->BiosConnector[1].ConnectorType == CONNECTOR_DVI_I))) {
+		    if (i > 0)
+			output = xf86OutputCreate(pScrn, &radeon_output_funcs, "DVI-1");
+		    else
+			output = xf86OutputCreate(pScrn, &radeon_output_funcs, "DVI-0");
+		} else if ((info->BiosConnector[0].ConnectorType == CONNECTOR_CRT) &&
+			   (info->BiosConnector[1].ConnectorType == CONNECTOR_CRT)) {
+		    if (i > 0)
+			output = xf86OutputCreate(pScrn, &radeon_output_funcs, "VGA-1");
+		    else
+			output = xf86OutputCreate(pScrn, &radeon_output_funcs, "VGA-0");
+		} else
+		    output = xf86OutputCreate(pScrn, &radeon_output_funcs, OutputType[radeon_output->type]);
+	    }
+
 	    if (!output) {
 		return FALSE;
 	    }


More information about the xorg-commit mailing list