Arrange things so that if MONITOR isn't defined in the kernel configration,
we use the standard mode list from videomode.c rather than one generated by makemodes.awk. This is less useful than it might be since without a useful frame rate from the bootloader we're likely to end up choosing a screen mode that's either flickery or too fast for the monitor (or DRAM bandwidth).
This commit is contained in:
parent
4ba9b09748
commit
9dc302fec2
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: Makefile.acorn32,v 1.18 2005/12/11 12:16:05 christos Exp $
|
||||
# $NetBSD: Makefile.acorn32,v 1.19 2006/08/19 13:34:15 bjh21 Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
|
@ -51,16 +51,22 @@ MD_SFILES= ${ARM}/arm32/locore.S
|
|||
locore.o: ${ARM}/arm32/locore.S assym.h
|
||||
${NORMAL_S}
|
||||
|
||||
.ifdef MONITOR
|
||||
MD_OBJS+= modedefs.o
|
||||
MD_CFILES+= modedefs.c
|
||||
|
||||
.ifdef MONITOR
|
||||
modedefs.c: ${ARM}/iomd/makemodes.awk ${ACORN32}/conf/monitors/${MONITOR} Makefile
|
||||
${_MKTARGET_CREATE}
|
||||
awk -f ${ARM}/iomd/makemodes.awk ${ACORN32}/conf/monitors/${MONITOR} ${MODES} >modedefs.c
|
||||
.else
|
||||
modedefs.c: ${ARM}/iomd/makemodes.awk Makefile
|
||||
${_MKTARGET_CREATE}
|
||||
awk -f ${ARM}/iomd/makemodes.awk >modedefs.c
|
||||
.endif
|
||||
|
||||
modedefs.o: modedefs.c
|
||||
${NORMAL_C}
|
||||
.endif
|
||||
|
||||
|
||||
##
|
||||
## (5) link settings
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: files.iomd,v 1.17 2006/08/14 22:33:37 bjh21 Exp $
|
||||
# $NetBSD: files.iomd,v 1.18 2006/08/19 13:34:15 bjh21 Exp $
|
||||
#
|
||||
# IOMD-specific configuration data
|
||||
#
|
||||
|
@ -45,7 +45,8 @@ file arch/arm/iomd/vidc20.c vidc
|
|||
file arch/arm/iomd/console/consinit.c vidc
|
||||
|
||||
# VIDC video wscons device
|
||||
device vidcvideo: rasops4, rasops8, rasops16, rasops32, wsemuldisplaydev
|
||||
device vidcvideo: rasops4, rasops8, rasops16, rasops32, wsemuldisplaydev,
|
||||
videomode
|
||||
attach vidcvideo at vidc
|
||||
file arch/arm/iomd/vidc20config.c vidcvideo needs-flag
|
||||
file arch/arm/iomd/vidcvideo.c vidcvideo needs-flag
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: vidc20config.c,v 1.25 2006/08/19 11:01:56 bjh21 Exp $ */
|
||||
/* $NetBSD: vidc20config.c,v 1.26 2006/08/19 13:34:15 bjh21 Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Reinoud Zandijk
|
||||
|
@ -48,7 +48,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: vidc20config.c,v 1.25 2006/08/19 11:01:56 bjh21 Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: vidc20config.c,v 1.26 2006/08/19 13:34:15 bjh21 Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
|
@ -296,6 +296,8 @@ vidcvideo_getmode(struct vidc_mode *mode)
|
|||
static int
|
||||
vidcvideo_coldinit(void)
|
||||
{
|
||||
struct videomode const *modes;
|
||||
int count;
|
||||
int found;
|
||||
int i;
|
||||
unsigned framerate;
|
||||
|
@ -322,35 +324,39 @@ vidcvideo_coldinit(void)
|
|||
|
||||
dispend = dispstart+dispsize;
|
||||
|
||||
if (vidc_videomode_count > 0) {
|
||||
modes = vidc_videomode_list;
|
||||
count = vidc_videomode_count;
|
||||
} else {
|
||||
modes = videomode_list;
|
||||
count = videomode_count;
|
||||
}
|
||||
|
||||
/* try to find the current mode from the bootloader in my table */
|
||||
vidc_currentmode.timings = vidc_videomode_list[0];
|
||||
vidc_currentmode.timings = modes[0];
|
||||
found = 0;
|
||||
for (i = 0; i < vidc_videomode_count; i++) {
|
||||
for (i = 0; i < count; i++) {
|
||||
/*
|
||||
* We jump through a few hoops here to ensure that we
|
||||
* round roughly to the nearest integer without too
|
||||
* much danger of overflow.
|
||||
*/
|
||||
framerate = (vidc_videomode_list[i].dot_clock * 1000 /
|
||||
vidc_videomode_list[i].htotal * 2 /
|
||||
vidc_videomode_list[i].vtotal + 1) / 2;
|
||||
if (vidc_videomode_list[i].hdisplay == bootconfig.width + 1
|
||||
&& vidc_videomode_list[i].vdisplay == bootconfig.height + 1
|
||||
framerate = (modes[i].dot_clock * 1000 /
|
||||
modes[i].htotal * 2 / modes[i].vtotal + 1) / 2;
|
||||
if (modes[i].hdisplay == bootconfig.width + 1
|
||||
&& modes[i].vdisplay == bootconfig.height + 1
|
||||
&& framerate == bootconfig.framerate) {
|
||||
vidc_currentmode.timings = vidc_videomode_list[i];
|
||||
vidc_currentmode.timings = modes[i];
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* if not found choose first mode but dont be picky on the framerate */
|
||||
if (!found) {
|
||||
for (i = 0; i < vidc_videomode_count; i++) {
|
||||
if (vidc_videomode_list[i].hdisplay ==
|
||||
bootconfig.width + 1
|
||||
&& vidc_videomode_list[i].vdisplay ==
|
||||
bootconfig.height + 1) {
|
||||
vidc_currentmode.timings =
|
||||
vidc_videomode_list[i];
|
||||
for (i = 0; i < count; i++) {
|
||||
if (modes[i].hdisplay == bootconfig.width + 1
|
||||
&& modes[i].vdisplay == bootconfig.height + 1) {
|
||||
vidc_currentmode.timings = modes[i];
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: vidcvideo.c,v 1.27 2006/08/17 22:33:59 bjh21 Exp $ */
|
||||
/* $NetBSD: vidcvideo.c,v 1.28 2006/08/19 13:34:15 bjh21 Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Reinoud Zandijk
|
||||
|
@ -36,7 +36,7 @@
|
|||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: vidcvideo.c,v 1.27 2006/08/17 22:33:59 bjh21 Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: vidcvideo.c,v 1.28 2006/08/19 13:34:15 bjh21 Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -370,7 +370,7 @@ vidcvideo_attach(struct device *parent, struct device *self, void *aux)
|
|||
dc = sc->sc_dc;
|
||||
|
||||
vidcvideo_printdetails();
|
||||
printf(": using %d x %d, %dbpp\n", dc->dc_wid, dc->dc_ht,
|
||||
printf(": mode %s, %dbpp\n", dc->mode_info.timings.name,
|
||||
dc->dc_depth);
|
||||
|
||||
/* initialise rasops */
|
||||
|
|
Loading…
Reference in New Issue