xf86-video-ati: Branch 'master' - 3 commits

Michel Daenzer daenzer at kemper.freedesktop.org
Wed Apr 4 11:49:16 EEST 2007


 src/radeon_mergedfb.c |   42 +++++++++++++++++++++++++++++++++---------
 src/radeon_modes.c    |   34 ++++------------------------------
 2 files changed, 37 insertions(+), 39 deletions(-)

New commits:
diff-tree 6b25a4c48796e022a093f3072574ffe9709ecaf4 (from 3c892f163ec1fa9be6e733aab091c9b718f41efc)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Wed Apr 4 10:47:29 2007 +0200

    radeon: Link nearest modes by default for clone mode.
    
    This makes sure all modes of both CRTCs will be available by default with
    MergedFB.

diff --git a/src/radeon_mergedfb.c b/src/radeon_mergedfb.c
index 6a7745e..5c91cd3 100644
--- a/src/radeon_mergedfb.c
+++ b/src/radeon_mergedfb.c
@@ -536,12 +536,33 @@ RADEONGenerateModeList(ScrnInfoPtr pScrn
            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,
diff-tree 3c892f163ec1fa9be6e733aab091c9b718f41efc (from 3a8190ccc79969925257e7b980b78d79053d208d)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Wed Apr 4 09:52:37 2007 +0200

    radeon: Always sort modes when adding to list.
    
    This makes sure mode lists will always be sorted from larger to smaller.

diff --git a/src/radeon_modes.c b/src/radeon_modes.c
index 535d047..372b2ed 100644
--- a/src/radeon_modes.c
+++ b/src/radeon_modes.c
@@ -373,15 +373,7 @@ int RADEONValidateDDCModes(ScrnInfoPtr p
 			    if (p == ddcModes) ddcModes = p->next;
 
 			    /* Add to used modes */
-			    if (last) {
-				last->next = p;
-				p->prev = last;
-			    } else {
-				first = p;
-				p->prev = NULL;
-			    }
-			    p->next = NULL;
-			    last = p;
+			    RADEONSortModes(&p, &first, &last);
 
 			    break;
 			}
@@ -402,15 +394,7 @@ int RADEONValidateDDCModes(ScrnInfoPtr p
 		    if (p == ddcModes) ddcModes = p->next;
 
 		    /* Add to used modes */
-		    if (last) {
-			last->next = p;
-			p->prev = last;
-		    } else {
-			first = p;
-			p->prev = NULL;
-		    }
-		    p->next = NULL;
-		    last = p;
+		    RADEONSortModes(&p, &first, &last);
 		}
 	    }
 
@@ -558,12 +542,7 @@ int RADEONValidateFPModes(ScrnInfoPtr pS
 
 	new->type      |= M_T_USERDEF;
 
-	new->next       = NULL;
-	new->prev       = last;
-
-	if (last) last->next = new;
-	last = new;
-	if (!first) first = new;
+	RADEONSortModes(&new, &first, &last);
 
 	pScrn->display->virtualX =
 	    pScrn->virtualX = MAX(pScrn->virtualX, width);
@@ -609,12 +588,7 @@ int RADEONValidateFPModes(ScrnInfoPtr pS
 
 		new->type      |= M_T_DEFAULT;
 
-		new->next       = NULL;
-		new->prev       = last;
-
-		if (last) last->next = new;
-		last = new;
-		if (!first) first = new;
+		RADEONSortModes(&new, &first, &last);
 	    }
 	}
     }
diff-tree 3a8190ccc79969925257e7b980b78d79053d208d (from 9b1e97284ce185d358ca756a235d2cee346fa53f)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Wed Apr 4 09:47:07 2007 +0200

    radeon: Don't shrink virtual size based on secondary modes.

diff --git a/src/radeon_mergedfb.c b/src/radeon_mergedfb.c
index 820ba4b..6a7745e 100644
--- a/src/radeon_mergedfb.c
+++ b/src/radeon_mergedfb.c
@@ -581,8 +581,10 @@ RADEONRecalcDefaultVirtualSize(ScrnInfoP
   	               info->CRT1XOffs = info->CRT2XOffs = 0;
   	               maxh -= (info->CRT1XOffs + info->CRT2XOffs);
   	}
-  	pScrn->virtualX = maxh;
-  	pScrn->displayWidth = maxh;
+	if (maxh > pScrn->virtualX)
+	    pScrn->virtualX = maxh;
+	if (maxh > pScrn->displayWidth)
+	    pScrn->displayWidth = maxh;
   	xf86DrvMsg(pScrn->scrnIndex, X_PROBED, str, "width", maxh);
     } else {
   	if(maxh < pScrn->display->virtualX) {
@@ -592,7 +594,8 @@ RADEONRecalcDefaultVirtualSize(ScrnInfoP
     }
 
     if(!(pScrn->display->virtualY)) {
-        pScrn->virtualY = maxv;
+	if (maxv > pScrn->virtualY)
+	    pScrn->virtualY = maxv;
 	xf86DrvMsg(pScrn->scrnIndex, X_PROBED, str, "height", maxv);
     } else {
 	if(maxv < pScrn->display->virtualY) {



More information about the xorg-commit mailing list