xf86-video-ati: Branch 'master'

Dave Airlie airlied at kemper.freedesktop.org
Sun May 11 17:33:50 PDT 2008


 src/radeon_output.c |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

New commits:
commit 25e0c3945a51ae8c14b3a847ec75a256e1397f24
Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Mon May 12 10:28:33 2008 +1000

    radeon: add initial support for cloning outputs. (single-CRTC cards only)
    
    airlied - This code was originally written by Alex, and I've modified it to
    only run on single-CRTC cards for now until we can test it some more.

diff --git a/src/radeon_output.c b/src/radeon_output.c
index 907d824..9b2494b 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -2676,10 +2676,48 @@ static RADEONMacModel RADEONDetectMacModel(ScrnInfoPtr pScrn)
 
 #endif /* __powerpc__ */
 
+static int
+radeon_output_clones (ScrnInfoPtr pScrn, xf86OutputPtr output)
+{
+    RADEONOutputPrivatePtr radeon_output = output->driver_private;
+    RADEONEntPtr pRADEONEnt = RADEONEntPriv(output->scrn);
+    xf86CrtcConfigPtr	config = XF86_CRTC_CONFIG_PTR (pScrn);
+    int			o;
+    int			index_mask = 0;
+
+    /*
+     * cards without a CRTC2 really need cloning enabled
+     * for cards with 2 CRTC this may need more testing
+     */
+    if (pRADEONEnt->HasCRTC2)
+	return index_mask;
+
+    /* LVDS is too wacky */
+    if (radeon_output->type == OUTPUT_LVDS)
+	return index_mask;
+
+    for (o = 0; o < config->num_output; o++) {
+	xf86OutputPtr clone = config->output[o];
+	RADEONOutputPrivatePtr radeon_clone = clone->driver_private;
+	if (output == clone) /* don't clone yourself */
+	    continue;
+	else if (radeon_clone->type == OUTPUT_LVDS) /* LVDS */
+	    continue;
+	else if ((radeon_output->DACType == DAC_TVDAC) &&
+		 (radeon_clone->DACType == DAC_TVDAC)) /* shared tvdac */
+	    continue;
+	else
+	    index_mask |= (1 << o);
+    }
+
+    return index_mask;
+}
+
 /*
  * initialise the static data sos we don't have to re-do at randr change */
 Bool RADEONSetupConnectors(ScrnInfoPtr pScrn)
 {
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
     RADEONInfoPtr info       = RADEONPTR(pScrn);
     RADEONEntPtr pRADEONEnt  = RADEONEntPriv(pScrn);
     xf86OutputPtr output;
@@ -2881,6 +2919,12 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn)
 	}
     }
 
+    for (i = 0; i < xf86_config->num_output; i++) {
+	xf86OutputPtr output = xf86_config->output[i];
+
+	output->possible_clones = radeon_output_clones(pScrn, output);
+    }
+
     return TRUE;
 }
 


More information about the xorg-commit mailing list