summaryrefslogtreecommitdiff
path: root/src/i830_driver.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@dulcimer.keithp.com>2007-05-17 15:00:12 -0700
committerKeith Packard <keithp@dulcimer.keithp.com>2007-05-17 15:00:12 -0700
commite89d5f275442915cc7777e75d3fcf7e7ed0f2084 (patch)
tree26ea06fdb3af64ce40003c234e9ba9b3e5dfecb0 /src/i830_driver.c
parenta441954630c6cdabbf463bfc3404160f97a04b4f (diff)
Make each output control clones/crtcs. Split DVO into LVDS, TMDS, TV.
Move clone/crtc config into each output where it's easier to understand (no need for a switch statement in I830PrepareOutputs. Also, split DVO into three sub-types (TMDS, LVDS, TVOUT) as those have different cloning abilities.
Diffstat (limited to 'src/i830_driver.c')
-rw-r--r--src/i830_driver.c46
1 files changed, 11 insertions, 35 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c
index b4d9d086..2cbddb02 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -728,44 +728,20 @@ I830SetupOutputs(ScrnInfoPtr pScrn)
{
xf86OutputPtr output = config->output[o];
I830OutputPrivatePtr intel_output = output->driver_private;
- int crtc_mask = 0, clone_mask = 0;
+ int crtc_mask;
+ int c;
- /*
- * Valid crtcs
- */
- switch (intel_output->type) {
- case I830_OUTPUT_DVO:
- case I830_OUTPUT_SDVO:
- crtc_mask = ((1 << 0)|
- (1 << 1));
- clone_mask = ((1 << I830_OUTPUT_ANALOG) |
- (1 << I830_OUTPUT_DVO) |
- (1 << I830_OUTPUT_SDVO));
- break;
- case I830_OUTPUT_ANALOG:
- crtc_mask = ((1 << 0));
- /*
- * 915 cannot do double-wide on pipe B
- * 830 cannot put CRT on pipe B
- */
- if (!IS_I915G(pI830) && !IS_I915GM (pI830) && !IS_I830(pI830))
- crtc_mask |= ((1 << 1));
- clone_mask = ((1 << I830_OUTPUT_ANALOG) |
- (1 << I830_OUTPUT_DVO) |
- (1 << I830_OUTPUT_SDVO));
- break;
- case I830_OUTPUT_LVDS:
- crtc_mask = (1 << 1);
- clone_mask = (1 << I830_OUTPUT_LVDS);
- break;
- case I830_OUTPUT_TVOUT:
- crtc_mask = ((1 << 0) |
- (1 << 1));
- clone_mask = (1 << I830_OUTPUT_TVOUT);
- break;
+ crtc_mask = 0;
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ xf86CrtcPtr crtc = config->crtc[c];
+ I830CrtcPrivatePtr intel_crtc = crtc->driver_private;
+
+ if (intel_output->pipe_mask & (1 << intel_crtc->pipe))
+ crtc_mask |= (1 << c);
}
output->possible_crtcs = crtc_mask;
- output->possible_clones = i830_output_clones (pScrn, clone_mask);
+ output->possible_clones = i830_output_clones (pScrn, intel_output->clone_mask);
}
}