Subject: kern/35146: minor fix for sys/dev/pci/radeonfb.c
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <ggm@apnic.net>
List: netbsd-bugs
Date: 11/28/2006 01:45:00
>Number:         35146
>Category:       kern
>Synopsis:       minor fix to let radeonfb.c compile
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 28 01:45:00 +0000 2006
>Originator:     George Michaelson
>Release:        NetBSD 4.99.4
>Organization:
George Michaelson                      email:           ggm@apnic.net
Senior Technical Officer, APNIC          sip:      ggm@voip.apnic.net
http://www.apnic.net                   phone:         +61 7 3858 3100
>Environment:
	
	
System: NetBSD garlique.algebras.org 4.99.4 NetBSD 4.99.4 (GGM_ACPI) #0: Mon Nov 27 14:09:26 EST 2006 ggm@garlique.algebras.org:/data/Build/obj/usr/src/sys/arch/i386/compile/GGM_ACPI i386
Architecture: i386
Machine: i386
>Description:
	radeonfb.c was written by Garret D'Amore to do a radeon framebuffer.
	its not really in live use, and has suffered minor drift as some
	kernel code in wsconsole space has changed.
	
	also, it pre-dates -Wall and so had a minor complaint about
	an unsigned int comparison. I've brute-forced this with a
	change from x=y to x<=y which still works, but makes too much
	if (...) then ... logic be done. 
	
>How-To-Repeat:
	
>Fix:
	
--- sys/dev/pci/radeonfb.c.dist	2006-11-03 15:57:07.000000000 +1000
+++ sys/dev/pci/radeonfb.c	2006-11-03 16:09:27.000000000 +1000
@@ -204,7 +204,7 @@
 	{ 32,	2048, 1536, 32, 2 },
 	{ 16,	1600, 1200, 32, 2 },
 	{ 8,	1600, 1200, 32, 1 },
-	{ 0,	0, 0, 0 },
+	{ 0,	0, 0, 0, 0 },
 };
 
 static struct wsscreen_descr radeonfb_stdscreen = {
@@ -212,7 +212,8 @@
 	0, 0,		/* ncols, nrows */
 	NULL,		/* textops */
 	8, 16,		/* fontwidth, fontheight */
-	WSSCREEN_WSCOLORS,
+	WSSCREEN_WSCOLORS, /* capabilities */
+	0,		/* modecookie */
 };
 
 struct wsdisplay_accessops radeonfb_accessops = {
@@ -221,7 +222,9 @@
 	NULL,		/* vcons_alloc_screen */
 	NULL,		/* vcons_free_screen */
 	NULL,		/* vcons_show_screen */
-	NULL		/* load_font */
+	NULL,		/* load_font */
+	NULL,		/* pollc */
+	NULL,		/* scroll */
 };
 
 static struct {
@@ -2823,11 +2826,11 @@
 		nc.rc_pos = wc->pos;
 		if (nc.rc_pos.x >= dp->rd_virtx)
 			nc.rc_pos.x = dp->rd_virtx - 1;
-		if (nc.rc_pos.x < 0)
+		if (nc.rc_pos.x <= 0)
 			nc.rc_pos.x = 0;
 		if (nc.rc_pos.y >= dp->rd_virty)
 			nc.rc_pos.y = dp->rd_virty - 1;
-		if (nc.rc_pos.y < 0)
+		if (nc.rc_pos.y <= 0)
 			nc.rc_pos.y = 0;
 	}
 	if (flags & WSDISPLAY_CURSOR_DOCUR) {

>Unformatted: