summaryrefslogtreecommitdiff
path: root/src/radeon_output.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2008-05-12 10:28:33 +1000
committerDave Airlie <airlied@redhat.com>2008-05-12 10:28:33 +1000
commit25e0c3945a51ae8c14b3a847ec75a256e1397f24 (patch)
tree969c0f250b11f947c45049eb3b139ea9ea071714 /src/radeon_output.c
parent94405eb1c9e4e0ababc6aef03b753d6ed9eb7838 (diff)
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.
Diffstat (limited to 'src/radeon_output.c')
-rw-r--r--src/radeon_output.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 907d8248..9b2494b8 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;
}