summaryrefslogtreecommitdiff
path: root/src/radeon_driver.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-02-25 21:03:13 -0500
committerAlex Deucher <alexdeucher@gmail.com>2010-02-25 21:03:13 -0500
commit433c8617341f5768255826435a2b09afba684f02 (patch)
tree584ab6b5242e009e1c867bd5d8d290890ee38bed /src/radeon_driver.c
parentf3e20b01c77f02bdf3483ceee27a1f00d240c33d (diff)
update ZaphodHeads option
Now that the screen section mapping is fixed, Make the option per-instance and allow multiple outputs to be specified; e.g., DVI-0 and HDMI-0 associated with instance 0 and LVDS and VGA-0 associated with instance 1.
Diffstat (limited to 'src/radeon_driver.c')
-rw-r--r--src/radeon_driver.c39
1 files changed, 12 insertions, 27 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 9a4cb9a5..e11c5e96 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -2788,18 +2788,18 @@ RADEONPreInitBIOS(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
}
Bool
-RADEONZaphodStringMatches(ScrnInfoPtr pScrn, Bool is_primary,
- const char *s, char *output_name)
+RADEONZaphodStringMatches(ScrnInfoPtr pScrn, const char *s, char *output_name)
{
- int i = 0, second = 0;
- char s1[20], s2[20];
+ int i = 0;
+ char s1[20];
do {
switch(*s) {
case ',':
s1[i] = '\0';
i = 0;
- second = 1;
+ if (strcmp(s1, output_name) == 0)
+ return TRUE;
break;
case ' ':
case '\t':
@@ -2807,23 +2807,15 @@ RADEONZaphodStringMatches(ScrnInfoPtr pScrn, Bool is_primary,
case '\r':
break;
default:
- if (second)
- s2[i] = *s;
- else
- s1[i] = *s;
+ s1[i] = *s;
i++;
break;
}
} while(*s++);
- s2[i] = '\0';
- if (is_primary) {
- if (strcmp(s1, output_name) == 0)
- return TRUE;
- } else {
- if (strcmp(s2, output_name) == 0)
- return TRUE;
- }
+ s1[i] = '\0';
+ if (strcmp(s1, output_name) == 0)
+ return TRUE;
return FALSE;
}
@@ -2832,20 +2824,13 @@ static void RADEONFixZaphodOutputs(ScrnInfoPtr pScrn)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
- xf86OutputPtr output;
int o;
char *s;
if ((s = xf86GetOptValString(info->Options, OPTION_ZAPHOD_HEADS))) {
- for (o = 0; o < config->num_output; o++) {
- if (RADEONZaphodStringMatches(pScrn, info->IsPrimary, s, config->output[o]->name))
- output = config->output[o];
- }
- while (config->num_output > 1) {
- if (config->output[0] != output)
- xf86OutputDestroy(config->output[0]);
- else if (config->output[1] != output)
- xf86OutputDestroy(config->output[1]);
+ for (o = config->num_output; o > 0; o--) {
+ if (!RADEONZaphodStringMatches(pScrn, s, config->output[o - 1]->name))
+ xf86OutputDestroy(config->output[o - 1]);
}
} else {
if (info->IsPrimary) {