NetBSD Problem Report #29167

From feyrer@rfhinf045.fh-regensburg.de  Mon Jan 31 02:26:33 2005
Return-Path: <feyrer@rfhinf045.fh-regensburg.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.netbsd.org (Postfix) with ESMTP id 2D91663B845
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 31 Jan 2005 02:26:33 +0000 (UTC)
Message-Id: <200412110038.iBB0cZV9006132@vulab.fh-regensburg.de>
Date: Sat, 11 Dec 2004 01:38:35 +0100 (CET)
From: hubert@feyrer.de
To: gnats-bugs@netbsd.org
Subject: WSDISPLAY_CHARFUNCS non-functional with VGA_RASTERCONSOLE
X-Send-Pr-Version: 3.95

>Number:         29167
>Category:       kern
>Synopsis:       WSDISPLAY_CHARFUNCS non-functional with VGA_RASTERCONSOLE
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 31 02:27:00 +0000 2005
>Last-Modified:  Tue Feb 01 13:36:11 +0000 2005
>Originator:     hubert@feyrer.de
>Release:        NetBSD 2.0
>Organization:
Hubert Feyrer <hubertf@channel.regensburg.org>
>Environment:


System: NetBSD vulab.fh-regensburg.de 2.0 NetBSD 2.0 (GENERIC) #10: Sun Oct 3 01:59:02 CEST 2004 feyrer@vulab.fh-regensburg.de:/disk4/cvs/src-2.0/sys/arch/i386/compile/obj.i386/GENERIC i386
Architecture: i386
Machine: i386
>Description:
	I enabled WSDISPLAY_CHARFUNCS and WSDISPLAY_SCROLLSUPPORT
	options in my kernel, and always wondered why they didn't work.
	After some debugging today, and with a hint from Klaus Klein,
	I found the problem is that I also have VGA_RASTERCONSOLE
	enabled.

	Looking into this wsmoused failure:
	wsmoused: ioctl(WSDISPLAYIO_GETWSCHAR) failed: Invalid argument

	This error comes up if the 'accessops' structure for a 
	driver doesn't set the 'getwschar' value properly. 
	The vga_accessops (in sys/dev/ic/vga.c) is initialized
	properly:

		const struct wsdisplay_accessops vga_accessops = {
			vga_ioctl,
			vga_mmap,
			vga_alloc_screen,
			vga_free_screen,
			vga_show_screen,
			vga_load_font,
			NULL,
		#ifdef WSDISPLAY_CHARFUNCS
			vga_getwschar,
			vga_putwschar,
		#else /* WSDISPLAY_CHARFUNCS */
			NULL,
			NULL,
		#endif /* WSDISPLAY_CHARFUNCS */
		#ifdef WSDISPLAY_SCROLLSUPPORT
			vga_scroll,
		#else
			NULL,
		#endif
		};      


	vga_raster_accessops struct in sys/dev/ic/vga_raster.c
	doesn't even initialize the struct completely:

		const struct wsdisplay_accessops vga_raster_accessops = {
			vga_raster_ioctl,
			vga_raster_mmap,
			vga_raster_alloc_screen, 
			vga_raster_free_screen,
			vga_raster_show_screen,
			vga_raster_load_font,
		}; 

	It would be best to fix vga_raster.c to properly implement
	the missing functions (possibly using the ones from vga.c?),
	or if that's not possible bring _some_ warning/error if
	VGA_RASTERCONSOLE is used in conjunction with either
	WSDISPLAY_CHARFUNCS and/or WSDISPLAY_SCROLLSUPPORT.

	I guess the "console scrolling doesn't work" problems I
	have originate from this too (untested).


>How-To-Repeat:
	Have a kernel with VGA_RASTERCONSOLE and WSDISPLAY_CHARFUNCS
	Start wsmoused
	See it fail:
		wsmoused: ioctl(WSDISPLAYIO_GETWSCHAR) failed: Invalid argument

	Inspect code, see that it fails in wsdisplay.c, line 1127+:

			if (!sc->sc_accessops->getwschar)
				return (EINVAL);

	Continue debugging, and find that your sc_accessops
		doesn't have 'getwschar' etc. set.

	Next, find that 'getwschar' is set for vga.c, but not for
		vga_raster.c. Curse.

>Fix:
	It would be best to fix vga_raster.c to properly implement
	the missing functions (possibly using the ones from vga.c?),
	or if that's not possible bring _some_ warning/error if
	VGA_RASTERCONSOLE is used in conjunction with either
	WSDISPLAY_CHARFUNCS and/or WSDISPLAY_SCROLLSUPPORT, see above.

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: feyrer@rfhinf045.fh-regensburg.de
Subject: Re: kern/29167: WSDISPLAY_CHARFUNCS non-functional with VGA_RASTERCONSOLE
Date: Mon, 31 Jan 2005 07:52:41 +0100

 On Mon, Jan 31, 2005 at 02:27:00AM +0000, feyrer@rfhinf045.fh-regensburg.de wrote:
 > 	It would be best to fix vga_raster.c to properly implement
 > 	the missing functions (possibly using the ones from vga.c?),

 It is not possible to reuse the pcdisplay_{put,get}wschar functions
 here, but it should be easy to implement those access ops using the
 "mem" and "type" members of struct vgascreen.

 While there, not only vga_raster.c has this problem - probably all other
 graphical frame buffer drivers in the tree have not been updated when the
 scrolling support went in.

 Martin

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.