Subject: port-amiga/1700: grf_ul.c additions for GRFIOCBLANK support
To: None <gnats-bugs@gnats.netbsd.org>
From: Ignatios Souvatzis <is@beverly.rhein.de>
List: netbsd-bugs
Date: 10/27/1995 11:32:49
>Number:         1700
>Category:       port-amiga
>Synopsis:       grf_ul.c addition for GRFIOCBLANK support
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 27 07:35:02 1995
>Last-Modified:
>Originator:     Ignatios Souvatzis
>Organization:
	Kernel Hackers 'R' Us
>Release:        951018
>Environment:
System: NetBSD beverly 1.1_ALPHA NetBSD 1.1_ALPHA (BEVERLY) #248: Fri Oct 27 11:11:16 MET 1995 is@beverly:/usr/src/sys/arch/amiga/compile/BEVERLY amiga


>Description:
	support for the newly introduced GRFIOCBLANK ioctl.
>How-To-Repeat:
	
>Fix:
add this:

Index: grf_ul.c
===================================================================
RCS file: /monster/cvs/src/sys/arch/amiga/dev/grf_ul.c,v
retrieving revision 1.7
diff -c -r1.7 grf_ul.c
*** grf_ul.c	1995/10/22 11:39:51	1.7
--- grf_ul.c	1995/10/27 10:09:06
***************
*** 59,64 ****
--- 59,65 ----
  int ul_getcmap __P((struct grf_softc *, struct grf_colormap *, dev_t));
  int ul_putcmap __P((struct grf_softc *, struct grf_colormap *, dev_t));
  int ul_bitblt __P((struct grf_softc *, struct grf_bitblt *, dev_t));
+ int ul_blank __P((struct grf_softc *, int *, dev_t));
  
  /*
   * marked true early so that ulowell_cnprobe() can tell if we are alive. 
***************
*** 721,726 ****
--- 722,730 ----
  
  	case GRFIOCBITBLT:
  		return ul_bitblt (gp, (struct grf_bitblt *) data, dev);
+ 
+ 	case GRFIOCBLANK:
+ 		return ul_blank (gp, (int *) data, dev);
  	}
  
  	return EINVAL;
***************
*** 840,845 ****
--- 844,867 ----
  	return 0;
  }
  
+ int
+ ul_blank(gp, onoff, dev)
+ 	struct grf_softc *gp;
+ 	int *onoff;
+ 	dev_t dev;
+ {
+ 	struct gspregs *gsp;
+ 	gsp = (struct gspregs *)gp->g_regkva;
+ 	gsp->ctrl = (gsp->ctrl & ~(INCR|INCW) | LBL);
+ 	gsp->hstadrh = 0xC000;
+ 	gsp->hstadrl = 0x0080;
+ 	if (*onoff)
+ 		gsp->data |= 0x9000;
+ 	else
+ 		gsp->data &= ~0x9000;
+ 		
+ 	return 0;
+ }
  /*
   * !!! THIS AREA UNDER CONSTRUCTION !!!
   */
>Audit-Trail:
>Unformatted:
Ignatios Souvatzis