Subject: port-amiga/1939: grful driver checks for default_mon >= max_mon, but should be >
To: None <gnats-bugs@gnats.netbsd.org>
From: None <kjk@sliphost1112.uni-trier.de>
List: netbsd-bugs
Date: 01/13/1996 20:24:40
>Number:         1939
>Category:       port-amiga
>Synopsis:       grful driver checks for default_mon >= max_mon, but should be >
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 13 18:05:01 1996
>Last-Modified:
>Originator:     Klaus Klein
>Organization:
Computing Center, University of Trier, Germany
>Release:        960112
>Environment:
System: NetBSD sliphost1112.uni-trier.de 1.1A NetBSD 1.1A (SLIPHOST1112) #0: Sat Jan 13 19:15:23 MET 1996 kjk@sliphost1112.uni-trier.de:/home/kjk/sys/arch/amiga/compile/SLIPHOST1112 amiga


>Description:
When setting the default videomode at boot time, the grful driver evaluates
_ulowell_default_mon >= _ulowell_mon_max to ensure that a the display chosen at
compile time is still in the bounds of the array _ul_monitor_defs. Due to that,
when having a '_ulowell_default_mon == _ulowell_max_mon' condition, grfulattach()
decides to give you the 1st mode described in _ul_monitor_defs.

This happens in grfulattach() only; using /usr/sbin/videomode works.
>How-To-Repeat:
When using the distributed version of grf_ul.c, put
'options "ULOWELL_DEFAULT_MON=7"' in your kernel config file. After booting, the
2410 Board will come up with mode 1.
>Fix:
Index: grf_ul.c
===================================================================
RCS file: /usr/local/cvsroot/src/sys/arch/amiga/dev/grf_ul.c,v
retrieving revision 1.1.1.1
diff -b -c -r1.1.1.1 grf_ul.c
*** grf_ul.c	1996/01/05 15:11:25	1.1.1.1
--- grf_ul.c	1996/01/13 18:53:58
***************
*** 471,477 ****
  #ifdef ULOWELLCONSOLE
  	if (amiga_realconfig == 0 || ulconunit != cfp->cf_unit) {
  #endif
! 		if ((unsigned)ulowell_default_mon >= ulowell_mon_max)
  			ulowell_default_mon = 1;
  
  		current_mon = ul_monitor_defs + ulowell_default_mon - 1;
--- 471,477 ----
  #ifdef ULOWELLCONSOLE
  	if (amiga_realconfig == 0 || ulconunit != cfp->cf_unit) {
  #endif
! 		if ((unsigned)ulowell_default_mon > ulowell_mon_max)
  			ulowell_default_mon = 1;
  
  		current_mon = ul_monitor_defs + ulowell_default_mon - 1;
>Audit-Trail:
>Unformatted: