Subject: kern/6655: pci/tga driver ioctl goofs
To: None <gnats-bugs@gnats.netbsd.org>
From: Brett Slager <bds@snarf.thnet.com>
List: netbsd-bugs
Date: 12/27/1998 01:41:03
>Number:         6655
>Category:       kern
>Synopsis:       a few mistakes in the NWSCONSified tga driver
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 26 22:50:01 1998
>Last-Modified:
>Originator:     Brett Slager
>Organization:
>Release:        NetBSD-current Dec 26, 1998
>Environment:
>Description:
	The sense of two ioctls are wrong, and a #define/#undef pair
	doesn't match
>How-To-Repeat:
	inspect code
>Fix:
*** /usera/netbsd/src/sys/dev/pci/tga.c	Fri Nov 20 07:25:29 1998
--- tga.c	Sun Dec 27 01:05:42 1998
***************
*** 371,377 ****
  		wsd_fbip->width = sc->sc_dc->dc_wid;
  		wsd_fbip->depth = sc->sc_dc->dc_tgaconf->tgac_phys_depth;
  		wsd_fbip->cmsize = 256;		/* XXX ??? */
! #undef fbt
  		return (0);
  
  	case WSDISPLAYIO_GETCMAP:
--- 371,377 ----
  		wsd_fbip->width = sc->sc_dc->dc_wid;
  		wsd_fbip->depth = sc->sc_dc->dc_tgaconf->tgac_phys_depth;
  		wsd_fbip->cmsize = 256;		/* XXX ??? */
! #undef wsd_fbip
  		return (0);
  
  	case WSDISPLAYIO_GETCMAP:
***************
*** 382,395 ****
  		return (*tgar->tgar_set_cmap)(dc,
  		    (struct wsdisplay_cmap *)data);
  
! 	case WSDISPLAYIO_GVIDEO:
  		if (*(u_int *)data == WSDISPLAYIO_VIDEO_OFF)
  			tga_blank(sc->sc_dc);
  		else
  			tga_unblank(sc->sc_dc);
  		return (0);
  
! 	case WSDISPLAYIO_SVIDEO:
  		*(u_int *)data = dc->dc_blanked ?
  		    WSDISPLAYIO_VIDEO_OFF : WSDISPLAYIO_VIDEO_ON;
  		return (0);
--- 382,395 ----
  		return (*tgar->tgar_set_cmap)(dc,
  		    (struct wsdisplay_cmap *)data);
  
! 	case WSDISPLAYIO_SVIDEO:
  		if (*(u_int *)data == WSDISPLAYIO_VIDEO_OFF)
  			tga_blank(sc->sc_dc);
  		else
  			tga_unblank(sc->sc_dc);
  		return (0);
  
! 	case WSDISPLAYIO_GVIDEO:
  		*(u_int *)data = dc->dc_blanked ?
  		    WSDISPLAYIO_VIDEO_OFF : WSDISPLAYIO_VIDEO_ON;
  		return (0);
>Audit-Trail:
>Unformatted: