Subject: Re: Console drivers
To: None <port-macppc@NetBSD.ORG>
From: Marco <marco2z@arsystel.com>
List: port-macppc
Date: 11/14/2006 23:25:46
------=_20061114232546_45334
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

"Marco Trillo" wrote:
> I tried to fix this, a diff to the 'radeonfb.c' file is attached
> (hopefully Gmail won't base64-encode the patch).

It did... Sorry for the previous base64 stuff :-( .
This time is attached as text/plain only.

-------
Marco


------=_20061114232546_45334
Content-Type: text/plain; name="radeonfb.diff.txt"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="radeonfb.diff.txt"

Index: radeonfb.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/radeonfb.c,v
retrieving revision 1.6
diff -u -r1.6 radeonfb.c
--- radeonfb.c	7 Oct 2006 21:36:12 -0000	1.6
+++ radeonfb.c	14 Nov 2006 21:36:34 -0000
@@ -716,22 +716,34 @@
 		/* for text mode, we pick a resolution that won't
 		 * require panning */
 		radeonfb_pickres(dp, &dp->rd_virtx, &dp->rd_virty, 0);
-
-		aprint_normal("%s: display %d: "
-		    "virtual resolution %dx%d at %d bpp\n",
-		    XNAME(sc), i, dp->rd_virtx, dp->rd_virty, dp->rd_bpp);
+		DPRINTF(("radeonfb_pickres picked %dx%d\n", dp->rd_virtx,
+				 dp->rd_virty));
 
 		/* now select the *video mode* that we will use */
 		for (j = 0; j < dp->rd_ncrtcs; j++) {
 			const struct videomode *vmp;
 			vmp = radeonfb_port_mode(dp->rd_crtcs[j].rc_port,
 			    dp->rd_virtx, dp->rd_virty);
+			
+			/*
+			 * make sure we use the largest virtual resolution, 
+			 * the smaller monitor will pan
+			 */
+			if (dp->rd_virtx < vmp->hdisplay || 
+			    dp->rd_virty < vmp->vdisplay) {
+			    dp->rd_virtx = vmp->hdisplay;
+			    dp->rd_virty = vmp->vdisplay;
+			}
 			dp->rd_crtcs[j].rc_videomode = *vmp;
 			printf("%s: port %d: physical %dx%d %dHz\n",
 			    XNAME(sc), j, vmp->hdisplay, vmp->vdisplay,
 			    DIVIDE(DIVIDE(vmp->dot_clock * 1000,
 				       vmp->htotal), vmp->vtotal));
 		}
+		
+		aprint_normal("%s: display %d: " 
+                    "virtual resolution %dx%d at %d bpp\n", 
+                    XNAME(sc), i, dp->rd_virtx, dp->rd_virty, dp->rd_bpp);
 
 		/* N.B.: radeon wants 64-byte aligned stride */
 		dp->rd_stride = dp->rd_virtx * dp->rd_bpp / 8;
------=_20061114232546_45334--