summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-04-04 10:47:29 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2007-04-04 10:47:29 +0200
commit6b25a4c48796e022a093f3072574ffe9709ecaf4 (patch)
tree2bf39caeaf682462e630223974a53691574e73be /src
parent3c892f163ec1fa9be6e733aab091c9b718f41efc (diff)
radeon: Link nearest modes by default for clone mode.
This makes sure all modes of both CRTCs will be available by default with MergedFB.
Diffstat (limited to 'src')
-rw-r--r--src/radeon_mergedfb.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/radeon_mergedfb.c b/src/radeon_mergedfb.c
index 6a7745e4..5c91cd33 100644
--- a/src/radeon_mergedfb.c
+++ b/src/radeon_mergedfb.c
@@ -536,12 +536,33 @@ RADEONGenerateModeList(ScrnInfoPtr pScrn, char* str,
DisplayModePtr p, q, result = NULL;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Clone mode, list all common modes\n");
- for (p = i; p->next != i; p = p->next)
- for (q = j; q->next != j; q = q->next)
- if ((p->HDisplay == q->HDisplay) &&
- (p->VDisplay == q->VDisplay))
- result = RADEONCopyModeNLink(pScrn, result, p, q, srel);
+ "Clone mode, linking all nearest modes\n");
+
+ p = i;
+ q = j;
+
+ result = RADEONCopyModeNLink(pScrn, result, p, q, srel);
+
+ while (p->next != i || q->next != j) {
+ DisplayModePtr next_p = p;
+
+ if (q->next == j || (p->next != i &&
+ (p->HDisplay > q->HDisplay ||
+ (p->HDisplay == q->HDisplay &&
+ p->VDisplay >= q->VDisplay))))
+ next_p = p->next;
+
+ if (p->next == i || (q->next != j &&
+ (q->HDisplay > p->HDisplay ||
+ (q->HDisplay == p->HDisplay &&
+ q->VDisplay >= p->VDisplay))))
+ q = q->next;
+
+ p = next_p;
+
+ result = RADEONCopyModeNLink(pScrn, result, p, q, srel);
+ }
+
return result;
} else {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,