summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authormacallan <macallan@NetBSD.org>2008-06-01 16:43:53 +0000
committermacallan <macallan@NetBSD.org>2008-06-01 16:43:53 +0000
commit01dee7feb2a84183120216ef2af2aa3890f1a044 (patch)
tree38a53afed1e771eb56cb253b3512bf838d68927e /sys
parent57b01795440cedefa99d08ea1f1ca85d994b9671 (diff)
adjust virtual resolution to preferred mode if available
From Marco Trillo
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/radeonfb.c52
1 files changed, 34 insertions, 18 deletions
diff --git a/sys/dev/pci/radeonfb.c b/sys/dev/pci/radeonfb.c
index c0ef7ee6337..ecd7513ac12 100644
--- a/sys/dev/pci/radeonfb.c
+++ b/sys/dev/pci/radeonfb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: radeonfb.c,v 1.28 2008/05/05 11:42:45 jmcneill Exp $ */
+/* $NetBSD: radeonfb.c,v 1.29 2008/06/01 16:43:53 macallan Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.28 2008/05/05 11:42:45 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.29 2008/06/01 16:43:53 macallan Exp $");
#define RADEONFB_DEFAULT_DEPTH 32
@@ -1594,7 +1594,6 @@ nobios:
if (edid_parse(edid, eip) == 0) {
sc->sc_ports[i].rp_edid_valid = 1;
- edid_print(eip);
}
}
/* if we didn't find any we'll try to talk to the monitor */
@@ -3332,21 +3331,38 @@ radeonfb_pickres(struct radeonfb_display *dp, uint16_t *x, uint16_t *y,
continue;
if (!valid) {
- /* initialize starting list */
- for (j = 0; j < ep->edid_nmodes; j++) {
- /*
- * ignore resolutions that are
- * too big for the radeon
- */
- if (ep->edid_modes[j].hdisplay >
- dp->rd_softc->sc_maxx)
- continue;
- if (ep->edid_modes[j].vdisplay >
- dp->rd_softc->sc_maxy)
- continue;
-
- modes[nmodes] = ep->edid_modes[j];
- nmodes++;
+ /*
+ * Pick the preferred mode for this port
+ * if available.
+ */
+ if (ep->edid_preferred_mode) {
+ struct videomode *vmp =
+ ep->edid_preferred_mode;
+
+ if ((vmp->hdisplay <=
+ dp->rd_softc->sc_maxx) &&
+ (vmp->vdisplay <=
+ dp->rd_softc->sc_maxy))
+ modes[nmodes++] = *vmp;
+ } else {
+
+ /* initialize starting list */
+ for (j = 0; j < ep->edid_nmodes; j++) {
+ /*
+ * ignore resolutions that are
+ * too big for the radeon
+ */
+ if (ep->edid_modes[j].hdisplay >
+ dp->rd_softc->sc_maxx)
+ continue;
+ if (ep->edid_modes[j].vdisplay >
+ dp->rd_softc->sc_maxy)
+ continue;
+
+ modes[nmodes] =
+ ep->edid_modes[j];
+ nmodes++;
+ }
}
valid = 1;
} else {