CVS commit: src/sys/dev/sun

2024-02-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Feb 13 13:46:14 UTC 2024

Modified Files:
src/sys/dev/sun: sireg.h

Log Message:
Add the Sun3 obio flavor's DMA controller access registers.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/sun/sireg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2024-02-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Feb 13 13:46:14 UTC 2024

Modified Files:
src/sys/dev/sun: sireg.h

Log Message:
Add the Sun3 obio flavor's DMA controller access registers.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/sun/sireg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/sireg.h
diff -u src/sys/dev/sun/sireg.h:1.1 src/sys/dev/sun/sireg.h:1.2
--- src/sys/dev/sun/sireg.h:1.1	Tue Feb 13 05:35:13 2024
+++ src/sys/dev/sun/sireg.h	Tue Feb 13 13:46:14 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sireg.h,v 1.1 2024/02/13 05:35:13 thorpej Exp $	*/
+/*	$NetBSD: sireg.h,v 1.2 2024/02/13 13:46:14 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -54,7 +54,9 @@ struct si_regs {
 	u_short	dma_counth;	/* DMA count   (VME only) */
 	u_short	dma_countl;	/* (high word, low word)  */
 
-	u_int	pad0;		/* no-existent register */
+	/* AMD 9516 regs (OBIO only) see am9516.h */
+	u_short udc_data;	/* Am9516, reg data (OBIO only) */
+	u_short udc_addr;	/* Am9516, reg addr (OBIO only) */
 
 	u_short	fifo_data;	/* fifo data register */
 	u_short	fifo_count;	/* fifo count register */
@@ -83,6 +85,8 @@ struct si_regs {
 #define SIREG_DMA_ADDRL	(NCR5380REGS_SZ + 2)	/* DMA address, low word */
 #define SIREG_DMA_CNTH	(NCR5380REGS_SZ + 4)	/* DMA count, high word */
 #define SIREG_DMA_CNTL	(NCR5380REGS_SZ + 6)	/* DMA count, low word */
+#define SIREG_UDC_DATA	(NCR5380REGS_SZ + 8)	/* UDC reg data */
+#define SIREG_UDC_ADDR	(NCR5380REGS_SZ + 10)	/* UDC reg addr */
 #define SIREG_FIFO_DATA	(NCR5380REGS_SZ + 12)	/* FIFO data */
 #define SIREG_FIFO_CNT	(NCR5380REGS_SZ + 14)	/* FIFO count, low word */
 #define SIREG_CSR	(NCR5380REGS_SZ + 16)	/* Control/status register */



CVS commit: src/sys/dev/sun

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:47:55 UTC 2022

Modified Files:
src/sys/dev/sun: sunkbd.c

Log Message:
sunkbd(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/sun/sunkbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/sunkbd.c
diff -u src/sys/dev/sun/sunkbd.c:1.31 src/sys/dev/sun/sunkbd.c:1.32
--- src/sys/dev/sun/sunkbd.c:1.31	Sun Sep 25 21:30:29 2022
+++ src/sys/dev/sun/sunkbd.c	Wed Oct 26 23:47:55 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunkbd.c,v 1.31 2022/09/25 21:30:29 thorpej Exp $	*/
+/*	$NetBSD: sunkbd.c,v 1.32 2022/10/26 23:47:55 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -51,7 +51,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunkbd.c,v 1.31 2022/09/25 21:30:29 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunkbd.c,v 1.32 2022/10/26 23:47:55 riastradh Exp $");
 
 #include 
 #include 
@@ -301,8 +301,8 @@ sunkbd_write_data(struct kbd_sun_softc *
 {
 	struct tty *tp = k->k_priv;
 
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	ttyoutput(c, tp);
 	ttstart(tp);
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 }



CVS commit: src/sys/dev/sun

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:47:55 UTC 2022

Modified Files:
src/sys/dev/sun: sunkbd.c

Log Message:
sunkbd(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/sun/sunkbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2022-09-25 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Sep 25 21:30:29 UTC 2022

Modified Files:
src/sys/dev/sun: bwtwo.c cgsix.c cgthree.c kbd_zs.c sunkbd.c

Log Message:
Remove unnecessary include of .


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/sun/bwtwo.c
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/sun/cgsix.c
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/sun/cgthree.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/sun/kbd_zs.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/sun/sunkbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/bwtwo.c
diff -u src/sys/dev/sun/bwtwo.c:1.38 src/sys/dev/sun/bwtwo.c:1.39
--- src/sys/dev/sun/bwtwo.c:1.38	Sat Aug  7 16:19:16 2021
+++ src/sys/dev/sun/bwtwo.c	Sun Sep 25 21:30:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bwtwo.c,v 1.38 2021/08/07 16:19:16 thorpej Exp $ */
+/*	$NetBSD: bwtwo.c,v 1.39 2022/09/25 21:30:29 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -79,13 +79,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.38 2021/08/07 16:19:16 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.39 2022/09/25 21:30:29 thorpej Exp $");
 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.71 src/sys/dev/sun/cgsix.c:1.72
--- src/sys/dev/sun/cgsix.c:1.71	Thu Apr 28 03:12:03 2022
+++ src/sys/dev/sun/cgsix.c	Sun Sep 25 21:30:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.71 2022/04/28 03:12:03 macallan Exp $ */
+/*	$NetBSD: cgsix.c,v 1.72 2022/09/25 21:30:29 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,14 +78,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.71 2022/04/28 03:12:03 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.72 2022/09/25 21:30:29 thorpej Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Index: src/sys/dev/sun/cgthree.c
diff -u src/sys/dev/sun/cgthree.c:1.35 src/sys/dev/sun/cgthree.c:1.36
--- src/sys/dev/sun/cgthree.c:1.35	Sat Aug  7 16:19:16 2021
+++ src/sys/dev/sun/cgthree.c	Sun Sep 25 21:30:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgthree.c,v 1.35 2021/08/07 16:19:16 thorpej Exp $ */
+/*	$NetBSD: cgthree.c,v 1.36 2022/09/25 21:30:29 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,14 +38,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.35 2021/08/07 16:19:16 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.36 2022/09/25 21:30:29 thorpej Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Index: src/sys/dev/sun/kbd_zs.c
diff -u src/sys/dev/sun/kbd_zs.c:1.23 src/sys/dev/sun/kbd_zs.c:1.24
--- src/sys/dev/sun/kbd_zs.c:1.23	Sun Apr 20 15:44:01 2008
+++ src/sys/dev/sun/kbd_zs.c	Sun Sep 25 21:30:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kbd_zs.c,v 1.23 2008/04/20 15:44:01 tsutsui Exp $	*/
+/*	$NetBSD: kbd_zs.c,v 1.24 2022/09/25 21:30:29 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -53,14 +53,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kbd_zs.c,v 1.23 2008/04/20 15:44:01 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kbd_zs.c,v 1.24 2022/09/25 21:30:29 thorpej Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Index: src/sys/dev/sun/sunkbd.c
diff -u src/sys/dev/sun/sunkbd.c:1.30 src/sys/dev/sun/sunkbd.c:1.31
--- src/sys/dev/sun/sunkbd.c:1.30	Tue Oct 31 10:46:47 2017
+++ src/sys/dev/sun/sunkbd.c	Sun Sep 25 21:30:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunkbd.c,v 1.30 2017/10/31 10:46:47 martin Exp $	*/
+/*	$NetBSD: sunkbd.c,v 1.31 2022/09/25 21:30:29 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -51,14 +51,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunkbd.c,v 1.30 2017/10/31 10:46:47 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunkbd.c,v 1.31 2022/09/25 21:30:29 thorpej Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 



CVS commit: src/sys/dev/sun

2022-09-25 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Sep 25 21:30:29 UTC 2022

Modified Files:
src/sys/dev/sun: bwtwo.c cgsix.c cgthree.c kbd_zs.c sunkbd.c

Log Message:
Remove unnecessary include of .


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/sun/bwtwo.c
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/sun/cgsix.c
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/sun/cgthree.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/sun/kbd_zs.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/sun/sunkbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2022-04-27 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr 28 03:12:03 UTC 2022

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
be lazy about clearing the cursor - in most cases we're about to overwrite it
anyway. Same logic as with VCONS_DONT_READ.
visible speedup in things like systat and top


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.70 src/sys/dev/sun/cgsix.c:1.71
--- src/sys/dev/sun/cgsix.c:1.70	Sat Aug  7 16:19:16 2021
+++ src/sys/dev/sun/cgsix.c	Thu Apr 28 03:12:03 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.70 2021/08/07 16:19:16 thorpej Exp $ */
+/*	$NetBSD: cgsix.c,v 1.71 2022/04/28 03:12:03 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.70 2021/08/07 16:19:16 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.71 2022/04/28 03:12:03 macallan Exp $");
 
 #include 
 #include 
@@ -339,6 +339,23 @@ cg6_ras_init(struct cgsix_softc *sc)
 }
 
 static void
+cg6_ras_nuke_cursor(struct rasops_info *ri)
+{
+	struct vcons_screen *scr = ri->ri_hw;
+	struct cgsix_softc *sc = scr->scr_cookie;
+	int wi, he, x, y;
+		
+	if (ri->ri_flg & RI_CURSOR) {
+		wi = ri->ri_font->fontwidth;
+		he = ri->ri_font->fontheight;
+		x = ri->ri_ccol * wi + ri->ri_xorigin;
+		y = ri->ri_crow * he + ri->ri_yorigin;
+		cg6_invert(sc, x, y, wi, he);
+		ri->ri_flg &= ~RI_CURSOR;
+	}
+}
+
+static void
 cg6_ras_copyrows(void *cookie, int src, int dst, int n)
 {
 	struct rasops_info *ri = cookie;
@@ -362,6 +379,10 @@ cg6_ras_copyrows(void *cookie, int src, 
 		n = ri->ri_rows - dst;
 	if (n <= 0)
 		return;
+	if ((ri->ri_crow >= src && ri->ri_crow < (src + n)) &&
+	   (ri->ri_flg & RI_CURSOR)) {
+		cg6_ras_nuke_cursor(ri);
+	}
 	n *= ri->ri_font->fontheight;
 	src *= ri->ri_font->fontheight;
 	dst *= ri->ri_font->fontheight;
@@ -380,6 +401,8 @@ cg6_ras_copyrows(void *cookie, int src, 
 	fbc->fbc_x3 = ri->ri_xorigin + ri->ri_emuwidth - 1;
 	fbc->fbc_y3 = ri->ri_yorigin + dst + n - 1;
 	CG6_BLIT(fbc);
+	if (ri->ri_crow >= dst && ri->ri_crow < (dst + n))
+		ri->ri_flg &= ~RI_CURSOR;
 }
 
 static void
@@ -408,6 +431,11 @@ cg6_ras_copycols(void *cookie, int row, 
 		n = ri->ri_cols - dst;
 	if (n <= 0)
 		return;
+	if (ri->ri_crow == row && 
+	   (ri->ri_ccol >= src && ri->ri_ccol < (src + n)) &&
+	   (ri->ri_flg & RI_CURSOR)) {
+		cg6_ras_nuke_cursor(ri);
+	}
 	n *= ri->ri_font->fontwidth;
 	src *= ri->ri_font->fontwidth;
 	dst *= ri->ri_font->fontwidth;
@@ -429,6 +457,9 @@ cg6_ras_copycols(void *cookie, int row, 
 	fbc->fbc_y3 = ri->ri_yorigin + row + 
 	ri->ri_font->fontheight - 1;
 	CG6_BLIT(fbc);
+	if (ri->ri_crow == row && 
+	   (ri->ri_ccol >= dst && ri->ri_ccol < (dst + n)))
+		ri->ri_flg &= ~RI_CURSOR;
 }
 
 static void
@@ -449,6 +480,11 @@ cg6_ras_erasecols(void *cookie, int row,
 		n = ri->ri_cols - col;
 	if (n <= 0)
 		return;
+
+	if (ri->ri_crow == row && 
+	   (ri->ri_ccol >= col && ri->ri_ccol < (col + n)))
+		ri->ri_flg &= ~RI_CURSOR;
+
 	n *= ri->ri_font->fontwidth;
 	col *= ri->ri_font->fontwidth;
 	row *= ri->ri_font->fontheight;
@@ -483,6 +519,9 @@ cg6_ras_eraserows(void *cookie, int row,
 	if (n <= 0)
 		return;
 
+	if (ri->ri_crow >= row && ri->ri_crow < (row + n))
+		ri->ri_flg &= ~RI_CURSOR;
+
 	CG6_WAIT_READY(fbc);
 	fbc->fbc_alu = CG6_ALU_FILL;
 	fbc->fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
@@ -624,7 +663,7 @@ cg6attach(struct cgsix_softc *sc, const 
 		}
 	}
 	cg6_setup_palette(sc);
-	
+
 	aa.scrdata = _screenlist;
 	aa.console = isconsole;
 	aa.accessops = _accessops;
@@ -1369,6 +1408,10 @@ cgsix_putchar(void *cookie, int row, int
 	if ((row >= 0) && (row < ri->ri_rows) && (col >= 0) && 
 	(col < ri->ri_cols)) {
 
+		if (row == ri->ri_crow && col == ri->ri_ccol) {
+			ri->ri_flg &= ~RI_CURSOR;
+		}
+
 		if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
 
 			int fg, bg, uc, i;
@@ -1438,6 +1481,10 @@ cgsix_putchar_aa(void *cookie, int row, 
 	if (!CHAR_IN_FONT(c, font))
 		return;
 
+	if (row == ri->ri_crow && col == ri->ri_ccol) {
+		ri->ri_flg &= ~RI_CURSOR;
+	}
+
 	wi = font->fontwidth;
 	he = font->fontheight;
 
@@ -1532,21 +1579,17 @@ cgsix_cursor(void *cookie, int on, int r
 	he = ri->ri_font->fontheight;
 	
 	if (sc->sc_mode == WSDISPLAYIO_MODE_EMUL) {
-		x = ri->ri_ccol * wi + ri->ri_xorigin;
-		y = ri->ri_crow * he + ri->ri_yorigin;
-		if (ri->ri_flg & RI_CURSOR) {
+		if (on) {
+			if (ri->ri_flg & RI_CURSOR) {
+cg6_ras_nuke_cursor(ri);
+			}
+			x = col * wi + ri->ri_xorigin;
+			y = row * he + ri->ri_yorigin;
 			cg6_invert(sc, x, y, wi, he);
-			ri->ri_flg &= ~RI_CURSOR;
+			ri->ri_flg |= RI_CURSOR;
 		}
 		ri->ri_crow = row;
 		ri->ri_ccol = col;
-		if (on)
-		{
-			x = ri->ri_ccol * wi + ri->ri_xorigin;
-			y = 

CVS commit: src/sys/dev/sun

2022-04-27 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr 28 03:12:03 UTC 2022

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
be lazy about clearing the cursor - in most cases we're about to overwrite it
anyway. Same logic as with VCONS_DONT_READ.
visible speedup in things like systat and top


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2020-12-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Dec 18 01:54:22 UTC 2020

Modified Files:
src/sys/dev/sun: event.c

Log Message:
Use sel{record,remove}_knote().


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/sun/event.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2020-12-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Dec 18 01:54:22 UTC 2020

Modified Files:
src/sys/dev/sun: event.c

Log Message:
Use sel{record,remove}_knote().


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/sun/event.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/event.c
diff -u src/sys/dev/sun/event.c:1.24 src/sys/dev/sun/event.c:1.25
--- src/sys/dev/sun/event.c:1.24	Wed Oct 25 08:12:39 2017
+++ src/sys/dev/sun/event.c	Fri Dec 18 01:54:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: event.c,v 1.24 2017/10/25 08:12:39 maya Exp $	*/
+/*	$NetBSD: event.c,v 1.25 2020/12/18 01:54:22 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: event.c,v 1.24 2017/10/25 08:12:39 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: event.c,v 1.25 2020/12/18 01:54:22 thorpej Exp $");
 
 #include 
 #include 
@@ -173,7 +173,7 @@ filt_evrdetach(struct knote *kn)
 	int s;
 
 	s = splev();
-	SLIST_REMOVE(>ev_sel.sel_klist, kn, knote, kn_selnext);
+	selremove_knote(>ev_sel, kn);
 	splx(s);
 }
 
@@ -206,12 +206,10 @@ static const struct filterops ev_filtops
 int
 ev_kqfilter(struct evvar *ev, struct knote *kn)
 {
-	struct klist *klist;
 	int s;
 
 	switch (kn->kn_filter) {
 	case EVFILT_READ:
-		klist = >ev_sel.sel_klist;
 		kn->kn_fop = _filtops;
 		break;
 
@@ -222,7 +220,7 @@ ev_kqfilter(struct evvar *ev, struct kno
 	kn->kn_hook = ev;
 
 	s = splev();
-	SLIST_INSERT_HEAD(klist, kn, kn_selnext);
+	selrecord_knote(>ev_sel, kn);
 	splx(s);
 
 	return (0);



CVS commit: src/sys/dev/sun

2020-05-03 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Sun May  3 06:31:02 UTC 2020

Modified Files:
src/sys/dev/sun: disksubr.c

Log Message:
If the sector size is 0, return early in readdisklabel().
Prevents a panic trying to use a 0-sized buffer, which can happen if we run
(e.g.) `scsictl /dev/cd0c identify` with no medium in the CD drive.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/sun/disksubr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/disksubr.c
diff -u src/sys/dev/sun/disksubr.c:1.16 src/sys/dev/sun/disksubr.c:1.17
--- src/sys/dev/sun/disksubr.c:1.16	Wed Apr  3 22:10:52 2019
+++ src/sys/dev/sun/disksubr.c	Sun May  3 06:31:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: disksubr.c,v 1.16 2019/04/03 22:10:52 christos Exp $ */
+/*	$NetBSD: disksubr.c,v 1.17 2020/05/03 06:31:02 jdc Exp $ */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -55,7 +55,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.16 2019/04/03 22:10:52 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.17 2020/05/03 06:31:02 jdc Exp $");
 
 #include 
 #include 
@@ -104,6 +104,8 @@ readdisklabel(dev_t dev, void (*strat)(s
 			lp->d_partitions[RAW_PART].p_size = 0x1fff;
 		lp->d_partitions[RAW_PART].p_offset = 0;
 	}
+	if (lp->d_secsize == 0)
+		return ("sector size 0");
 
 	/* obtain buffer to probe drive with */
 	bp = geteblk((int)lp->d_secsize);



CVS commit: src/sys/dev/sun

2020-05-03 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Sun May  3 06:31:02 UTC 2020

Modified Files:
src/sys/dev/sun: disksubr.c

Log Message:
If the sector size is 0, return early in readdisklabel().
Prevents a panic trying to use a 0-sized buffer, which can happen if we run
(e.g.) `scsictl /dev/cd0c identify` with no medium in the CD drive.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/sun/disksubr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2020-01-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jan 18 21:08:42 UTC 2020

Modified Files:
src/sys/dev/sun: kbd.c

Log Message:
Fix panic on sun3 when any key is typed when kbd is not console. PR/54873

Should be pulled up to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/sun/kbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/kbd.c
diff -u src/sys/dev/sun/kbd.c:1.70 src/sys/dev/sun/kbd.c:1.71
--- src/sys/dev/sun/kbd.c:1.70	Sun Nov 10 21:16:37 2019
+++ src/sys/dev/sun/kbd.c	Sat Jan 18 21:08:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kbd.c,v 1.70 2019/11/10 21:16:37 chs Exp $	*/
+/*	$NetBSD: kbd.c,v 1.71 2020/01/18 21:08:42 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -47,7 +47,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.70 2019/11/10 21:16:37 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.71 2020/01/18 21:08:42 tsutsui Exp $");
 
 #include 
 #include 
@@ -202,7 +202,7 @@ kbdopen(dev_t dev, int flags, int mode, 
 	k->k_events.ev_io = l->l_proc;
 
 	/* stop pending autorepeat of console input */
-	if (k->k_repeating) {
+	if (k->k_cc != NULL && k->k_repeating) {
 		k->k_repeating = 0;
 		callout_stop(>k_repeat_ch);
 	}
@@ -492,9 +492,11 @@ kbd_input(struct kbd_softc *k, int code)
 
 	/*
 	 * If /dev/kbd is not connected in event mode, or wskbd mode,
-	 * translate and send upstream (to console).
+	 * and is attached as console, translate and send upstream
+	 * (to console).
 	 */
-	kbd_input_console(k, code);
+	if (k->k_cc != NULL)
+		kbd_input_console(k, code);
 }
 
 



CVS commit: src/sys/dev/sun

2020-01-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jan 18 21:08:42 UTC 2020

Modified Files:
src/sys/dev/sun: kbd.c

Log Message:
Fix panic on sun3 when any key is typed when kbd is not console. PR/54873

Should be pulled up to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/sun/kbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2019-01-20 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Mon Jan 21 06:23:17 UTC 2019

Modified Files:
src/sys/dev/sun: bwtwo.c

Log Message:
apply patches from PR 49639
compile tested only for lack of hardware


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/sun/bwtwo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/bwtwo.c
diff -u src/sys/dev/sun/bwtwo.c:1.35 src/sys/dev/sun/bwtwo.c:1.36
--- src/sys/dev/sun/bwtwo.c:1.35	Thu Apr 21 18:06:06 2016
+++ src/sys/dev/sun/bwtwo.c	Mon Jan 21 06:23:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bwtwo.c,v 1.35 2016/04/21 18:06:06 macallan Exp $ */
+/*	$NetBSD: bwtwo.c,v 1.36 2019/01/21 06:23:17 macallan Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.35 2016/04/21 18:06:06 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.36 2019/01/21 06:23:17 macallan Exp $");
 
 #include 
 #include 
@@ -434,6 +434,13 @@ bwtwo_ioctl(void *v, void *vs, u_long cm
 	}
 }
 			}
+			return 0;
+		case WSDISPLAYIO_GET_FBINFO:
+			{
+struct wsdisplayio_fbinfo *fbi = data;
+
+return wsdisplayio_get_fbinfo(>scr_ri, fbi);
+			}
 	}
 	return EPASSTHROUGH;
 }
@@ -441,8 +448,16 @@ bwtwo_ioctl(void *v, void *vs, u_long cm
 paddr_t
 bwtwo_mmap(void *v, void *vs, off_t offset, int prot)
 {
-	/* I'm not at all sure this is the right thing to do */
-	return bwtwommap(0, offset, prot); /* assume minor dev 0 for now */
+	struct vcons_data *vd = v;
+	struct bwtwo_softc *sc = vd->cookie;
+
+	if (offset < 0) return -1;
+	if (offset >= sc->sc_fb.fb_type.fb_size)
+		return -1;
+
+	return bus_space_mmap(sc->sc_bustag,
+		sc->sc_paddr, sc->sc_pixeloffset + offset,
+		prot, BUS_SPACE_MAP_LINEAR);
 }
 
 void



CVS commit: src/sys/dev/sun

2019-01-20 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Mon Jan 21 06:23:17 UTC 2019

Modified Files:
src/sys/dev/sun: bwtwo.c

Log Message:
apply patches from PR 49639
compile tested only for lack of hardware


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/sun/bwtwo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2019-01-18 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Jan 19 00:16:43 UTC 2019

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
allow font loading, resizing etc.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.67 src/sys/dev/sun/cgsix.c:1.68
--- src/sys/dev/sun/cgsix.c:1.67	Thu Apr 21 18:06:06 2016
+++ src/sys/dev/sun/cgsix.c	Sat Jan 19 00:16:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.67 2016/04/21 18:06:06 macallan Exp $ */
+/*	$NetBSD: cgsix.c,v 1.68 2019/01/19 00:16:43 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.67 2016/04/21 18:06:06 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.68 2019/01/19 00:16:43 macallan Exp $");
 
 #include 
 #include 
@@ -158,7 +158,7 @@ struct wsscreen_descr cgsix_defaultscree
 	0, 0,	/* will be filled in -- XXX shouldn't, it's global */
 	NULL,		/* textops */
 	8, 16,	/* font width/height */
-	WSSCREEN_WSCOLORS,	/* capabilities */
+	WSSCREEN_WSCOLORS | WSSCREEN_RESIZE | WSSCREEN_UNDERLINE,
 	NULL	/* modecookie */
 };
 
@@ -562,6 +562,8 @@ cg6attach(struct cgsix_softc *sc, const 
 	sc->sc_gc.gc_bitblt = cgsix_bitblt;
 	sc->sc_gc.gc_blitcookie = sc;
 	sc->sc_gc.gc_rop = CG6_ALU_COPY;
+	sc->vd.show_screen_cookie = >sc_gc;
+	sc->vd.show_screen_cb = glyphcache_adapt;
 
 	if(isconsole) {
 		/* we mess with cg6_console_screen only once */
@@ -1024,7 +1026,7 @@ cgsixmmap(dev_t dev, off_t off, int prot
 {
 	struct cgsix_softc *sc = device_lookup_private(_cd, minor(dev));
 	struct mmo *mo;
-	u_int u, sz;
+	u_int u, sz, flags;
 	static struct mmo mmo[] = {
 		{ CG6_USER_RAM, 0, CGSIX_RAM_OFFSET },
 
@@ -1053,12 +1055,18 @@ cgsixmmap(dev_t dev, off_t off, int prot
 		if ((u_long)off < mo->mo_uaddr)
 			continue;
 		u = off - mo->mo_uaddr;
-		sz = mo->mo_size ? mo->mo_size : 
-		sc->sc_ramsize;
+		if (mo->mo_size == 0) {
+			flags = BUS_SPACE_MAP_LINEAR |
+BUS_SPACE_MAP_PREFETCHABLE;
+			sz = sc->sc_ramsize;
+		} else {
+			flags = BUS_SPACE_MAP_LINEAR;
+			sz = mo->mo_size;
+		}
 		if (u < sz) {
 			return (bus_space_mmap(sc->sc_bustag,
 sc->sc_paddr, u+mo->mo_physoff,
-prot, BUS_SPACE_MAP_LINEAR));
+prot, flags));
 		}
 	}
 
@@ -1161,7 +1169,8 @@ cgsix_mmap(void *v, void *vs, off_t offs
 
 	if (offset < sc->sc_ramsize) {
 		return bus_space_mmap(sc->sc_bustag, sc->sc_paddr,
-		CGSIX_RAM_OFFSET + offset, prot, BUS_SPACE_MAP_LINEAR);
+		CGSIX_RAM_OFFSET + offset, prot,
+		BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE);
 	}
 	return -1;
 }
@@ -1241,12 +1250,14 @@ cgsix_init_screen(void *cookie, struct v
 	av = sc->sc_ramsize - (sc->sc_height * sc->sc_stride);
 	ri->ri_flg = RI_CENTER  | RI_8BIT_IS_RGB;
 	if (av > (128 * 1024)) {
-		ri->ri_flg |= RI_ENABLE_ALPHA;
+		ri->ri_flg |= RI_ENABLE_ALPHA | RI_PREFER_ALPHA;
 	}
 	ri->ri_bits = sc->sc_fb.fb_pixels;
-	
+	scr->scr_flags |= VCONS_LOADFONT;
+
 	rasops_init(ri, 0, 0);
-	ri->ri_caps = WSSCREEN_WSCOLORS | WSSCREEN_REVERSE;
+	ri->ri_caps = WSSCREEN_WSCOLORS | WSSCREEN_REVERSE |
+		  WSSCREEN_UNDERLINE | WSSCREEN_RESIZE;
 	rasops_reconfig(ri, sc->sc_height / ri->ri_font->fontheight,
 		sc->sc_width / ri->ri_font->fontwidth);
 



CVS commit: src/sys/dev/sun

2019-01-18 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Jan 19 00:16:43 UTC 2019

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
allow font loading, resizing etc.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/sys/dev/sun

2018-02-09 Thread Martin Husemann
On Fri, Feb 09, 2018 at 12:30:00AM +, m...@netbsd.org wrote:
> The alternative version sounds more desirable (keyboard power button
> works even if not console), what do you think?

The typical/default setup on suns is: if keyboard is attached at reset/power
up time, it will become console.

If you explicitly set firmware to use serial console even though the keyboard
is installed, I'd think you don't want the power button on the keyboard
to shut your machine down either.

This might be worth a sysctl or compile time option, but is a pretty rare
corner case, so I'd leave it as it is now.

Martin


Re: CVS commit: src/sys/dev/sun

2018-02-08 Thread maya
>   case 0x30:
>  #if NSYSMON_ENVSYS
> - if (k->k_isconsole)
> + if (k->k_isconsole) {
>   k->k_ev = KEY_UP(code) ?
>   PSWITCH_EVENT_RELEASED :
>   PSWITCH_EVENT_PRESSED;
>   sysmon_task_queue_sched(0,
>   kbd_powerbutton, k);
> + }

The alternative version sounds more desirable (keyboard power button
works even if not console), what do you think?


CVS commit: src/sys/dev/sun

2018-02-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb  8 10:52:05 UTC 2018

Modified Files:
src/sys/dev/sun: kbd.c

Log Message:
update for GCC 6:

kbd_input_wskbd() has a missing {} issue.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/sun/kbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/kbd.c
diff -u src/sys/dev/sun/kbd.c:1.68 src/sys/dev/sun/kbd.c:1.69
--- src/sys/dev/sun/kbd.c:1.68	Fri Jul 25 08:10:39 2014
+++ src/sys/dev/sun/kbd.c	Thu Feb  8 10:52:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kbd.c,v 1.68 2014/07/25 08:10:39 dholland Exp $	*/
+/*	$NetBSD: kbd.c,v 1.69 2018/02/08 10:52:05 mrg Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -47,7 +47,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.68 2014/07/25 08:10:39 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.69 2018/02/08 10:52:05 mrg Exp $");
 
 #include 
 #include 
@@ -948,12 +948,13 @@ kbd_input_wskbd(struct kbd_softc *k, int
 #endif
 			case 0x30:
 #if NSYSMON_ENVSYS
-if (k->k_isconsole)
+if (k->k_isconsole) {
 	k->k_ev = KEY_UP(code) ?
 	PSWITCH_EVENT_RELEASED :
 	PSWITCH_EVENT_PRESSED;
 	sysmon_task_queue_sched(0,
 	kbd_powerbutton, k);
+}
 #endif
 return;
 		}



CVS commit: src/sys/dev/sun

2018-02-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb  8 10:52:05 UTC 2018

Modified Files:
src/sys/dev/sun: kbd.c

Log Message:
update for GCC 6:

kbd_input_wskbd() has a missing {} issue.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/sun/kbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2017-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Oct 31 10:46:47 UTC 2017

Modified Files:
src/sys/dev/sun: sunkbd.c sunms.c

Log Message:
PR port-sparc64/52622: mark the parent device as TS_KERN_ONLY,
so userland will not touch it (and change serial params w/o our
controll).


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/sun/sunkbd.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/sun/sunms.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2017-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Oct 31 10:46:47 UTC 2017

Modified Files:
src/sys/dev/sun: sunkbd.c sunms.c

Log Message:
PR port-sparc64/52622: mark the parent device as TS_KERN_ONLY,
so userland will not touch it (and change serial params w/o our
controll).


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/sun/sunkbd.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/sun/sunms.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/sunkbd.c
diff -u src/sys/dev/sun/sunkbd.c:1.29 src/sys/dev/sun/sunkbd.c:1.30
--- src/sys/dev/sun/sunkbd.c:1.29	Sun Sep 15 14:10:04 2013
+++ src/sys/dev/sun/sunkbd.c	Tue Oct 31 10:46:47 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunkbd.c,v 1.29 2013/09/15 14:10:04 martin Exp $	*/
+/*	$NetBSD: sunkbd.c,v 1.30 2017/10/31 10:46:47 martin Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -51,7 +51,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunkbd.c,v 1.29 2013/09/15 14:10:04 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunkbd.c,v 1.30 2017/10/31 10:46:47 martin Exp $");
 
 #include 
 #include 
@@ -145,6 +145,7 @@ sunkbd_attach(device_t parent, device_t 
 	KASSERT(tp->t_linesw == _disc);
 	tp->t_oflag &= ~OPOST;
 	tp->t_dev = args->kmta_dev;
+	SET(tp->t_state, TS_KERN_ONLY);
 
 	/* link the structures together. */
 	k->k_priv = tp;
@@ -218,6 +219,7 @@ sunkbdiopen(device_t dev, int flags)
 	int error;
 
 	/* Open the lower device */
+	CLR(tp->t_state, TS_KERN_ONLY);
 	if ((error = cdev_open(tp->t_dev, O_NONBLOCK|flags,
  0/* ignored? */, l)) != 0)
 		return (error);
@@ -228,6 +230,7 @@ sunkbdiopen(device_t dev, int flags)
 	t.c_ospeed = sunkbd_bps;
 	t.c_cflag =  CLOCAL|CS8;
 	(*tp->t_param)(tp, );
+	SET(tp->t_state, TS_KERN_ONLY);
 
 	return (0);
 }

Index: src/sys/dev/sun/sunms.c
diff -u src/sys/dev/sun/sunms.c:1.32 src/sys/dev/sun/sunms.c:1.33
--- src/sys/dev/sun/sunms.c:1.32	Sun Sep 15 14:13:19 2013
+++ src/sys/dev/sun/sunms.c	Tue Oct 31 10:46:47 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunms.c,v 1.32 2013/09/15 14:13:19 martin Exp $	*/
+/*	$NetBSD: sunms.c,v 1.33 2017/10/31 10:46:47 martin Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunms.c,v 1.32 2013/09/15 14:13:19 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunms.c,v 1.33 2017/10/31 10:46:47 martin Exp $");
 
 #include 
 #include 
@@ -162,6 +162,7 @@ sunms_attach(device_t parent, device_t s
 	tp->t_linesw = ttyldisc_lookup(sunms_disc.l_name);
 	KASSERT(tp->t_linesw == _disc);
 	tp->t_oflag &= ~OPOST;
+	SET(tp->t_state, TS_KERN_ONLY);
 
 	/* Initialize translator. */
 	ms->ms_byteno = -1;
@@ -192,6 +193,7 @@ sunmsiopen(device_t dev, int flags)
 	int error;
 
 	/* Open the lower device */
+	CLR(tp->t_state, TS_KERN_ONLY);
 	if ((error = cdev_open(tp->t_dev, O_NONBLOCK|flags,
  0/* ignored? */, l)) != 0)
 		return (error);
@@ -202,6 +204,7 @@ sunmsiopen(device_t dev, int flags)
 	t.c_ospeed = sunms_bps;
 	t.c_cflag =  CLOCAL|CS8;
 	(*tp->t_param)(tp, );
+	SET(tp->t_state, TS_KERN_ONLY);
 
 	return (0);
 }



CVS commit: src/sys/dev/sun

2017-02-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Feb 26 09:49:40 UTC 2017

Modified Files:
src/sys/dev/sun: disksubr.c

Log Message:
Disks without a disk label happen in normal operation (both as USB
stick or with GPT), so do not cause an error message when opening
them.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/sun/disksubr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/disksubr.c
diff -u src/sys/dev/sun/disksubr.c:1.14 src/sys/dev/sun/disksubr.c:1.15
--- src/sys/dev/sun/disksubr.c:1.14	Tue Mar 23 20:01:09 2010
+++ src/sys/dev/sun/disksubr.c	Sun Feb 26 09:49:40 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: disksubr.c,v 1.14 2010/03/23 20:01:09 martin Exp $ */
+/*	$NetBSD: disksubr.c,v 1.15 2017/02/26 09:49:40 martin Exp $ */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -55,7 +55,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.14 2010/03/23 20:01:09 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.15 2017/02/26 09:49:40 martin Exp $");
 
 #include 
 #include 
@@ -160,7 +160,7 @@ readdisklabel(dev_t dev, void (*strat)(s
 	}
 
 	memset(clp->cd_block, 0, sizeof(clp->cd_block));
-	return ("no disk label");
+	return NULL;
 }
 
 /*



CVS commit: src/sys/dev/sun

2017-02-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Feb 26 09:49:40 UTC 2017

Modified Files:
src/sys/dev/sun: disksubr.c

Log Message:
Disks without a disk label happen in normal operation (both as USB
stick or with GPT), so do not cause an error message when opening
them.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/sun/disksubr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2016-11-09 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Nov  9 19:54:25 UTC 2016

Modified Files:
src/sys/dev/sun: cgthree.c

Log Message:
- use bus_space_mmap()
- pass the right colour depth in ioctl()
should fix PR49639


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/sun/cgthree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgthree.c
diff -u src/sys/dev/sun/cgthree.c:1.32 src/sys/dev/sun/cgthree.c:1.33
--- src/sys/dev/sun/cgthree.c:1.32	Thu Apr 21 18:06:06 2016
+++ src/sys/dev/sun/cgthree.c	Wed Nov  9 19:54:25 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgthree.c,v 1.32 2016/04/21 18:06:06 macallan Exp $ */
+/*	$NetBSD: cgthree.c,v 1.33 2016/11/09 19:54:25 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.32 2016/04/21 18:06:06 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.33 2016/11/09 19:54:25 macallan Exp $");
 
 #include 
 #include 
@@ -436,7 +436,7 @@ cgthree_ioctl(void *v, void *vs, u_long 
 			wdf = (void *)data;
 			wdf->height = ri->ri_height;
 			wdf->width = ri->ri_width;
-			wdf->depth = ri->ri_depth;
+			wdf->depth = 8;
 			wdf->cmsize = 256;
 			return 0;
 
@@ -474,8 +474,16 @@ cgthree_ioctl(void *v, void *vs, u_long 
 paddr_t
 cgthree_mmap(void *v, void *vs, off_t offset, int prot)
 {
-	/* I'm not at all sure this is the right thing to do */
-	return cgthreemmap(0, offset, prot); /* assume minor dev 0 for now */
+	struct vcons_data *vd = v;
+	struct cgthree_softc *sc = vd->cookie;
+
+	if (offset < 0) return -1;
+	if (offset >= sc->sc_fb.fb_type.fb_size)
+		return -1;
+
+	return bus_space_mmap(sc->sc_bustag,
+		sc->sc_paddr, CG3REG_MEM + offset,
+		prot, BUS_SPACE_MAP_LINEAR);
 }
 
 int



CVS commit: src/sys/dev/sun

2016-11-09 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Nov  9 19:54:25 UTC 2016

Modified Files:
src/sys/dev/sun: cgthree.c

Log Message:
- use bus_space_mmap()
- pass the right colour depth in ioctl()
should fix PR49639


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/sun/cgthree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2016-05-07 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat May  7 15:28:57 UTC 2016

Modified Files:
src/sys/dev/sun: fbio.h

Log Message:
add FBTYPE_MGX


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/sun/fbio.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/fbio.h
diff -u src/sys/dev/sun/fbio.h:1.12 src/sys/dev/sun/fbio.h:1.13
--- src/sys/dev/sun/fbio.h:1.12	Sun Sep  6 06:01:01 2015
+++ src/sys/dev/sun/fbio.h	Sat May  7 15:28:57 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: fbio.h,v 1.12 2015/09/06 06:01:01 dholland Exp $ */
+/*	$NetBSD: fbio.h,v 1.13 2016/05/07 15:28:57 macallan Exp $ */
 
 /*
  * Copyright (c) 1992 Regents of the University of California.
@@ -76,8 +76,9 @@
 #define FBTYPE_GENERIC_PCI	23	/* machfb, ofb and so on */
 #define FBTYPE_AG10E		24	/* Fujitsu AG-10e */
 #define FBTYPE_TCXCOLOR		25	/* Sun TCX, S24  */
+#define FBTYPE_MGX		26	/* Southland Media MGX  */
 
-#define	FBTYPE_LASTPLUSONE	26	/* max number of fbs (change as add) */
+#define	FBTYPE_LASTPLUSONE	27	/* max number of fbs (change as add) */
 
 /*
  * XXX These really shouldn't be here, but this is what the pmax



CVS commit: src/sys/dev/sun

2016-05-07 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat May  7 15:28:57 UTC 2016

Modified Files:
src/sys/dev/sun: fbio.h

Log Message:
add FBTYPE_MGX


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/sun/fbio.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2016-04-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr 21 18:06:06 UTC 2016

Modified Files:
src/sys/dev/sun: bwtwo.c cgsix.c cgsixvar.h cgthree.c fb.c fbvar.h

Log Message:
RASTERCONSOLE is gone, wsdisplay no longer optional


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/sun/bwtwo.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/sun/cgsix.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/sun/cgsixvar.h
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/sun/cgthree.c
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/sun/fb.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/sun/fbvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2016-04-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr 21 18:06:06 UTC 2016

Modified Files:
src/sys/dev/sun: bwtwo.c cgsix.c cgsixvar.h cgthree.c fb.c fbvar.h

Log Message:
RASTERCONSOLE is gone, wsdisplay no longer optional


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/sun/bwtwo.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/sun/cgsix.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/sun/cgsixvar.h
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/sun/cgthree.c
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/sun/fb.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/sun/fbvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/bwtwo.c
diff -u src/sys/dev/sun/bwtwo.c:1.34 src/sys/dev/sun/bwtwo.c:1.35
--- src/sys/dev/sun/bwtwo.c:1.34	Fri Jul 25 08:10:39 2014
+++ src/sys/dev/sun/bwtwo.c	Thu Apr 21 18:06:06 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: bwtwo.c,v 1.34 2014/07/25 08:10:39 dholland Exp $ */
+/*	$NetBSD: bwtwo.c,v 1.35 2016/04/21 18:06:06 macallan Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.34 2014/07/25 08:10:39 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.35 2016/04/21 18:06:06 macallan Exp $");
 
 #include 
 #include 
@@ -310,7 +310,6 @@ bwtwoattach(struct bwtwo_softc *sc, cons
 			 * definition. In this case we fill it from fb to
 			 * avoid problems in case no bwtwo is the console
 			 */
-			ri = >sc_fb.fb_rinfo;
 			bwtwo_defaultscreen.textops = >ri_ops;
 			bwtwo_defaultscreen.capabilities = ri->ri_caps;
 			bwtwo_defaultscreen.nrows = ri->ri_rows;
@@ -404,8 +403,8 @@ bwtwo_ioctl(void *v, void *vs, u_long cm
 	struct vcons_data *vd = v;
 	struct bwtwo_softc *sc = vd->cookie;
 	struct wsdisplay_fbinfo *wdf;
-	struct rasops_info *ri = >sc_fb.fb_rinfo;
 	struct vcons_screen *ms = sc->vd.active;
+	struct rasops_info *ri = >scr_ri;
 	switch (cmd) {
 		case WSDISPLAYIO_GTYPE:
 			*(u_int *)data = WSDISPLAY_TYPE_GENFB;

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.66 src/sys/dev/sun/cgsix.c:1.67
--- src/sys/dev/sun/cgsix.c:1.66	Wed Apr 13 17:26:08 2016
+++ src/sys/dev/sun/cgsix.c	Thu Apr 21 18:06:06 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.66 2016/04/13 17:26:08 macallan Exp $ */
+/*	$NetBSD: cgsix.c,v 1.67 2016/04/21 18:06:06 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.66 2016/04/13 17:26:08 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.67 2016/04/21 18:06:06 macallan Exp $");
 
 #include 
 #include 
@@ -151,11 +151,6 @@ static void cg6_loadomap (struct cgsix_s
 static void cg6_setcursor (struct cgsix_softc *);/* set position */
 static void cg6_loadcursor (struct cgsix_softc *);/* set shape */
 
-#if NWSDISPLAY > 0
-#ifdef RASTERCONSOLE
-#error RASTERCONSOLE and wsdisplay are mutually exclusive
-#endif
-
 static void cg6_setup_palette(struct cgsix_softc *);
 
 struct wsscreen_descr cgsix_defaultscreen = {
@@ -208,18 +203,9 @@ struct wsscreen_list cgsix_screenlist = 
 
 extern const u_char rasops_cmap[768];
 
-#endif /* NWSDISPLAY > 0 */
-
-#if (NWSDISPLAY > 0) || defined(RASTERCONSOLE)
 void	cg6_invert(struct cgsix_softc *, int, int, int, int);
 
-/* need this for both cases because ri_hw points to it */
 static struct vcons_screen cg6_console_screen;
-#endif
-
-#ifdef RASTERCONSOLE
-int cgsix_use_rasterconsole = 1;
-#endif
 
 /*
  * cg6 accelerated console routines.
@@ -326,15 +312,11 @@ int cgsix_use_rasterconsole = 1;
 		/*EMPTY*/;		\
 } while (0)
 
-#if (NWSDISPLAY > 0) || defined(RASTERCONSOLE)
 static void cg6_ras_init(struct cgsix_softc *);
 static void cg6_ras_copyrows(void *, int, int, int);
 static void cg6_ras_copycols(void *, int, int, int, int);
 static void cg6_ras_erasecols(void *, int, int, int, long int);
 static void cg6_ras_eraserows(void *, int, int, long int);
-#if defined(RASTERCONSOLE) && defined(CG6_BLIT_CURSOR)
-static void cg6_ras_do_cursor(struct rasops_info *);
-#endif
 
 static void
 cg6_ras_init(struct cgsix_softc *sc)
@@ -522,38 +504,13 @@ cg6_ras_eraserows(void *cookie, int row,
 	CG6_DRAW(fbc);
 }
 
-#if defined(RASTERCONSOLE) && defined(CG6_BLIT_CURSOR)
-/*
- * Really want something more like fg^bg here, but that would be more
- * or less impossible to migrate to colors.  So we hope there's
- * something not too inappropriate in the colormap...besides, it's what
- * the non-accelerated code did. :-)
- */
-static void
-cg6_ras_do_cursor(struct rasops_info *ri)
-{
-	struct vcons_screen *scr = ri->ri_hw;
-	struct cgsix_softc *sc = scr->cookie;
-	int row, col;
-	
-	row = ri->ri_crow * ri->ri_font->fontheight;
-	col = ri->ri_ccol * ri->ri_font->fontwidth;
-	cg6_invert(sc, ri->ri_xorigin + col,ri->ri_yorigin + 
-	row, ri->ri_font->fontwidth, ri->ri_font->fontheight);
-}
-#endif	/* RASTERCONSOLE */

CVS commit: src/sys/dev/sun

2016-04-13 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Apr 13 17:26:08 UTC 2016

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
return correct parameters in ioctl(WSDISPLAYIO_GINFO), from lausgans
while there, support WSDISPLAYIO_GET_FBINFO


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.65 src/sys/dev/sun/cgsix.c:1.66
--- src/sys/dev/sun/cgsix.c:1.65	Fri Jul 25 08:10:39 2014
+++ src/sys/dev/sun/cgsix.c	Wed Apr 13 17:26:08 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.65 2014/07/25 08:10:39 dholland Exp $ */
+/*	$NetBSD: cgsix.c,v 1.66 2016/04/13 17:26:08 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.65 2014/07/25 08:10:39 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.66 2016/04/13 17:26:08 macallan Exp $");
 
 #include 
 #include 
@@ -1178,7 +1178,6 @@ cgsix_ioctl(void *v, void *vs, u_long cm
 	struct vcons_data *vd = v;
 	struct cgsix_softc *sc = vd->cookie;
 	struct wsdisplay_fbinfo *wdf;
-	struct rasops_info *ri = >sc_fb.fb_rinfo;
 	struct vcons_screen *ms = sc->vd.active;
 
 #ifdef CGSIX_DEBUG
@@ -1190,9 +1189,9 @@ cgsix_ioctl(void *v, void *vs, u_long cm
 			return 0;
 		case WSDISPLAYIO_GINFO:
 			wdf = (void *)data;
-			wdf->height = ri->ri_height;
-			wdf->width = ri->ri_width;
-			wdf->depth = ri->ri_depth;
+			wdf->height = sc->sc_height;
+			wdf->width = sc->sc_width;
+			wdf->depth = 8;
 			wdf->cmsize = 256;
 			return 0;
 
@@ -1222,6 +1221,13 @@ cgsix_ioctl(void *v, void *vs, u_long cm
 	}
 }
 			}
+			return 0;
+		case WSDISPLAYIO_GET_FBINFO:
+			{
+struct wsdisplayio_fbinfo *fbi = data;
+
+return wsdisplayio_get_fbinfo(>scr_ri, fbi);
+			}
 	}
 	return EPASSTHROUGH;
 }



CVS commit: src/sys/dev/sun

2016-04-13 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Apr 13 17:26:08 UTC 2016

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
return correct parameters in ioctl(WSDISPLAYIO_GINFO), from lausgans
while there, support WSDISPLAYIO_GET_FBINFO


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



re: CVS commit: src/sys/dev/sun

2015-09-29 Thread Christos Zoulas
On Sep 29,  3:07pm, m...@eterna.com.au (matthew green) wrote:
-- Subject: re: CVS commit: src/sys/dev/sun

| "Christos Zoulas" writes:
| > Module Name:src
| > Committed By:   christos
| > Date:   Sat Sep 26 03:31:53 UTC 2015
| > 
| > Modified Files:
| > src/sys/dev/sun: disklabel.h
| > 
| > Log Message:
| > avoid conflicts with our own ioctls
| 
| i can't find it off hand, but i used to have software that used
|  on netbsd and expected it to be the
| sunos version of ioctls.
| 
| i wonder if we can continue to provide those symbols to userland?

We can provide an ifdef for it, but these are only used for compat/sunos...
I doubt that it ever worked to compile a sunos binary on NetBSD. After
all the NetBSD native emulation does not know what to do with those ioctls,
so compiling a NetBSD binary with those ioctls won't run.

christos


re: CVS commit: src/sys/dev/sun

2015-09-29 Thread matthew green
> | > Committed By: christos
> | > Date: Sat Sep 26 03:31:53 UTC 2015
> | > 
> | > Modified Files:
> | >   src/sys/dev/sun: disklabel.h
> | > 
> | > Log Message:
> | > avoid conflicts with our own ioctls
> | 
> | i can't find it off hand, but i used to have software that used
> |  on netbsd and expected it to be the
> | sunos version of ioctls.
> | 
> | i wonder if we can continue to provide those symbols to userland?
> 
> We can provide an ifdef for it, but these are only used for compat/sunos...
> I doubt that it ever worked to compile a sunos binary on NetBSD. After
> all the NetBSD native emulation does not know what to do with those ioctls,
> so compiling a NetBSD binary with those ioctls won't run.

you misunderstand me.

there was *userland* software that uses netbsd's 
to find the sun disklabel stuff.  but maybe it doesn't matter cuz i
can't seem to find it anymore.


.mrg.


re: CVS commit: src/sys/dev/sun

2015-09-28 Thread matthew green
"Christos Zoulas" writes:
> Module Name:  src
> Committed By: christos
> Date: Sat Sep 26 03:31:53 UTC 2015
> 
> Modified Files:
>   src/sys/dev/sun: disklabel.h
> 
> Log Message:
> avoid conflicts with our own ioctls

i can't find it off hand, but i used to have software that used
 on netbsd and expected it to be the
sunos version of ioctls.

i wonder if we can continue to provide those symbols to userland?


.mrg.


CVS commit: src/sys/dev/sun

2015-09-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 26 03:31:53 UTC 2015

Modified Files:
src/sys/dev/sun: disklabel.h

Log Message:
avoid conflicts with our own ioctls


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/sun/disklabel.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2015-09-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 26 03:31:53 UTC 2015

Modified Files:
src/sys/dev/sun: disklabel.h

Log Message:
avoid conflicts with our own ioctls


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/sun/disklabel.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/disklabel.h
diff -u src/sys/dev/sun/disklabel.h:1.5 src/sys/dev/sun/disklabel.h:1.6
--- src/sys/dev/sun/disklabel.h:1.5	Sun Sep  6 02:01:01 2015
+++ src/sys/dev/sun/disklabel.h	Fri Sep 25 23:31:52 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.h,v 1.5 2015/09/06 06:01:01 dholland Exp $ */
+/*	$NetBSD: disklabel.h,v 1.6 2015/09/26 03:31:52 christos Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -49,9 +49,9 @@
 #define	SUN_DKMAGIC	55998
 
 /* These are the guys that Sun's dkinfo needs... */
-#define DKIOCGGEOM	_IOR('d', 2, struct sun_dkgeom)	/* geometry info */
-#define DKIOCINFO	_IOR('d', 8, struct sun_dkctlr)	/* controller info */
-#define DKIOCGPART	_IOR('d', 4, struct sun_dkpart)	/* partition info */
+#define SUN_DKIOCGGEOM	_IOR('d', 2, struct sun_dkgeom)	/* geometry info */
+#define SUN_DKIOCINFO	_IOR('d', 8, struct sun_dkctlr)	/* controller info */
+#define SUN_DKIOCGPART	_IOR('d', 4, struct sun_dkpart)	/* partition info */
 
 /* geometry info */
 struct sun_dkgeom {



CVS commit: src/sys/dev/sun

2014-02-19 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Feb 20 02:09:28 UTC 2014

Modified Files:
src/sys/dev/sun: bwtwo.c

Log Message:
Call memset in a loop, not loop around doing nothing and calling memset
once.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/sun/bwtwo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/bwtwo.c
diff -u src/sys/dev/sun/bwtwo.c:1.31 src/sys/dev/sun/bwtwo.c:1.32
--- src/sys/dev/sun/bwtwo.c:1.31	Mon Dec  2 15:54:06 2013
+++ src/sys/dev/sun/bwtwo.c	Thu Feb 20 02:09:28 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bwtwo.c,v 1.31 2013/12/02 15:54:06 jdc Exp $ */
+/*	$NetBSD: bwtwo.c,v 1.32 2014/02/20 02:09:28 joerg Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bwtwo.c,v 1.31 2013/12/02 15:54:06 jdc Exp $);
+__KERNEL_RCSID(0, $NetBSD: bwtwo.c,v 1.32 2014/02/20 02:09:28 joerg Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -458,7 +458,7 @@ bwtwo_init_screen(void *cookie, struct v
 	 */
 	for (bits = (char *) ri-ri_bits;
 	bits  (char *) ri-ri_bits + ri-ri_stride * ri-ri_height;
-	bits += 4);
+	bits += 4)
 		memset(bits, (*defattr  16)  0xff, 4);
 	rasops_init(ri, 0, 0);
 	ri-ri_caps = 0;



CVS commit: src/sys/dev/sun

2014-02-19 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Feb 20 02:09:28 UTC 2014

Modified Files:
src/sys/dev/sun: bwtwo.c

Log Message:
Call memset in a loop, not loop around doing nothing and calling memset
once.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/sun/bwtwo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2013-12-03 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Dec  3 17:01:04 UTC 2013

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
- don't use defattr before it actually contains something useful
- clear the screen only once, when we know what colour to use
- set up the colour map only once, when we know which one to use
- no more funky colour flashing while cgsix attaches on my U1


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.62 src/sys/dev/sun/cgsix.c:1.63
--- src/sys/dev/sun/cgsix.c:1.62	Thu Sep 12 12:42:18 2013
+++ src/sys/dev/sun/cgsix.c	Tue Dec  3 17:01:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.62 2013/09/12 12:42:18 martin Exp $ */
+/*	$NetBSD: cgsix.c,v 1.63 2013/12/03 17:01:04 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.62 2013/09/12 12:42:18 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.63 2013/12/03 17:01:04 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -614,9 +614,6 @@ cg6attach(struct cgsix_softc *sc, const 
 	vcons_init(sc-vd, sc, cgsix_defaultscreen, cgsix_accessops);
 	sc-vd.init_screen = cgsix_init_screen;
 
-	cg6_setup_palette(sc);
-	cgsix_clearscreen(sc);
-
 	sc-sc_gc.gc_bitblt = cgsix_bitblt;
 	sc-sc_gc.gc_blitcookie = sc;
 	sc-sc_gc.gc_rop = CG6_ALU_COPY;
@@ -625,6 +622,19 @@ cg6attach(struct cgsix_softc *sc, const 
 		/* we mess with cg6_console_screen only once */
 		vcons_init_screen(sc-vd, cg6_console_screen, 1,
 		defattr);
+		sc-sc_bg = (defattr  16)  0xf; /* yes, this is an index into devcmap */
+		
+		/*
+		 * XXX
+		 * Is this actually necessary? We're going to use the blitter later on anyway.
+		 */ 
+		/* We need unaccelerated initial screen clear on old revisions */
+		if (sc-sc_fhcrev  2) {
+			memset(sc-sc_fb.fb_pixels, ri-ri_devcmap[sc-sc_bg],
+			sc-sc_stride * sc-sc_height);
+		} else
+			cgsix_clearscreen(sc);
+
 		cg6_console_screen.scr_flags |= VCONS_SCREEN_IS_STATIC;
 		
 		cgsix_defaultscreen.textops = ri-ri_ops;
@@ -655,6 +665,7 @@ cg6attach(struct cgsix_softc *sc, const 
 			defattr);
 		} else
 			(*ri-ri_ops.allocattr)(ri, 0, 0, 0, defattr);
+		sc-sc_bg = (defattr  16)  0xf;
 		if (ri-ri_flg  RI_ENABLE_ALPHA) {
 			glyphcache_init(sc-sc_gc, sc-sc_height + 5,
 (sc-sc_ramsize / sc-sc_stride) - 
@@ -1297,10 +1308,6 @@ cgsix_init_screen(void *cookie, struct v
 	}
 	ri-ri_bits = sc-sc_fb.fb_pixels;
 	
-	/* We need unaccelerated initial screen clear on old revisions */
-	if (sc-sc_fhcrev  2)
-		memset(sc-sc_fb.fb_pixels, (*defattr  16)  0xff,
-		sc-sc_stride * sc-sc_height);
 	rasops_init(ri, 0, 0);
 	ri-ri_caps = WSSCREEN_WSCOLORS | WSSCREEN_REVERSE;
 	rasops_reconfig(ri, sc-sc_height / ri-ri_font-fontheight,



CVS commit: src/sys/dev/sun

2013-12-03 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Dec  3 17:01:04 UTC 2013

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
- don't use defattr before it actually contains something useful
- clear the screen only once, when we know what colour to use
- set up the colour map only once, when we know which one to use
- no more funky colour flashing while cgsix attaches on my U1


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2013-12-02 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Mon Dec  2 15:54:06 UTC 2013

Modified Files:
src/sys/dev/sun: bwtwo.c

Log Message:
Only write to the framebuffer memory 32 bits at a time.  If we try to write
larger amounts, we will generate SER_WRITE|SER_SZERR with P4 framebuffers.
(Writing 64 bits at a time is the default with memset().)
Also, set the default attributes to zero to avoid vertical stripes from
uninitialised defattr.
XXX; screen is still not cleared of old text.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/sun/bwtwo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/bwtwo.c
diff -u src/sys/dev/sun/bwtwo.c:1.30 src/sys/dev/sun/bwtwo.c:1.31
--- src/sys/dev/sun/bwtwo.c:1.30	Wed Jan 11 16:10:13 2012
+++ src/sys/dev/sun/bwtwo.c	Mon Dec  2 15:54:06 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bwtwo.c,v 1.30 2012/01/11 16:10:13 macallan Exp $ */
+/*	$NetBSD: bwtwo.c,v 1.31 2013/12/02 15:54:06 jdc Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bwtwo.c,v 1.30 2012/01/11 16:10:13 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: bwtwo.c,v 1.31 2013/12/02 15:54:06 jdc Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -197,7 +197,7 @@ bwtwoattach(struct bwtwo_softc *sc, cons
 #if NWSDISPLAY  0
 	struct wsemuldisplaydev_attach_args aa;
 	struct rasops_info *ri = bw2_console_screen.scr_ri;
-	unsigned long defattr;
+	unsigned long defattr = 0;
 #endif
 
 	/* Fill in the remaining fbdevice values */
@@ -442,6 +442,7 @@ bwtwo_init_screen(void *cookie, struct v
 {
 	struct bwtwo_softc *sc = cookie;
 	struct rasops_info *ri = scr-scr_ri;
+	char *bits;
 
 	ri-ri_depth = 1;
 	ri-ri_width = sc-sc_width;
@@ -451,8 +452,14 @@ bwtwo_init_screen(void *cookie, struct v
 
 	ri-ri_bits = sc-sc_fb.fb_pixels;
 
-	memset(sc-sc_fb.fb_pixels, (*defattr  16)  0xff,
-	sc-sc_stride * sc-sc_height);
+	/*
+	 * Make sure that we set a maximum of 32 bits at a time,
+	 * otherwise we'll see VME write errors if this is a P4 BW2.
+	 */
+	for (bits = (char *) ri-ri_bits;
+	bits  (char *) ri-ri_bits + ri-ri_stride * ri-ri_height;
+	bits += 4);
+		memset(bits, (*defattr  16)  0xff, 4);
 	rasops_init(ri, 0, 0);
 	ri-ri_caps = 0;
 	rasops_reconfig(ri, sc-sc_height / ri-ri_font-fontheight,



CVS commit: src/sys/dev/sun

2013-12-02 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Mon Dec  2 15:54:06 UTC 2013

Modified Files:
src/sys/dev/sun: bwtwo.c

Log Message:
Only write to the framebuffer memory 32 bits at a time.  If we try to write
larger amounts, we will generate SER_WRITE|SER_SZERR with P4 framebuffers.
(Writing 64 bits at a time is the default with memset().)
Also, set the default attributes to zero to avoid vertical stripes from
uninitialised defattr.
XXX; screen is still not cleared of old text.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/sun/bwtwo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2013-11-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov  7 02:38:07 UTC 2013

Modified Files:
src/sys/dev/sun: ms_zs.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/sun/ms_zs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/ms_zs.c
diff -u src/sys/dev/sun/ms_zs.c:1.19 src/sys/dev/sun/ms_zs.c:1.20
--- src/sys/dev/sun/ms_zs.c:1.19	Tue May 12 09:21:06 2009
+++ src/sys/dev/sun/ms_zs.c	Wed Nov  6 21:38:07 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ms_zs.c,v 1.19 2009/05/12 13:21:06 cegger Exp $	*/
+/*	$NetBSD: ms_zs.c,v 1.20 2013/11/07 02:38:07 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ms_zs.c,v 1.19 2009/05/12 13:21:06 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: ms_zs.c,v 1.20 2013/11/07 02:38:07 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -125,14 +125,11 @@ ms_zs_attach(device_t parent, device_t s
 	struct ms_softc *ms = device_private(self);
 	struct zsc_attach_args *args = aux;
 	struct zs_chanstate *cs;
-	cfdata_t cf;
-	int channel, ms_unit;
+	int channel;
 	int reset, s;
 	int bps;
 
 	ms-ms_dev = self;
-	cf = device_cfdata(self);
-	ms_unit = device_unit(self);
 	channel = args-channel;
 	cs = zsc-zsc_cs[channel];
 	cs-cs_private = ms;



CVS commit: src/sys/dev/sun

2013-11-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov  7 02:38:07 UTC 2013

Modified Files:
src/sys/dev/sun: ms_zs.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/sun/ms_zs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/sys/dev/sun

2013-09-17 Thread Michael
Hello,

on Thursday 12 September 2013 08:42:19 Martin Husemann wrote:
 Module Name:  src
 Committed By: martin
 Date: Thu Sep 12 12:42:18 UTC 2013

 Modified Files:
   src/sys/dev/sun: cgsix.c

 Log Message:
 Simplify CG6_DRAW() and CG6_BLIT() macros so gcc 4.8.1 does not warn about
 them - assembler looks good, but Michael, can you please test nevertheless?

The patient is alive and well ;)

have fun
Michael


CVS commit: src/sys/dev/sun

2013-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep 15 14:10:04 UTC 2013

Modified Files:
src/sys/dev/sun: sunkbd.c

Log Message:
Remove unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/sun/sunkbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/sunkbd.c
diff -u src/sys/dev/sun/sunkbd.c:1.28 src/sys/dev/sun/sunkbd.c:1.29
--- src/sys/dev/sun/sunkbd.c:1.28	Sat Aug 14 20:52:05 2010
+++ src/sys/dev/sun/sunkbd.c	Sun Sep 15 14:10:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunkbd.c,v 1.28 2010/08/14 20:52:05 jym Exp $	*/
+/*	$NetBSD: sunkbd.c,v 1.29 2013/09/15 14:10:04 martin Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -51,7 +51,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sunkbd.c,v 1.28 2010/08/14 20:52:05 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: sunkbd.c,v 1.29 2013/09/15 14:10:04 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -239,11 +239,8 @@ int
 sunkbdinput(int c, struct tty *tp)
 {
 	struct kbd_sun_softc *k = tp-t_sc;
-	u_char *cc;
 	int error;
 
-	cc = tp-t_cc;
-
 	/*
 	 * Handle exceptional conditions (break, parity, framing).
 	 */



CVS commit: src/sys/dev/sun

2013-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep 15 14:13:20 UTC 2013

Modified Files:
src/sys/dev/sun: sunms.c

Log Message:
Remove unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/sun/sunms.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/sunms.c
diff -u src/sys/dev/sun/sunms.c:1.31 src/sys/dev/sun/sunms.c:1.32
--- src/sys/dev/sun/sunms.c:1.31	Tue May 12 14:46:39 2009
+++ src/sys/dev/sun/sunms.c	Sun Sep 15 14:13:19 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunms.c,v 1.31 2009/05/12 14:46:39 cegger Exp $	*/
+/*	$NetBSD: sunms.c,v 1.32 2013/09/15 14:13:19 martin Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sunms.c,v 1.31 2009/05/12 14:46:39 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: sunms.c,v 1.32 2013/09/15 14:13:19 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -141,16 +141,12 @@ sunms_attach(device_t parent, device_t s
 {
 	struct ms_softc *ms = device_private(self);
 	struct kbd_ms_tty_attach_args *args = aux;
-	cfdata_t cf;
 	struct tty *tp = args-kmta_tp;
-	int ms_unit;
 #if NWSMOUSE  0
 	struct wsmousedev_attach_args a;
 #endif
 
 	ms-ms_dev = self;
-	cf = device_cfdata(self);
-	ms_unit = device_unit(self);
 	tp-t_sc  = ms;
 	tp-t_dev = args-kmta_dev;
 	ms-ms_priv = tp;



CVS commit: src/sys/dev/sun

2013-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep 15 14:10:04 UTC 2013

Modified Files:
src/sys/dev/sun: sunkbd.c

Log Message:
Remove unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/sun/sunkbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2013-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep 15 14:13:20 UTC 2013

Modified Files:
src/sys/dev/sun: sunms.c

Log Message:
Remove unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/sun/sunms.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2013-09-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 12 12:42:18 UTC 2013

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
Simplify CG6_DRAW() and CG6_BLIT() macros so gcc 4.8.1 does not warn about
them - assembler looks good, but Michael, can you please test nevertheless?


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.61 src/sys/dev/sun/cgsix.c:1.62
--- src/sys/dev/sun/cgsix.c:1.61	Tue Jul 30 19:24:26 2013
+++ src/sys/dev/sun/cgsix.c	Thu Sep 12 12:42:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.61 2013/07/30 19:24:26 macallan Exp $ */
+/*	$NetBSD: cgsix.c,v 1.62 2013/09/12 12:42:18 martin Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.61 2013/07/30 19:24:26 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.62 2013/09/12 12:42:18 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -285,12 +285,12 @@ int cgsix_use_rasterconsole = 1;
 /*
  * Run a blitter command
  */
-#define CG6_BLIT(f) { volatile uint32_t foo; foo = f-fbc_blit; }
+#define CG6_BLIT(f) { (void)f-fbc_blit; }
 
 /*
  * Run a drawing command
  */
-#define CG6_DRAW(f) { volatile uint32_t foo; foo = f-fbc_draw; }
+#define CG6_DRAW(f) { (void)f-fbc_draw; }
 
 /*
  * Wait for the whole engine to go idle.  This may not matter in our case;



CVS commit: src/sys/dev/sun

2013-05-28 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue May 28 15:25:37 UTC 2013

Modified Files:
src/sys/dev/sun: cgsixreg.h

Log Message:
add a bunch of register definitions and clarify some comments


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/sun/cgsixreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsixreg.h
diff -u src/sys/dev/sun/cgsixreg.h:1.9 src/sys/dev/sun/cgsixreg.h:1.10
--- src/sys/dev/sun/cgsixreg.h:1.9	Tue Jul 10 22:34:32 2012
+++ src/sys/dev/sun/cgsixreg.h	Tue May 28 15:25:37 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsixreg.h,v 1.9 2012/07/10 22:34:32 macallan Exp $ */
+/*	$NetBSD: cgsixreg.h,v 1.10 2013/05/28 15:25:37 macallan Exp $ */
 
 /*
  * Copyright (c) 1993
@@ -83,13 +83,13 @@
 #define	FHC_FBID_SHIFT	24
 #define	FHC_REV_MASK	0x00f0	/* bits 20..23 are revision */
 #define	FHC_REV_SHIFT	20
-#define	FHC_FROP_DISABLE 0x0008	/* disable fast/font? rasterops */
-#define	FHC_ROW_DISABLE	0x0004	/* ??? */
-#define	FHC_SRC_DISABLE	0x0002	/* ??? */
+#define	FHC_FROP_DISABLE 0x0008	/* disable fast rasterops */
+#define	FHC_ROW_DISABLE	0x0004	/* disable row cache */
+#define	FHC_SRC_DISABLE	0x0002	/* disable source cache */
 #define	FHC_DST_DISABLE	0x0001	/* disable destination cache */
-#define	FHC_RESET	0x8000	/* ??? */
-#define	FHC_XXX0	0x4000	/* ??? */
-#define	FHC_LEBO	0x2000	/* set little endian byte order? */
+#define	FHC_RESET	0x8000	/* reset FBC */
+#define	FHC_XXX0	0x4000	/* unused */
+#define	FHC_LEBO	0x2000	/* set little endian byte order */
 #define	FHC_RES_MASK	0x1800	/* bits 1112 are resolution */
 #define	FHC_RES_1024	 0x		/* res = 1024x768 */
 #define	FHC_RES_1152	 0x0800		/* res = 1152x900 */
@@ -99,8 +99,8 @@
 #define	FHC_CPU_SPARC	 0x		/* cpu = sparc */
 #define	FHC_CPU_68020	 0x0200		/* cpu = 68020 */
 #define	FHC_CPU_386	 0x0400		/* cpu = 80386 */
-#define	FHC_CPU_XXX	 0x0600		/* ??? */
-#define	FHC_TEST	0x0100	/* ??? test window ??? */
+#define	FHC_CPU_XXX	 0x0600		/* unused */
+#define	FHC_TEST	0x0100	/* modify TESTX and TESTY */
 #define	FHC_TESTX_MASK	0x00f0	/* bits 4..7 are test window X */
 #define	FHC_TESTX_SHIFT	4
 #define	FHC_TESTY_MASK	0x000f	/* bits 0..3 are test window Y */
@@ -132,8 +132,8 @@ struct cg6_thc {
 #define	THC_MISC_RESET		0x1000	/* ??? */
 #define	THC_MISC_XXX2		0x0800	/* unused */
 #define	THC_MISC_VIDEN		0x0400	/* video enable */
-#define	THC_MISC_SYNC		0x0200	/* not sure what ... */
-#define	THC_MISC_VSYNC		0x0100	/* ... these really are */
+#define	THC_MISC_SYNC		0x0200	/* sync status */
+#define	THC_MISC_VSYNC		0x0100	/* vsync status */
 #define	THC_MISC_SYNCEN		0x0080	/* sync enable */
 #define	THC_MISC_CURSRES	0x0040	/* cursor resolution */
 #define	THC_MISC_INTEN		0x0020	/* v.retrace intr enable */
@@ -162,9 +162,9 @@ struct cg6_tec_xxx {
  * stuff canned values in them (eg, offx).
  */
 struct cg6_fbc {
-	u_int32_t fbc_pad1[1];
-	volatile u_int32_t fbc_mode;		/* mode setting */
-	u_int32_t fbc_clip;		/* function unknown */
+	u_int32_t fbc_config;		/* r/o CONFIG register */
+	volatile u_int32_t fbc_mode;	/* mode setting */
+	u_int32_t fbc_clip;		/* TEC clip check */
 	u_int32_t fbc_pad2[1];
 	u_int32_t fbc_s;		/* global status */
 	u_int32_t fbc_draw;		/* drawing pipeline status */
@@ -353,10 +353,33 @@ struct cg6_fbc {
 
 #define GX_BLT_INPROGRESS   0x2000
 
-#define GX_INPROGRESS   0x1000
+/* status register(s) */
+#define GX_EXCEPTION		0x8000
+#define GX_TEC_EXCEPTION	0x4000
 #define GX_FULL 0x2000
+#define GX_INPROGRESS   0x1000
+#define GX_UNSUPPORTED_ATTR	0x0200
+#define GX_HRMONO		0x0100
+#define GX_OVERFLOW		0x0020
+#define GX_PICK			0x0010
+#define GX_TEC_HIDDEN		0x0004
+#define GX_TEC_INTERSECT	0x0002
+#define GX_TEC_VISIBLE		0x0001
+#define GX_BLIT_HARDWARE	0x8000	/* hardware can blit this */
+#define GX_BLIT_SOFTWARE	0x4000	/* software must blit this */
+#define GX_BLIT_SRC_HIDDEN	0x2000
+#define GX_BLIT_SRC_INTERSECT	0x1000
+#define GX_BLIT_SRC_VISIBLE	0x0800
+#define GX_BLIT_DST_HIDDEN	0x0400
+#define GX_BLIT_DST_INTERSECT	0x0200
+#define GX_BLIT_DST_VISIBLE	0x0100
+#define GX_DRAW_HARDWARE	0x0010	/* hardware can draw this */
+#define GX_DRAW_SOFTAWRE	0x0008	/* software must draw this */
+#define GX_DRAW_HIDDEN		0x0004
+#define GX_DRAW_INTERSECT	0x0002
+#define GX_DRAW_VISIBLE		0x0001
 
-/* modes */
+/* MISC register */
 #define GX_INDEX(n) ((n)  4)
 #define GX_INDEX_ALL0x0030
 #define GX_INDEX_MOD0x0040



CVS commit: src/sys/dev/sun

2013-05-28 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue May 28 15:25:37 UTC 2013

Modified Files:
src/sys/dev/sun: cgsixreg.h

Log Message:
add a bunch of register definitions and clarify some comments


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/sun/cgsixreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2012-11-13 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Nov 13 20:47:58 UTC 2012

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
don't claim alpha font support unless we have enough off-screen memory to
cache a useful number of glyphs
this should probably be CPU speed dependent, most UltraSPARCs can likely
render anti-aliased fonts fast enough on the fly


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.59 src/sys/dev/sun/cgsix.c:1.60
--- src/sys/dev/sun/cgsix.c:1.59	Wed Jul 18 02:31:46 2012
+++ src/sys/dev/sun/cgsix.c	Tue Nov 13 20:47:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.59 2012/07/18 02:31:46 macallan Exp $ */
+/*	$NetBSD: cgsix.c,v 1.60 2012/11/13 20:47:58 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.59 2012/07/18 02:31:46 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.60 2012/11/13 20:47:58 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -598,7 +598,7 @@ cg6attach(struct cgsix_softc *sc, const 
 	sc-sc_width = fb-fb_type.fb_width;
 	sc-sc_stride = fb-fb_type.fb_width;
 	sc-sc_height = fb-fb_type.fb_height;
-
+	
 	printf(%s: framebuffer size: %d MB\n, device_xname(sc-sc_dev), 
 	sc-sc_ramsize  20);
 
@@ -634,14 +634,15 @@ cg6attach(struct cgsix_softc *sc, const 
 		SCREEN_VISIBLE(cg6_console_screen);
 		sc-vd.active = cg6_console_screen;
 		wsdisplay_cnattach(cgsix_defaultscreen, ri, 0, 0, defattr);
-		glyphcache_init(sc-sc_gc, sc-sc_height + 5,
+		if (ri-ri_flg  RI_ENABLE_ALPHA) {
+			glyphcache_init(sc-sc_gc, sc-sc_height + 5,
 (sc-sc_ramsize / sc-sc_stride) - 
   sc-sc_height - 5,
 sc-sc_width,
 ri-ri_font-fontwidth,
 ri-ri_font-fontheight,
 defattr);
-		
+		}	
 		vcons_replay_msgbuf(cg6_console_screen);
 	} else {
 		/*
@@ -653,13 +654,15 @@ cg6attach(struct cgsix_softc *sc, const 
 			vcons_init_screen(sc-vd, cg6_console_screen, 1,
 			defattr);
 		}
-		glyphcache_init(sc-sc_gc, sc-sc_height + 5,
+		if (ri-ri_flg  RI_ENABLE_ALPHA) {
+			glyphcache_init(sc-sc_gc, sc-sc_height + 5,
 (sc-sc_ramsize / sc-sc_stride) - 
   sc-sc_height - 5,
 sc-sc_width,
 ri-ri_font-fontwidth,
 ri-ri_font-fontheight,
 defattr);
+		}
 	}
 	cg6_setup_palette(sc);
 	
@@ -1280,13 +1283,17 @@ cgsix_init_screen(void *cookie, struct v
 {
 	struct cgsix_softc *sc = cookie;
 	struct rasops_info *ri = scr-scr_ri;
+	int av;
 
 	ri-ri_depth = 8;
 	ri-ri_width = sc-sc_width;
 	ri-ri_height = sc-sc_height;
 	ri-ri_stride = sc-sc_stride;
-	ri-ri_flg = RI_CENTER | RI_ENABLE_ALPHA | RI_8BIT_IS_RGB;
-
+	av = sc-sc_ramsize - (sc-sc_height * sc-sc_stride);
+	ri-ri_flg = RI_CENTER  | RI_8BIT_IS_RGB;
+	if (av  (128 * 1024)) {
+		ri-ri_flg |= RI_ENABLE_ALPHA;
+	}
 	ri-ri_bits = sc-sc_fb.fb_pixels;
 	
 	/* We need unaccelerated initial screen clear on old revisions */



CVS commit: src/sys/dev/sun

2012-11-13 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Nov 13 20:47:58 UTC 2012

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
don't claim alpha font support unless we have enough off-screen memory to
cache a useful number of glyphs
this should probably be CPU speed dependent, most UltraSPARCs can likely
render anti-aliased fonts fast enough on the fly


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2012-07-17 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jul 18 02:31:47 UTC 2012

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
wipe the glyph cache when re-entring terminal emulation mode


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.58 src/sys/dev/sun/cgsix.c:1.59
--- src/sys/dev/sun/cgsix.c:1.58	Fri Jul 13 19:48:45 2012
+++ src/sys/dev/sun/cgsix.c	Wed Jul 18 02:31:46 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.58 2012/07/13 19:48:45 macallan Exp $ */
+/*	$NetBSD: cgsix.c,v 1.59 2012/07/18 02:31:46 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.58 2012/07/13 19:48:45 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.59 2012/07/18 02:31:46 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -704,6 +704,7 @@ cgsixclose(dev_t dev, int flags, int mod
 
 		cg6_ras_init(sc);
 		cg6_setup_palette(sc);
+		glyphcache_wipe(sc-sc_gc);
 
 		/* we don't know if the screen exists */
 		if (ms != NULL)
@@ -1191,6 +1192,7 @@ cgsix_ioctl(void *v, void *vs, u_long cm
 		cg6_reset(sc);
 		cg6_ras_init(sc);
 		cg6_setup_palette(sc);
+		glyphcache_wipe(sc-sc_gc);
 		vcons_redraw_screen(ms);
 	}
 }



CVS commit: src/sys/dev/sun

2012-07-13 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Jul 13 19:48:45 UTC 2012

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
wait for the blitter to go idle before trying to send another command
Apparently on some CG6 the GX_FULL bit is not a reliable indication wether the
engine is ready to accept another command ( LX onboard for example ) - might
be a hardware bug.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.57 src/sys/dev/sun/cgsix.c:1.58
--- src/sys/dev/sun/cgsix.c:1.57	Thu Jul 12 01:20:22 2012
+++ src/sys/dev/sun/cgsix.c	Fri Jul 13 19:48:45 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.57 2012/07/12 01:20:22 macallan Exp $ */
+/*	$NetBSD: cgsix.c,v 1.58 2012/07/13 19:48:45 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.57 2012/07/12 01:20:22 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.58 2012/07/13 19:48:45 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -303,8 +303,16 @@ int cgsix_use_rasterconsole = 1;
 		/*EMPTY*/;		\
 } while (0)
 
+/*
+ * something is missing here
+ * Waiting for GX_FULL to clear should be enough to send another command
+ * but some CG6 ( LX onboard for example ) lock up if we do that while
+ * it works fine on others ( a 4MB TGX+ I've got here )
+ * So, until I figure out what's going on we wait for the blitter to go
+ * fully idle.
+ */
 #define CG6_WAIT_READY(fbc) do {	\
-   	while (((fbc)-fbc_s  GX_FULL) != 0)\
+   	while (((fbc)-fbc_s  GX_INPROGRESS/*GX_FULL*/) != 0)		\
 		/*EMPTY*/;		\
 } while (0)
 



CVS commit: src/sys/dev/sun

2012-07-13 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Jul 13 19:48:45 UTC 2012

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
wait for the blitter to go idle before trying to send another command
Apparently on some CG6 the GX_FULL bit is not a reliable indication wether the
engine is ready to accept another command ( LX onboard for example ) - might
be a hardware bug.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2012-07-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jul 11 15:03:15 UTC 2012

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
don't set clipping parameters and such every time we send a blitter command


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.54 src/sys/dev/sun/cgsix.c:1.55
--- src/sys/dev/sun/cgsix.c:1.54	Tue Jul 10 22:50:41 2012
+++ src/sys/dev/sun/cgsix.c	Wed Jul 11 15:03:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.54 2012/07/10 22:50:41 macallan Exp $ */
+/*	$NetBSD: cgsix.c,v 1.55 2012/07/11 15:03:14 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.54 2012/07/10 22:50:41 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.55 2012/07/11 15:03:14 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -318,6 +318,7 @@ static void cg6_ras_eraserows(void *, in
 #if defined(RASTERCONSOLE)  defined(CG6_BLIT_CURSOR)
 static void cg6_ras_do_cursor(struct rasops_info *);
 #endif
+
 static void
 cg6_ras_init(struct cgsix_softc *sc)
 {
@@ -326,6 +327,16 @@ cg6_ras_init(struct cgsix_softc *sc)
 	CG6_DRAIN(fbc);
 	fbc-fbc_mode = ~CG6_MODE_MASK;
 	fbc-fbc_mode |= CG6_MODE;
+
+	/* set some common drawing engine parameters */
+	fbc-fbc_clip = 0;
+	fbc-fbc_s = 0;
+	fbc-fbc_offx = 0;
+	fbc-fbc_offy = 0;
+	fbc-fbc_clipminx = 0;
+	fbc-fbc_clipminy = 0;
+	fbc-fbc_clipmaxx = 0x3fff;
+	fbc-fbc_clipmaxy = 0x3fff;
 }
 
 static void
@@ -355,15 +366,10 @@ cg6_ras_copyrows(void *cookie, int src, 
 	n *= ri-ri_font-fontheight;
 	src *= ri-ri_font-fontheight;
 	dst *= ri-ri_font-fontheight;
-	fbc-fbc_clip = 0;
-	fbc-fbc_s = 0;
-	fbc-fbc_offx = 0;
-	fbc-fbc_offy = 0;
-	fbc-fbc_clipminx = 0;
-	fbc-fbc_clipminy = 0;
-	fbc-fbc_clipmaxx = ri-ri_width - 1;
-	fbc-fbc_clipmaxy = ri-ri_height - 1;
+
 	fbc-fbc_alu = CG6_ALU_COPY;
+	fbc-fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
+
 	fbc-fbc_x0 = ri-ri_xorigin;
 	fbc-fbc_y0 = ri-ri_yorigin + src;
 	fbc-fbc_x1 = ri-ri_xorigin + ri-ri_emuwidth - 1;
@@ -406,15 +412,10 @@ cg6_ras_copycols(void *cookie, int row, 
 	src *= ri-ri_font-fontwidth;
 	dst *= ri-ri_font-fontwidth;
 	row *= ri-ri_font-fontheight;
-	fbc-fbc_clip = 0;
-	fbc-fbc_s = 0;
-	fbc-fbc_offx = 0;
-	fbc-fbc_offy = 0;
-	fbc-fbc_clipminx = 0;
-	fbc-fbc_clipminy = 0;
-	fbc-fbc_clipmaxx = ri-ri_width - 1;
-	fbc-fbc_clipmaxy = ri-ri_height - 1;
+
 	fbc-fbc_alu = CG6_ALU_COPY;
+	fbc-fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
+
 	fbc-fbc_x0 = ri-ri_xorigin + src;
 	fbc-fbc_y0 = ri-ri_yorigin + row;
 	fbc-fbc_x1 = ri-ri_xorigin + src + n - 1;
@@ -450,15 +451,10 @@ cg6_ras_erasecols(void *cookie, int row,
 	n *= ri-ri_font-fontwidth;
 	col *= ri-ri_font-fontwidth;
 	row *= ri-ri_font-fontheight;
-	fbc-fbc_clip = 0;
-	fbc-fbc_s = 0;
-	fbc-fbc_offx = 0;
-	fbc-fbc_offy = 0;
-	fbc-fbc_clipminx = 0;
-	fbc-fbc_clipminy = 0;
-	fbc-fbc_clipmaxx = ri-ri_width - 1;
-	fbc-fbc_clipmaxy = ri-ri_height - 1;
+
 	fbc-fbc_alu = CG6_ALU_FILL;
+	fbc-fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
+
 	fbc-fbc_fg = ri-ri_devcmap[(attr  16)  0xff];
 	fbc-fbc_arecty = ri-ri_yorigin + row;
 	fbc-fbc_arectx = ri-ri_xorigin + col;
@@ -485,15 +481,10 @@ cg6_ras_eraserows(void *cookie, int row,
 		n = ri-ri_rows - row;
 	if (n = 0)
 		return;
-	fbc-fbc_clip = 0;
-	fbc-fbc_s = 0;
-	fbc-fbc_offx = 0;
-	fbc-fbc_offy = 0;
-	fbc-fbc_clipminx = 0;
-	fbc-fbc_clipminy = 0;
-	fbc-fbc_clipmaxx = ri-ri_width - 1;
-	fbc-fbc_clipmaxy = ri-ri_height - 1;
+
 	fbc-fbc_alu = CG6_ALU_FILL;
+	fbc-fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
+
 	fbc-fbc_fg = ri-ri_devcmap[(attr  16)  0xff];
 	if ((n == ri-ri_rows)  (ri-ri_flg  RI_FULLCLEAR)) {
 		fbc-fbc_arecty = 0;
@@ -1286,15 +1277,10 @@ cgsix_rectfill(struct cgsix_softc *sc, i
 	volatile struct cg6_fbc *fbc = sc-sc_fbc;
 	
 	CG6_DRAIN(fbc);
-	fbc-fbc_clip = 0;
-	fbc-fbc_s = 0;
-	fbc-fbc_offx = 0;
-	fbc-fbc_offy = 0;
-	fbc-fbc_clipminx = 0;
-	fbc-fbc_clipminy = 0;
-	fbc-fbc_clipmaxx = sc-sc_width - 1;
-	fbc-fbc_clipmaxy = sc-sc_height - 1;
+
 	fbc-fbc_alu = CG6_ALU_FILL;
+	fbc-fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
+
 	fbc-fbc_fg = col;
 	fbc-fbc_arecty = ys;
 	fbc-fbc_arectx = xs;
@@ -1398,7 +1384,6 @@ cgsix_putchar(void *cookie, int row, int
 }
 /* put the chip back to normal */
 fbc-fbc_incy = 0;
-fbc-fbc_mode = GX_BLIT_NOSRC | GX_MODE_COLOR8;
 			}
 		}
 	}
@@ -1448,15 +1433,10 @@ cgsix_clearscreen(struct cgsix_softc *sc
 		volatile struct cg6_fbc *fbc = sc-sc_fbc;
 		
 		CG6_DRAIN(fbc);
-		fbc-fbc_clip = 0;
-		fbc-fbc_s = 0;
-		fbc-fbc_offx = 0;
-		fbc-fbc_offy = 0;
-		fbc-fbc_clipminx = 0;
-		fbc-fbc_clipminy = 0;
-		fbc-fbc_clipmaxx = ri-ri_width - 1;
-		fbc-fbc_clipmaxy = ri-ri_height - 1;
+
 		fbc-fbc_alu = CG6_ALU_FILL;
+		

CVS commit: src/sys/dev/sun

2012-07-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jul 11 16:59:55 UTC 2012

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
don't wait for the blitter unless we want to send another command and the
pipeline is full


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.55 src/sys/dev/sun/cgsix.c:1.56
--- src/sys/dev/sun/cgsix.c:1.55	Wed Jul 11 15:03:14 2012
+++ src/sys/dev/sun/cgsix.c	Wed Jul 11 16:59:55 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.55 2012/07/11 15:03:14 macallan Exp $ */
+/*	$NetBSD: cgsix.c,v 1.56 2012/07/11 16:59:55 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.55 2012/07/11 15:03:14 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.56 2012/07/11 16:59:55 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -281,22 +281,14 @@ int cgsix_use_rasterconsole = 1;
 )
 
 /*
- * Wait for a blit to finish.
- * 0x800 bit: function unknown; 0x2000 bit: GX_BLT_INPROGRESS
+ * Run a blitter command
  */
-#define CG6_BLIT_WAIT(fbc) do {		\
-	while (((fbc)-fbc_blit  0xa000) == 0xa000)		\
-		/*EMPTY*/;		\
-} while (0)
+#define CG6_BLIT(f) { volatile uint32_t foo; foo = f-fbc_blit; }
 
 /*
- * Wait for a drawing operation to finish, or at least get queued.
- * 0x800 bit: function unknown; 0x2000 bit: GX_FULL
+ * Run a drawing command
  */
-#define CG6_DRAW_WAIT(fbc) do {		\
-   	while (((fbc)-fbc_draw  0xa000) == 0xa000)		\
-		/*EMPTY*/;		\
-} while (0)
+#define CG6_DRAW(f) { volatile uint32_t foo; foo = f-fbc_draw; }
 
 /*
  * Wait for the whole engine to go idle.  This may not matter in our case;
@@ -305,7 +297,12 @@ int cgsix_use_rasterconsole = 1;
  * 0x1000 bit: GX_INPROGRESS
  */
 #define CG6_DRAIN(fbc) do {		\
-	while ((fbc)-fbc_s  0x1000)\
+	while ((fbc)-fbc_s  GX_INPROGRESS)\
+		/*EMPTY*/;		\
+} while (0)
+
+#define CG6_WAIT_READY(fbc) do {	\
+   	while (((fbc)-fbc_s  GX_FULL) != 0)\
 		/*EMPTY*/;		\
 } while (0)
 
@@ -367,6 +364,8 @@ cg6_ras_copyrows(void *cookie, int src, 
 	src *= ri-ri_font-fontheight;
 	dst *= ri-ri_font-fontheight;
 
+	CG6_WAIT_READY(fbc);
+
 	fbc-fbc_alu = CG6_ALU_COPY;
 	fbc-fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
 
@@ -378,8 +377,7 @@ cg6_ras_copyrows(void *cookie, int src, 
 	fbc-fbc_y2 = ri-ri_yorigin + dst;
 	fbc-fbc_x3 = ri-ri_xorigin + ri-ri_emuwidth - 1;
 	fbc-fbc_y3 = ri-ri_yorigin + dst + n - 1;
-	CG6_BLIT_WAIT(fbc);
-	CG6_DRAIN(fbc);
+	CG6_BLIT(fbc);
 }
 
 static void
@@ -413,6 +411,8 @@ cg6_ras_copycols(void *cookie, int row, 
 	dst *= ri-ri_font-fontwidth;
 	row *= ri-ri_font-fontheight;
 
+	CG6_WAIT_READY(fbc);
+
 	fbc-fbc_alu = CG6_ALU_COPY;
 	fbc-fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
 
@@ -426,8 +426,7 @@ cg6_ras_copycols(void *cookie, int row, 
 	fbc-fbc_x3 = ri-ri_xorigin + dst + n - 1;
 	fbc-fbc_y3 = ri-ri_yorigin + row + 
 	ri-ri_font-fontheight - 1;
-	CG6_BLIT_WAIT(fbc);
-	CG6_DRAIN(fbc);
+	CG6_BLIT(fbc);
 }
 
 static void
@@ -452,6 +451,7 @@ cg6_ras_erasecols(void *cookie, int row,
 	col *= ri-ri_font-fontwidth;
 	row *= ri-ri_font-fontheight;
 
+	CG6_WAIT_READY(fbc);
 	fbc-fbc_alu = CG6_ALU_FILL;
 	fbc-fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
 
@@ -461,8 +461,7 @@ cg6_ras_erasecols(void *cookie, int row,
 	fbc-fbc_arecty = ri-ri_yorigin + row + 
 	ri-ri_font-fontheight - 1;
 	fbc-fbc_arectx = ri-ri_xorigin + col + n - 1;
-	CG6_DRAW_WAIT(fbc);
-	CG6_DRAIN(fbc);
+	CG6_DRAW(fbc);
 }
 
 static void
@@ -482,6 +481,7 @@ cg6_ras_eraserows(void *cookie, int row,
 	if (n = 0)
 		return;
 
+	CG6_WAIT_READY(fbc);
 	fbc-fbc_alu = CG6_ALU_FILL;
 	fbc-fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
 
@@ -499,8 +499,7 @@ cg6_ras_eraserows(void *cookie, int row,
 		(n * ri-ri_font-fontheight) - 1;
 		fbc-fbc_arectx = ri-ri_xorigin + ri-ri_emuwidth - 1;
 	}
-	CG6_DRAW_WAIT(fbc);
-	CG6_DRAIN(fbc);
+	CG6_DRAW(fbc);
 }
 
 #if defined(RASTERCONSOLE)  defined(CG6_BLIT_CURSOR)
@@ -1275,8 +1274,8 @@ cgsix_rectfill(struct cgsix_softc *sc, i
 uint32_t col)
 {
 	volatile struct cg6_fbc *fbc = sc-sc_fbc;
-	
-	CG6_DRAIN(fbc);
+
+	CG6_WAIT_READY(fbc);
 
 	fbc-fbc_alu = CG6_ALU_FILL;
 	fbc-fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
@@ -1286,7 +1285,7 @@ cgsix_rectfill(struct cgsix_softc *sc, i
 	fbc-fbc_arectx = xs;
 	fbc-fbc_arecty = ys + he - 1;
 	fbc-fbc_arectx = xs + wi - 1;
-	CG6_DRAW_WAIT(fbc);
+	CG6_DRAW(fbc);
 }
 
 void 
@@ -1294,7 +1293,9 @@ cgsix_setup_mono(struct cgsix_softc *sc,
 uint32_t fg, uint32_t bg) 
 {
 	volatile struct cg6_fbc *fbc=sc-sc_fbc;
-	CG6_DRAIN(fbc);
+
+	CG6_WAIT_READY(fbc);
+
 	fbc-fbc_x0 = x;
 	fbc-fbc_x1 = x + wi - 1;
 	fbc-fbc_y0 = y;
@@ -1432,7 

CVS commit: src/sys/dev/sun

2012-07-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Jul 12 01:20:22 UTC 2012

Modified Files:
src/sys/dev/sun: cgsix.c cgsixvar.h files.sun

Log Message:
support anti-aliased fonts


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/sun/cgsix.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/sun/cgsixvar.h
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/sun/files.sun

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.56 src/sys/dev/sun/cgsix.c:1.57
--- src/sys/dev/sun/cgsix.c:1.56	Wed Jul 11 16:59:55 2012
+++ src/sys/dev/sun/cgsix.c	Thu Jul 12 01:20:22 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.56 2012/07/11 16:59:55 macallan Exp $ */
+/*	$NetBSD: cgsix.c,v 1.57 2012/07/12 01:20:22 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.56 2012/07/11 16:59:55 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.57 2012/07/12 01:20:22 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -167,10 +167,12 @@ void 	cgsix_setup_mono(struct cgsix_soft
 		uint32_t);
 void 	cgsix_feed_line(struct cgsix_softc *, int, uint8_t *);
 void 	cgsix_rectfill(struct cgsix_softc *, int, int, int, int, uint32_t);
+void	cgsix_bitblt(void *, int, int, int, int, int, int, int);
 
 int	cgsix_putcmap(struct cgsix_softc *, struct wsdisplay_cmap *);
 int	cgsix_getcmap(struct cgsix_softc *, struct wsdisplay_cmap *);
 void	cgsix_putchar(void *, int, int, u_int, long);
+void	cgsix_putchar_aa(void *, int, int, u_int, long);
 void	cgsix_cursor(void *, int, int, int);
 
 struct wsdisplay_accessops cgsix_accessops = {
@@ -607,6 +609,10 @@ cg6attach(struct cgsix_softc *sc, const 
 	cg6_setup_palette(sc);
 	cgsix_clearscreen(sc);
 
+	sc-sc_gc.gc_bitblt = cgsix_bitblt;
+	sc-sc_gc.gc_blitcookie = sc;
+	sc-sc_gc.gc_rop = CG6_ALU_COPY;
+
 	if(isconsole) {
 		/* we mess with cg6_console_screen only once */
 		vcons_init_screen(sc-vd, cg6_console_screen, 1,
@@ -620,13 +626,34 @@ cg6attach(struct cgsix_softc *sc, const 
 		SCREEN_VISIBLE(cg6_console_screen);
 		sc-vd.active = cg6_console_screen;
 		wsdisplay_cnattach(cgsix_defaultscreen, ri, 0, 0, defattr);
+		glyphcache_init(sc-sc_gc, sc-sc_height + 5,
+(sc-sc_ramsize / sc-sc_stride) - 
+  sc-sc_height - 5,
+sc-sc_width,
+ri-ri_font-fontwidth,
+ri-ri_font-fontheight,
+defattr);
+		
 		vcons_replay_msgbuf(cg6_console_screen);
 	} else {
-		/* 
-		 * we're not the console so we just clear the screen and don't 
-		 * set up any sort of text display
+		/*
+		 * since we're not the console we can postpone the rest
+		 * until someone actually allocates a screen for us
 		 */
+		if (cg6_console_screen.scr_ri.ri_rows == 0) {
+			/* do some minimal setup to avoid weirdnesses later */
+			vcons_init_screen(sc-vd, cg6_console_screen, 1,
+			defattr);
+		}
+		glyphcache_init(sc-sc_gc, sc-sc_height + 5,
+(sc-sc_ramsize / sc-sc_stride) - 
+  sc-sc_height - 5,
+sc-sc_width,
+ri-ri_font-fontwidth,
+ri-ri_font-fontheight,
+defattr);
 	}
+	cg6_setup_palette(sc);
 	
 	aa.scrdata = cgsix_screenlist;
 	aa.console = isconsole;
@@ -1095,6 +1122,8 @@ cg6_setup_palette(struct cgsix_softc *sc
 {
 	int i, j;
 
+	rasops_get_cmap(cg6_console_screen.scr_ri, sc-sc_default_cmap,
+	sizeof(sc-sc_default_cmap));
 	j = 0;
 	for (i = 0; i  256; i++) {
 		sc-sc_cmap.cm_map[i][0] = sc-sc_default_cmap[j];
@@ -1246,7 +1275,7 @@ cgsix_init_screen(void *cookie, struct v
 	ri-ri_width = sc-sc_width;
 	ri-ri_height = sc-sc_height;
 	ri-ri_stride = sc-sc_stride;
-	ri-ri_flg = RI_CENTER;
+	ri-ri_flg = RI_CENTER | RI_ENABLE_ALPHA | RI_8BIT_IS_RGB;
 
 	ri-ri_bits = sc-sc_fb.fb_pixels;
 	
@@ -1266,7 +1295,10 @@ cgsix_init_screen(void *cookie, struct v
 	ri-ri_ops.eraserows = cg6_ras_eraserows;
 	ri-ri_ops.erasecols = cg6_ras_erasecols;
 	ri-ri_ops.cursor = cgsix_cursor;
-	ri-ri_ops.putchar = cgsix_putchar;
+	if (FONT_IS_ALPHA(ri-ri_font)) {
+		ri-ri_ops.putchar = cgsix_putchar_aa;
+	} else
+		ri-ri_ops.putchar = cgsix_putchar;
 }
 
 void 
@@ -1288,6 +1320,28 @@ cgsix_rectfill(struct cgsix_softc *sc, i
 	CG6_DRAW(fbc);
 }
 
+void
+cgsix_bitblt(void *cookie, int xs, int ys, int xd, int yd,
+int wi, int he, int rop)
+{
+	struct cgsix_softc *sc = cookie;
+	volatile struct cg6_fbc *fbc = sc-sc_fbc;
+	CG6_WAIT_READY(fbc);
+
+	fbc-fbc_alu = rop;
+	fbc-fbc_mode = GX_BLIT_SRC | GX_MODE_COLOR8;
+
+	fbc-fbc_x0 = xs;
+	fbc-fbc_y0 = ys;
+	fbc-fbc_x1 = xs + wi - 1;
+	fbc-fbc_y1 = ys + he - 1;
+	fbc-fbc_x2 = xd;
+	fbc-fbc_y2 = yd;
+	fbc-fbc_x3 = xd + wi - 1;
+	fbc-fbc_y3 = yd + he - 1;
+	CG6_BLIT(fbc);
+}
+
 void 
 cgsix_setup_mono(struct cgsix_softc *sc, int x, int y, int wi, int he, 
 uint32_t fg, uint32_t bg) 
@@ -1391,6 +1445,109 @@ cgsix_putchar(void *cookie, int row, int
 }
 
 void

CVS commit: src/sys/dev/sun

2012-07-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jul 11 16:59:55 UTC 2012

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
don't wait for the blitter unless we want to send another command and the
pipeline is full


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2012-07-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Jul 12 01:20:22 UTC 2012

Modified Files:
src/sys/dev/sun: cgsix.c cgsixvar.h files.sun

Log Message:
support anti-aliased fonts


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/sun/cgsix.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/sun/cgsixvar.h
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/sun/files.sun

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2012-07-10 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Jul 10 22:33:16 UTC 2012

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
- re-initialize only when we're really going back to terminal emulation
- don't try to redraw a non-existing screen
- don't try to mmap sbus ranges through /dev/ttyE*


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.51 src/sys/dev/sun/cgsix.c:1.52
--- src/sys/dev/sun/cgsix.c:1.51	Wed Jan 11 16:10:13 2012
+++ src/sys/dev/sun/cgsix.c	Tue Jul 10 22:33:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.51 2012/01/11 16:10:13 macallan Exp $ */
+/*	$NetBSD: cgsix.c,v 1.52 2012/07/10 22:33:15 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.51 2012/01/11 16:10:13 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.52 2012/07/10 22:33:15 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -609,6 +609,7 @@ cg6attach(struct cgsix_softc *sc, const 
 	cg6_ras_init(sc);
 	sc-sc_mode = WSDISPLAYIO_MODE_EMUL;
 	sc-sc_bg = WS_DEFAULT_BG;
+	sc-sc_fb_is_open = FALSE;
 	
 	vcons_init(sc-vd, sc, cgsix_defaultscreen, cgsix_accessops);
 	sc-vd.init_screen = cgsix_init_screen;
@@ -653,10 +654,13 @@ cg6attach(struct cgsix_softc *sc, const 
 int
 cgsixopen(dev_t dev, int flags, int mode, struct lwp *l)
 {
-	int unit = minor(dev);
+	device_t dv = device_lookup(cgsix_cd, minor(dev));
+	struct cgsix_softc *sc = device_private(dv);
 
-	if (device_lookup(cgsix_cd, unit) == NULL)
+	if (dv == NULL)
 		return ENXIO;
+	sc-sc_fb_is_open = TRUE;
+
 	return 0;
 }
 
@@ -667,9 +671,19 @@ cgsixclose(dev_t dev, int flags, int mod
 	struct cgsix_softc *sc = device_private(dv);
 
 	cg6_reset(sc);
+	sc-sc_fb_is_open = FALSE;
 
 #if NWSDISPLAY  0
-	cg6_setup_palette(sc);
+	if (IS_IN_EMUL_MODE(sc)) {
+		struct vcons_screen *ms = sc-vd.active;
+
+		cg6_ras_init(sc);
+		cg6_setup_palette(sc);
+
+		/* we don't know if the screen exists */
+		if (ms != NULL)
+			vcons_redraw_screen(ms);
+	}
 #else
 	/* (re-)initialize the default color map */
 	bt_initcmap(sc-sc_cmap, 256);
@@ -689,7 +703,7 @@ cgsixioctl(dev_t dev, u_long cmd, void *
 	int v, error;
 
 #ifdef CGSIX_DEBUG
-	printf(cgsixioctl(%ld)\n,cmd);
+	printf(cgsixioctl(%lx)\n,cmd);
 #endif
 
 	switch (cmd) {
@@ -1114,7 +1128,7 @@ cgsix_ioctl(void *v, void *vs, u_long cm
 	struct rasops_info *ri = sc-sc_fb.fb_rinfo;
 	struct vcons_screen *ms = sc-vd.active;
 #ifdef CGSIX_DEBUG
-	printf(cgsix_ioctl(%ld)\n,cmd);
+	printf(cgsix_ioctl(%lx)\n,cmd);
 #endif
 	switch (cmd) {
 		case WSDISPLAYIO_GTYPE:
@@ -1142,11 +1156,10 @@ cgsix_ioctl(void *v, void *vs, u_long cm
 		case WSDISPLAYIO_SMODE:
 			{
 int new_mode = *(int*)data;
-if (new_mode != sc-sc_mode)
-{
+
+if (new_mode != sc-sc_mode) {
 	sc-sc_mode = new_mode;
-	if(new_mode == WSDISPLAYIO_MODE_EMUL)
-	{
+	if (IS_IN_EMUL_MODE(sc)) {
 		cg6_reset(sc);
 		cg6_ras_init(sc);
 		cg6_setup_palette(sc);
@@ -1164,12 +1177,11 @@ cgsix_mmap(void *v, void *vs, off_t offs
 	struct vcons_data *vd = v;
 	struct cgsix_softc *sc = vd-cookie;
 
-	if(offsetsc-sc_ramsize) {
+	if (offset  sc-sc_ramsize) {
 		return bus_space_mmap(sc-sc_bustag, sc-sc_paddr,
-		CGSIX_RAM_OFFSET+offset, prot, BUS_SPACE_MAP_LINEAR);
+		CGSIX_RAM_OFFSET + offset, prot, BUS_SPACE_MAP_LINEAR);
 	}
-	/* I'm not at all sure this is the right thing to do */
-	return cgsixmmap(0, offset, prot); /* assume minor dev 0 for now */
+	return -1;
 }
 
 int
@@ -1385,7 +1397,7 @@ cgsix_putchar(void *cookie, int row, int
 /* put the chip back to normal */
 fbc-fbc_incy = 0;
 /* nosrc, color8 */
-fbc-fbc_mode = 0x0012;	
+fbc-fbc_mode = 0x0012; 
 /*fbc-fbc_mode = ~CG6_MODE_MASK;
 fbc-fbc_mode |= CG6_MODE;*/
 			}



CVS commit: src/sys/dev/sun

2012-07-10 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Jul 10 22:34:32 UTC 2012

Modified Files:
src/sys/dev/sun: cgsixreg.h

Log Message:
add some register definitions from xf86-video-suncg6


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/sun/cgsixreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsixreg.h
diff -u src/sys/dev/sun/cgsixreg.h:1.8 src/sys/dev/sun/cgsixreg.h:1.9
--- src/sys/dev/sun/cgsixreg.h:1.8	Mon Oct 16 22:27:16 2006
+++ src/sys/dev/sun/cgsixreg.h	Tue Jul 10 22:34:32 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsixreg.h,v 1.8 2006/10/16 22:27:16 macallan Exp $ */
+/*	$NetBSD: cgsixreg.h,v 1.9 2012/07/10 22:34:32 macallan Exp $ */
 
 /*
  * Copyright (c) 1993
@@ -252,6 +252,138 @@ struct cg6_fbc {
 #define CG6_FBC_INDEX_MOD		0x0040
 #define CG6_FBC_INDEX_MASK		0x0030
 
+/* rasterops */
+#define GX_ROP_CLEAR0x0
+#define GX_ROP_INVERT   0x1
+#define GX_ROP_NOOP 0x2
+#define GX_ROP_SET  0x3
+
+#define GX_ROP_00_0(rop)((rop)  0)
+#define GX_ROP_00_1(rop)((rop)  2)
+#define GX_ROP_01_0(rop)((rop)  4)
+#define GX_ROP_01_1(rop)((rop)  6)
+#define GX_ROP_10_0(rop)((rop)  8)
+#define GX_ROP_10_1(rop)((rop)  10)
+#define GX_ROP_11_0(rop)((rop)  12)
+#define GX_ROP_11_1(rop)((rop)  14)
+#define GX_PLOT_PLOT0x
+#define GX_PLOT_UNPLOT  0x0002
+#define GX_RAST_BOOL0x
+#define GX_RAST_LINEAR  0x0004
+#define GX_ATTR_UNSUPP  0x0040
+#define GX_ATTR_SUPP0x0080
+#define GX_POLYG_OVERLAP0x0100
+#define GX_POLYG_NONOVERLAP 0x0200
+#define GX_PATTERN_ZEROS0x0400
+#define GX_PATTERN_ONES 0x0800
+#define GX_PATTERN_MASK 0x0c00
+#define GX_PIXEL_ZEROS  0x1000
+#define GX_PIXEL_ONES   0x2000
+#define GX_PIXEL_MASK   0x3000
+#define GX_PLANE_ZEROS  0x4000
+#define GX_PLANE_ONES   0x8000
+#define GX_PLANE_MASK   0xc000
+/* rops for bit blit / copy area
+   with:
+   Plane Mask - use plane mask reg.
+   Pixel Mask - use all ones.
+   Patt  Mask - use all ones.
+*/
+
+#define POLY_O  GX_POLYG_OVERLAP
+#define POLY_N  GX_POLYG_NONOVERLAP
+
+#define ROP_STANDARD(GX_PLANE_MASK |\
+GX_PIXEL_ONES |\
+GX_ATTR_SUPP |\
+GX_RAST_BOOL |\
+GX_PLOT_PLOT)
+
+/* fg = don't care  bg = don't care */
+
+#define ROP_BLIT(O,I)   (ROP_STANDARD | \
+GX_PATTERN_ONES |\
+GX_ROP_11_1(I) |\
+GX_ROP_11_0(O) |\
+GX_ROP_10_1(I) |\
+GX_ROP_10_0(O) |\
+GX_ROP_01_1(I) |\
+GX_ROP_01_0(O) |\
+GX_ROP_00_1(I) |\
+GX_ROP_00_0(O))
+
+/* fg = fgPixel bg = don't care */
+
+#define ROP_FILL(O,I)   (ROP_STANDARD | \
+GX_PATTERN_ONES |\
+GX_ROP_11_1(I) |\
+GX_ROP_11_0(I) |\
+GX_ROP_10_1(I) |\
+GX_ROP_10_0(I) | \
+GX_ROP_01_1(O) |\
+GX_ROP_01_0(O) |\
+GX_ROP_00_1(O) |\
+GX_ROP_00_0(O))
+
+/* fg = fgPixel bg = don't care */
+ 
+#define ROP_STIP(O,I)   (ROP_STANDARD |\
+GX_ROP_11_1(I) |\
+GX_ROP_11_0(GX_ROP_NOOP) |\
+GX_ROP_10_1(I) |\
+GX_ROP_10_0(GX_ROP_NOOP) | \
+GX_ROP_01_1(O) |\
+GX_ROP_01_0(GX_ROP_NOOP) |\
+GX_ROP_00_1(O) |\
+GX_ROP_00_0(GX_ROP_NOOP))
+
+/* fg = fgPixel bg = bgPixel */
+
+#define ROP_OSTP(O,I)   (ROP_STANDARD |\
+GX_ROP_11_1(I) |\
+GX_ROP_11_0(I) |\
+GX_ROP_10_1(I) |\
+GX_ROP_10_0(O) |\
+GX_ROP_01_1(O) |\
+GX_ROP_01_0(I) |\
+GX_ROP_00_1(O) |\
+GX_ROP_00_0(O))
+
+#define GX_ROP_USE_PIXELMASK0x3000
+
+#define GX_BLT_INPROGRESS   0x2000
+
+#define GX_INPROGRESS   0x1000
+#define GX_FULL 0x2000
+
+/* modes */
+#define GX_INDEX(n) ((n)  4)
+#define GX_INDEX_ALL0x0030
+#define GX_INDEX_MOD0x0040
+#define GX_BDISP_0  0x0080
+#define GX_BDISP_1  0x0100
+#define GX_BDISP_ALL0x0180
+#define GX_BREAD_0  0x0200
+#define GX_BREAD_1  0x0400
+#define GX_BREAD_ALL0x0600
+#define 

CVS commit: src/sys/dev/sun

2012-07-10 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Jul 10 22:35:12 UTC 2012

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
magic number reduction, no functional change


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.52 src/sys/dev/sun/cgsix.c:1.53
--- src/sys/dev/sun/cgsix.c:1.52	Tue Jul 10 22:33:15 2012
+++ src/sys/dev/sun/cgsix.c	Tue Jul 10 22:35:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.52 2012/07/10 22:33:15 macallan Exp $ */
+/*	$NetBSD: cgsix.c,v 1.53 2012/07/10 22:35:11 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.52 2012/07/10 22:33:15 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.53 2012/07/10 22:35:11 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1314,8 +1314,8 @@ cgsix_setup_mono(struct cgsix_softc *sc,
 	fbc-fbc_incy = 1;
 	fbc-fbc_fg = fg;
 	fbc-fbc_bg = bg;
-	fbc-fbc_mode = 0x0014;	/* nosrc, color1 */
-	fbc-fbc_alu = 0x0800fc30;	/* colour expansion, solid bg */
+	fbc-fbc_mode = GX_BLIT_NOSRC | GX_MODE_COLOR1;
+	fbc-fbc_alu = GX_PATTERN_ONES | ROP_OSTP(GX_ROP_CLEAR, GX_ROP_SET);
 	sc-sc_mono_width = wi;
 	/* now feed the data into the chip */
 }
@@ -1396,10 +1396,7 @@ cgsix_putchar(void *cookie, int row, int
 }
 /* put the chip back to normal */
 fbc-fbc_incy = 0;
-/* nosrc, color8 */
-fbc-fbc_mode = 0x0012; 
-/*fbc-fbc_mode = ~CG6_MODE_MASK;
-fbc-fbc_mode |= CG6_MODE;*/
+fbc-fbc_mode = GX_BLIT_NOSRC | GX_MODE_COLOR8;	
 			}
 		}
 	}



CVS commit: src/sys/dev/sun

2012-07-10 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Jul 10 22:50:41 UTC 2012

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
perry some whitespace nits  remove some obsolete comments
no functional change


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.53 src/sys/dev/sun/cgsix.c:1.54
--- src/sys/dev/sun/cgsix.c:1.53	Tue Jul 10 22:35:11 2012
+++ src/sys/dev/sun/cgsix.c	Tue Jul 10 22:50:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.53 2012/07/10 22:35:11 macallan Exp $ */
+/*	$NetBSD: cgsix.c,v 1.54 2012/07/10 22:50:41 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.53 2012/07/10 22:35:11 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.54 2012/07/10 22:50:41 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -552,7 +552,7 @@ cg6attach(struct cgsix_softc *sc, const 
 
 	fb-fb_type.fb_cmsize = 256;
 	fb-fb_type.fb_size = sc-sc_ramsize;
-	/*fb-fb_type.fb_height * fb-fb_linebytes;*/
+
 	printf(: %s, %d x %d, name,
 	   fb-fb_type.fb_width, fb-fb_type.fb_height);
 	if(sc-sc_fhc) {
@@ -1080,7 +1080,7 @@ cgsixmmap(dev_t dev, off_t off, int prot
 			continue;
 		u = off - mo-mo_uaddr;
 		sz = mo-mo_size ? mo-mo_size : 
-		sc-sc_ramsize/*sc_fb.fb_type.fb_size*/;
+		sc-sc_ramsize;
 		if (u  sz) {
 			return (bus_space_mmap(sc-sc_bustag,
 sc-sc_paddr, u+mo-mo_physoff,
@@ -1127,6 +1127,7 @@ cgsix_ioctl(void *v, void *vs, u_long cm
 	struct wsdisplay_fbinfo *wdf;
 	struct rasops_info *ri = sc-sc_fb.fb_rinfo;
 	struct vcons_screen *ms = sc-vd.active;
+
 #ifdef CGSIX_DEBUG
 	printf(cgsix_ioctl(%lx)\n,cmd);
 #endif
@@ -1189,7 +1190,8 @@ cgsix_putcmap(struct cgsix_softc *sc, st
 {
 	u_int index = cm-index;
 	u_int count = cm-count;
-	int error,i;
+	int error, i;
+
 	if (index = 256 || count  256 || index + count  256)
 		return EINVAL;
 
@@ -1308,7 +1310,7 @@ cgsix_setup_mono(struct cgsix_softc *sc,
 	volatile struct cg6_fbc *fbc=sc-sc_fbc;
 	CG6_DRAIN(fbc);
 	fbc-fbc_x0 = x;
-	fbc-fbc_x1  =x + wi - 1;
+	fbc-fbc_x1 = x + wi - 1;
 	fbc-fbc_y0 = y;
 	fbc-fbc_incx = 0;
 	fbc-fbc_incy = 1;
@@ -1396,7 +1398,7 @@ cgsix_putchar(void *cookie, int row, int
 }
 /* put the chip back to normal */
 fbc-fbc_incy = 0;
-fbc-fbc_mode = GX_BLIT_NOSRC | GX_MODE_COLOR8;	
+fbc-fbc_mode = GX_BLIT_NOSRC | GX_MODE_COLOR8;
 			}
 		}
 	}



CVS commit: src/sys/dev/sun

2012-07-10 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Jul 10 22:33:16 UTC 2012

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
- re-initialize only when we're really going back to terminal emulation
- don't try to redraw a non-existing screen
- don't try to mmap sbus ranges through /dev/ttyE*


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2012-07-10 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Jul 10 22:34:32 UTC 2012

Modified Files:
src/sys/dev/sun: cgsixreg.h

Log Message:
add some register definitions from xf86-video-suncg6


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/sun/cgsixreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2012-07-10 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Jul 10 22:50:41 UTC 2012

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
perry some whitespace nits  remove some obsolete comments
no functional change


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2012-05-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  2 14:54:26 UTC 2012

Modified Files:
src/sys/dev/sun: kbd.c

Log Message:
make this compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/sun/kbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/kbd.c
diff -u src/sys/dev/sun/kbd.c:1.65 src/sys/dev/sun/kbd.c:1.66
--- src/sys/dev/sun/kbd.c:1.65	Fri Apr 27 05:30:13 2012
+++ src/sys/dev/sun/kbd.c	Wed May  2 10:54:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kbd.c,v 1.65 2012/04/27 09:30:13 martin Exp $	*/
+/*	$NetBSD: kbd.c,v 1.66 2012/05/02 14:54:26 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -47,7 +47,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kbd.c,v 1.65 2012/04/27 09:30:13 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: kbd.c,v 1.66 2012/05/02 14:54:26 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -154,10 +154,6 @@ static void	kbd_input_wskbd(struct kbd_s
 /* firm events input */
 static void	kbd_input_event(struct kbd_softc *, int);
 
-#if NSYSMON_ENVSYS
-static void	kbd_powerbutton(void *);
-#endif
-
 /
  *  Entry points for /dev/kbd
  *  (open,close,read,write,...)
@@ -901,6 +897,17 @@ kbd_bell(int on)
 }
 
 #if NWSKBD  0
+
+#if NSYSMON_ENVSYS
+static void
+kbd_powerbutton(void *cookie)
+{
+	struct kbd_softc *k = cookie;
+
+	sysmon_pswitch_event(k-k_sm_pbutton, k-k_ev);
+}
+#endif
+
 static void
 kbd_input_wskbd(struct kbd_softc *k, int code)
 {
@@ -935,7 +942,8 @@ kbd_input_wskbd(struct kbd_softc *k, int
 	k-k_ev = KEY_UP(code) ?
 	PSWITCH_EVENT_RELEASED :
 	PSWITCH_EVENT_PRESSED;
-	sysmon_task_queue_sched(0, kbd_powerbutton, k);
+	sysmon_task_queue_sched(0,
+	kbd_powerbutton, k);
 #endif
 return;
 		}
@@ -1091,15 +1099,4 @@ kbd_wskbd_attach(struct kbd_softc *k, in
 	}
 	config_interrupts(k-k_dev, kbd_enable);
 }
-
-#if NSYSMON_ENVSYS
-static void
-kbd_powerbutton(void *cookie)
-{
-	struct kbd_softc *k = cookie;
-
-	sysmon_pswitch_event(k-k_sm_pbutton, k-k_ev);
-}
-#endif
-
 #endif



CVS commit: src/sys/dev/sun

2012-05-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  2 14:54:26 UTC 2012

Modified Files:
src/sys/dev/sun: kbd.c

Log Message:
make this compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/sun/kbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2012-04-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Apr 27 09:30:13 UTC 2012

Modified Files:
src/sys/dev/sun: kbd.c

Log Message:
Make it compilable without envsys


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/sun/kbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/kbd.c
diff -u src/sys/dev/sun/kbd.c:1.64 src/sys/dev/sun/kbd.c:1.65
--- src/sys/dev/sun/kbd.c:1.64	Thu Apr 26 00:50:10 2012
+++ src/sys/dev/sun/kbd.c	Fri Apr 27 09:30:13 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kbd.c,v 1.64 2012/04/26 00:50:10 macallan Exp $	*/
+/*	$NetBSD: kbd.c,v 1.65 2012/04/27 09:30:13 martin Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -47,7 +47,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kbd.c,v 1.64 2012/04/26 00:50:10 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: kbd.c,v 1.65 2012/04/27 09:30:13 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -79,6 +79,7 @@ __KERNEL_RCSID(0, $NetBSD: kbd.c,v 1.64
 #include ioconf.h
 #include locators.h
 #include opt_sunkbd.h
+#include sysmon_envsys.h
 
 dev_type_open(kbdopen);
 dev_type_close(kbdclose);
@@ -153,7 +154,9 @@ static void	kbd_input_wskbd(struct kbd_s
 /* firm events input */
 static void	kbd_input_event(struct kbd_softc *, int);
 
+#if NSYSMON_ENVSYS
 static void	kbd_powerbutton(void *);
+#endif
 
 /
  *  Entry points for /dev/kbd
@@ -927,11 +930,13 @@ kbd_input_wskbd(struct kbd_softc *k, int
 return;
 #endif
 			case 0x30:
+#if NSYSMON_ENVSYS
 if (k-k_isconsole)
 	k-k_ev = KEY_UP(code) ?
 	PSWITCH_EVENT_RELEASED :
 	PSWITCH_EVENT_PRESSED;
 	sysmon_task_queue_sched(0, kbd_powerbutton, k);
+#endif
 return;
 		}
 	}
@@ -1074,6 +1079,7 @@ kbd_wskbd_attach(struct kbd_softc *k, in
 {
 	k-k_isconsole = isconsole;
 	if (isconsole) {
+#if NSYSMON_ENVSYS
 		sysmon_task_queue_init();
 		memset(k-k_sm_pbutton, 0, sizeof(struct sysmon_pswitch));
 		k-k_sm_pbutton.smpsw_name = device_xname(k-k_dev);
@@ -1081,10 +1087,12 @@ kbd_wskbd_attach(struct kbd_softc *k, in
 		if (sysmon_pswitch_register(k-k_sm_pbutton) != 0)
 			aprint_error_dev(k-k_dev,
 			unable to register power button with sysmon\n);
+#endif
 	}
 	config_interrupts(k-k_dev, kbd_enable);
 }
 
+#if NSYSMON_ENVSYS
 static void
 kbd_powerbutton(void *cookie)
 {
@@ -1092,5 +1100,6 @@ kbd_powerbutton(void *cookie)
 
 	sysmon_pswitch_event(k-k_sm_pbutton, k-k_ev);
 }
+#endif
 
 #endif



CVS commit: src/sys/dev/sun

2012-04-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Apr 27 09:30:13 UTC 2012

Modified Files:
src/sys/dev/sun: kbd.c

Log Message:
Make it compilable without envsys


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/sun/kbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2012-04-25 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr 26 00:50:11 UTC 2012

Modified Files:
src/sys/dev/sun: files.sun kbd.c kbdvar.h

Log Message:
report power button events to sysmon
also send pwm events for volume control keys directly with
options KBD_HIJACK_VOLUME_BUTTONS
so they work in X as well


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/sun/files.sun
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/sun/kbd.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/sun/kbdvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/files.sun
diff -u src/sys/dev/sun/files.sun:1.16 src/sys/dev/sun/files.sun:1.17
--- src/sys/dev/sun/files.sun:1.16	Fri Dec  5 11:52:42 2008
+++ src/sys/dev/sun/files.sun	Thu Apr 26 00:50:10 2012
@@ -1,4 +1,4 @@
-# $NetBSD: files.sun,v 1.16 2008/12/05 11:52:42 jdc Exp $
+# $NetBSD: files.sun,v 1.17 2012/04/26 00:50:10 macallan Exp $
 #
 # Configuration file for devices found on Sun machines.
 #
@@ -19,7 +19,7 @@ device kbd: firm_events, wskbddev
 file	dev/sun/kbd.c			kbd needs-flag
 file	dev/sun/kbd_tables.c 		kbd
 
-defflag	opt_sunkbd.h	SPARCBOOK_CMD
+defflag	opt_sunkbd.h	SPARCBOOK_CMD KBD_HIJACK_VOLUME_BUTTONS
 file	dev/sun/wskbdmap_sun.c		kbd  wskbd
 
 # e.g. - lower layer: sun keyboard at zs

Index: src/sys/dev/sun/kbd.c
diff -u src/sys/dev/sun/kbd.c:1.63 src/sys/dev/sun/kbd.c:1.64
--- src/sys/dev/sun/kbd.c:1.63	Tue May 12 14:46:39 2009
+++ src/sys/dev/sun/kbd.c	Thu Apr 26 00:50:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kbd.c,v 1.63 2009/05/12 14:46:39 cegger Exp $	*/
+/*	$NetBSD: kbd.c,v 1.64 2012/04/26 00:50:10 macallan Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -47,7 +47,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kbd.c,v 1.63 2009/05/12 14:46:39 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: kbd.c,v 1.64 2012/04/26 00:50:10 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -65,6 +65,8 @@ __KERNEL_RCSID(0, $NetBSD: kbd.c,v 1.63
 #include sys/poll.h
 #include sys/file.h
 
+#include dev/sysmon/sysmon_taskq.h
+
 #include dev/wscons/wsksymdef.h
 
 #include dev/sun/kbd_reg.h
@@ -76,6 +78,7 @@ __KERNEL_RCSID(0, $NetBSD: kbd.c,v 1.63
 
 #include ioconf.h
 #include locators.h
+#include opt_sunkbd.h
 
 dev_type_open(kbdopen);
 dev_type_close(kbdclose);
@@ -150,7 +153,7 @@ static void	kbd_input_wskbd(struct kbd_s
 /* firm events input */
 static void	kbd_input_event(struct kbd_softc *, int);
 
-
+static void	kbd_powerbutton(void *);
 
 /
  *  Entry points for /dev/kbd
@@ -899,7 +902,7 @@ static void
 kbd_input_wskbd(struct kbd_softc *k, int code)
 {
 	int type, key;
-
+	
 #ifdef WSDISPLAY_COMPAT_RAWKBD
 	if (k-k_wsraw) {
 		u_char buf;
@@ -912,6 +915,27 @@ kbd_input_wskbd(struct kbd_softc *k, int
 
 	type = KEY_UP(code) ? WSCONS_EVENT_KEY_UP : WSCONS_EVENT_KEY_DOWN;
 	key = KEY_CODE(code);
+
+	if (type == WSCONS_EVENT_KEY_DOWN) {
+		switch (key) {
+#ifdef KBD_HIJACK_VOLUME_BUTTONS
+			case 0x02:
+pmf_event_inject(NULL, PMFE_AUDIO_VOLUME_DOWN);
+return;
+			case 0x04:
+pmf_event_inject(NULL, PMFE_AUDIO_VOLUME_UP);
+return;
+#endif
+			case 0x30:
+if (k-k_isconsole)
+	k-k_ev = KEY_UP(code) ?
+	PSWITCH_EVENT_RELEASED :
+	PSWITCH_EVENT_PRESSED;
+	sysmon_task_queue_sched(0, kbd_powerbutton, k);
+return;
+		}
+	}
+
 	wskbd_input(k-k_wskbd, type, key);
 }
 
@@ -919,6 +943,7 @@ int
 wssunkbd_enable(void *v, int on)
 {
 	struct kbd_softc *k = v;
+
 	if (k-k_wsenabled != on) {
 		k-k_wsenabled = on;
 		if (on) {
@@ -1048,7 +1073,24 @@ void
 kbd_wskbd_attach(struct kbd_softc *k, int isconsole)
 {
 	k-k_isconsole = isconsole;
-	
+	if (isconsole) {
+		sysmon_task_queue_init();
+		memset(k-k_sm_pbutton, 0, sizeof(struct sysmon_pswitch));
+		k-k_sm_pbutton.smpsw_name = device_xname(k-k_dev);
+		k-k_sm_pbutton.smpsw_type = PSWITCH_TYPE_POWER;
+		if (sysmon_pswitch_register(k-k_sm_pbutton) != 0)
+			aprint_error_dev(k-k_dev,
+			unable to register power button with sysmon\n);
+	}
 	config_interrupts(k-k_dev, kbd_enable);
 }
+
+static void
+kbd_powerbutton(void *cookie)
+{
+	struct kbd_softc *k = cookie;
+
+	sysmon_pswitch_event(k-k_sm_pbutton, k-k_ev);
+}
+
 #endif

Index: src/sys/dev/sun/kbdvar.h
diff -u src/sys/dev/sun/kbdvar.h:1.20 src/sys/dev/sun/kbdvar.h:1.21
--- src/sys/dev/sun/kbdvar.h:1.20	Tue May 12 14:46:39 2009
+++ src/sys/dev/sun/kbdvar.h	Thu Apr 26 00:50:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kbdvar.h,v 1.20 2009/05/12 14:46:39 cegger Exp $	*/
+/*	$NetBSD: kbdvar.h,v 1.21 2012/04/26 00:50:10 macallan Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -43,6 +43,7 @@
 #include wskbd.h	/* for NWSKBD */
 #include dev/wscons/wsconsio.h
 #include dev/wscons/wskbdvar.h
+#include dev/sysmon/sysmonvar.h
 
 #if NWSKBD  0
 #include opt_wsdisplay_compat.h
@@ -51,6 +52,9 @@
 struct kbd_softc {
 	device_t k_dev;		/* required first: 

CVS commit: src/sys/dev/sun

2012-04-25 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr 26 00:50:11 UTC 2012

Modified Files:
src/sys/dev/sun: files.sun kbd.c kbdvar.h

Log Message:
report power button events to sysmon
also send pwm events for volume control keys directly with
options KBD_HIJACK_VOLUME_BUTTONS
so they work in X as well


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/sun/files.sun
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/sun/kbd.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/sun/kbdvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2012-01-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jan 11 16:10:14 UTC 2012

Modified Files:
src/sys/dev/sun: bwtwo.c cgsix.c cgthree.c

Log Message:
use rasops_init(0,0)


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/sun/bwtwo.c
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/sun/cgsix.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/sun/cgthree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/bwtwo.c
diff -u src/sys/dev/sun/bwtwo.c:1.29 src/sys/dev/sun/bwtwo.c:1.30
--- src/sys/dev/sun/bwtwo.c:1.29	Mon May 10 14:33:21 2010
+++ src/sys/dev/sun/bwtwo.c	Wed Jan 11 16:10:13 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: bwtwo.c,v 1.29 2010/05/10 14:33:21 tsutsui Exp $ */
+/*	$NetBSD: bwtwo.c,v 1.30 2012/01/11 16:10:13 macallan Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bwtwo.c,v 1.29 2010/05/10 14:33:21 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: bwtwo.c,v 1.30 2012/01/11 16:10:13 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -453,7 +453,7 @@ bwtwo_init_screen(void *cookie, struct v
 
 	memset(sc-sc_fb.fb_pixels, (*defattr  16)  0xff,
 	sc-sc_stride * sc-sc_height);
-	rasops_init(ri, sc-sc_height/8, sc-sc_width/8);
+	rasops_init(ri, 0, 0);
 	ri-ri_caps = 0;
 	rasops_reconfig(ri, sc-sc_height / ri-ri_font-fontheight,
 		sc-sc_width / ri-ri_font-fontwidth);

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.50 src/sys/dev/sun/cgsix.c:1.51
--- src/sys/dev/sun/cgsix.c:1.50	Tue Nov 23 22:14:27 2010
+++ src/sys/dev/sun/cgsix.c	Wed Jan 11 16:10:13 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.50 2010/11/23 22:14:27 mrg Exp $ */
+/*	$NetBSD: cgsix.c,v 1.51 2012/01/11 16:10:13 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.50 2010/11/23 22:14:27 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.51 2012/01/11 16:10:13 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1250,7 +1250,7 @@ cgsix_init_screen(void *cookie, struct v
 	if (sc-sc_fhcrev  2)
 		memset(sc-sc_fb.fb_pixels, (*defattr  16)  0xff,
 		sc-sc_stride * sc-sc_height);
-	rasops_init(ri, sc-sc_height/8, sc-sc_width/8);
+	rasops_init(ri, 0, 0);
 	ri-ri_caps = WSSCREEN_WSCOLORS | WSSCREEN_REVERSE;
 	rasops_reconfig(ri, sc-sc_height / ri-ri_font-fontheight,
 		sc-sc_width / ri-ri_font-fontwidth);

Index: src/sys/dev/sun/cgthree.c
diff -u src/sys/dev/sun/cgthree.c:1.28 src/sys/dev/sun/cgthree.c:1.29
--- src/sys/dev/sun/cgthree.c:1.28	Tue Sep 14 19:36:13 2010
+++ src/sys/dev/sun/cgthree.c	Wed Jan 11 16:10:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgthree.c,v 1.28 2010/09/14 19:36:13 macallan Exp $ */
+/*	$NetBSD: cgthree.c,v 1.29 2012/01/11 16:10:14 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgthree.c,v 1.28 2010/09/14 19:36:13 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgthree.c,v 1.29 2012/01/11 16:10:14 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -557,7 +557,7 @@ cgthree_init_screen(void *cookie, struct
 
 	ri-ri_bits = sc-sc_fb.fb_pixels;
 
-	rasops_init(ri, sc-sc_height/8, sc-sc_width/8);
+	rasops_init(ri, 0, 0);
 	ri-ri_caps = WSSCREEN_WSCOLORS | WSSCREEN_REVERSE;
 	rasops_reconfig(ri, sc-sc_height / ri-ri_font-fontheight,
 		sc-sc_width / ri-ri_font-fontwidth);



CVS commit: src/sys/dev/sun

2012-01-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jan 11 16:10:14 UTC 2012

Modified Files:
src/sys/dev/sun: bwtwo.c cgsix.c cgthree.c

Log Message:
use rasops_init(0,0)


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/sun/bwtwo.c
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/sun/cgsix.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/sun/cgthree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2010-11-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Nov 23 22:14:27 UTC 2010

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
add support for WSDISPLAYIO_LINEBYTES.  mostly from macallan.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.49 src/sys/dev/sun/cgsix.c:1.50
--- src/sys/dev/sun/cgsix.c:1.49	Sat Nov 13 13:52:11 2010
+++ src/sys/dev/sun/cgsix.c	Tue Nov 23 22:14:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.49 2010/11/13 13:52:11 uebayasi Exp $ */
+/*	$NetBSD: cgsix.c,v 1.50 2010/11/23 22:14:27 mrg Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.49 2010/11/13 13:52:11 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.50 2010/11/23 22:14:27 mrg Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1135,6 +1135,10 @@
 			return cgsix_putcmap(sc, 
 			(struct wsdisplay_cmap *)data);
 
+		case WSDISPLAYIO_LINEBYTES:
+			*(u_int *)data = sc-sc_stride;
+			return 0;
+
 		case WSDISPLAYIO_SMODE:
 			{
 int new_mode = *(int*)data;



CVS commit: src/sys/dev/sun

2010-11-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Nov 23 22:14:27 UTC 2010

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
add support for WSDISPLAYIO_LINEBYTES.  mostly from macallan.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2010-09-14 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Sep 14 18:42:12 UTC 2010

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
don't muck with the screen description if we're not the console, for some
reason this leads to a NULL jump later on, at least on sparc64
should fix PR43873


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.47 src/sys/dev/sun/cgsix.c:1.48
--- src/sys/dev/sun/cgsix.c:1.47	Tue May  4 05:11:06 2010
+++ src/sys/dev/sun/cgsix.c	Tue Sep 14 18:42:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.47 2010/05/04 05:11:06 macallan Exp $ */
+/*	$NetBSD: cgsix.c,v 1.48 2010/09/14 18:42:12 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.47 2010/05/04 05:11:06 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.48 2010/09/14 18:42:12 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -637,20 +637,6 @@
 		 * we're not the console so we just clear the screen and don't 
 		 * set up any sort of text display
 		 */
-		if (cgsix_defaultscreen.textops == NULL) {
-			/* 
-			 * ugly, but...
-			 * we want the console settings to win, so we only
-			 * touch anything when we find an untouched screen
-			 * definition. In this case we fill it from fb to
-			 * avoid problems in case no cgsix is the console
-			 */
-			ri = sc-sc_fb.fb_rinfo;
-			cgsix_defaultscreen.textops = ri-ri_ops;
-			cgsix_defaultscreen.capabilities = ri-ri_caps;
-			cgsix_defaultscreen.nrows = ri-ri_rows;
-			cgsix_defaultscreen.ncols = ri-ri_cols;
-		}
 	}
 	
 	aa.scrdata = cgsix_screenlist;



CVS commit: src/sys/dev/sun

2010-09-14 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Sep 14 18:43:41 UTC 2010

Modified Files:
src/sys/dev/sun: cgthree.c

Log Message:
leave the screen description alone when we're not the console in order to
avoid a NULL deref later on ( which only happens on sparc64 for some reason )
While there, use VCONS_DONT_READ


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/sun/cgthree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgthree.c
diff -u src/sys/dev/sun/cgthree.c:1.26 src/sys/dev/sun/cgthree.c:1.27
--- src/sys/dev/sun/cgthree.c:1.26	Wed Nov 25 21:10:56 2009
+++ src/sys/dev/sun/cgthree.c	Tue Sep 14 18:43:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgthree.c,v 1.26 2009/11/25 21:10:56 macallan Exp $ */
+/*	$NetBSD: cgthree.c,v 1.27 2010/09/14 18:43:41 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgthree.c,v 1.26 2009/11/25 21:10:56 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgthree.c,v 1.27 2010/09/14 18:43:41 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -234,20 +234,6 @@
 		 * we're not the console so we just clear the screen and don't 
 		 * set up any sort of text display
 		 */
-		if (cgthree_defaultscreen.textops == NULL) {
-			/* 
-			 * ugly, but...
-			 * we want the console settings to win, so we only
-			 * touch anything when we find an untouched screen
-			 * definition. In this case we fill it from fb to
-			 * avoid problems in case no cgthree is the console
-			 */
-			ri = sc-sc_fb.fb_rinfo;
-			cgthree_defaultscreen.textops = ri-ri_ops;
-			cgthree_defaultscreen.capabilities = ri-ri_caps;
-			cgthree_defaultscreen.nrows = ri-ri_rows;
-			cgthree_defaultscreen.ncols = ri-ri_cols;
-		}
 	}
 
 	/* Initialize the default color map. */
@@ -558,6 +544,8 @@
 	struct cgthree_softc *sc = cookie;
 	struct rasops_info *ri = scr-scr_ri;
 
+	scr-scr_flags |= VCONS_DONT_READ;
+
 	ri-ri_depth = 8;
 	ri-ri_width = sc-sc_width;
 	ri-ri_height = sc-sc_height;



CVS commit: src/sys/dev/sun

2010-09-14 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Sep 14 19:36:14 UTC 2010

Modified Files:
src/sys/dev/sun: cgthree.c

Log Message:
clear the screen when attaching, not when adding screens since that may
happen much later
while there, call vcons_replay_msgbuf()


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/sun/cgthree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgthree.c
diff -u src/sys/dev/sun/cgthree.c:1.27 src/sys/dev/sun/cgthree.c:1.28
--- src/sys/dev/sun/cgthree.c:1.27	Tue Sep 14 18:43:41 2010
+++ src/sys/dev/sun/cgthree.c	Tue Sep 14 19:36:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgthree.c,v 1.27 2010/09/14 18:43:41 macallan Exp $ */
+/*	$NetBSD: cgthree.c,v 1.28 2010/09/14 19:36:13 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgthree.c,v 1.27 2010/09/14 18:43:41 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgthree.c,v 1.28 2010/09/14 19:36:13 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -221,6 +221,8 @@
 		/* we mess with cg3_console_screen only once */
 		vcons_init_screen(sc-vd, cg3_console_screen, 1,
 		defattr);
+		memset(sc-sc_fb.fb_pixels, (defattr  16)  0xff,
+		sc-sc_stride * sc-sc_height);
 		cg3_console_screen.scr_flags |= VCONS_SCREEN_IS_STATIC;
 
 		cgthree_defaultscreen.textops = ri-ri_ops;
@@ -229,6 +231,7 @@
 		cgthree_defaultscreen.ncols = ri-ri_cols;
 		sc-vd.active = cg3_console_screen;
 		wsdisplay_cnattach(cgthree_defaultscreen, ri, 0, 0, defattr);
+		vcons_replay_msgbuf(cg3_console_screen);
 	} else {
 		/* 
 		 * we're not the console so we just clear the screen and don't 
@@ -554,8 +557,6 @@
 
 	ri-ri_bits = sc-sc_fb.fb_pixels;
 
-	memset(sc-sc_fb.fb_pixels, (*defattr  16)  0xff,
-	sc-sc_stride * sc-sc_height);
 	rasops_init(ri, sc-sc_height/8, sc-sc_width/8);
 	ri-ri_caps = WSSCREEN_WSCOLORS | WSSCREEN_REVERSE;
 	rasops_reconfig(ri, sc-sc_height / ri-ri_font-fontheight,



CVS commit: src/sys/dev/sun

2010-09-14 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Sep 14 19:36:14 UTC 2010

Modified Files:
src/sys/dev/sun: cgthree.c

Log Message:
clear the screen when attaching, not when adding screens since that may
happen much later
while there, call vcons_replay_msgbuf()


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/sun/cgthree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2010-08-14 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Sat Aug 14 20:52:05 UTC 2010

Modified Files:
src/sys/dev/sun: sunkbd.c

Log Message:
Flush tty only when K_TXBUSY is not set.

'!' takes precedence over bitwise operation '', so use parenthesis.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/sun/sunkbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/sunkbd.c
diff -u src/sys/dev/sun/sunkbd.c:1.27 src/sys/dev/sun/sunkbd.c:1.28
--- src/sys/dev/sun/sunkbd.c:1.27	Sat Mar 29 19:15:36 2008
+++ src/sys/dev/sun/sunkbd.c	Sat Aug 14 20:52:05 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunkbd.c,v 1.27 2008/03/29 19:15:36 tsutsui Exp $	*/
+/*	$NetBSD: sunkbd.c,v 1.28 2010/08/14 20:52:05 jym Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -51,7 +51,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sunkbd.c,v 1.27 2008/03/29 19:15:36 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: sunkbd.c,v 1.28 2010/08/14 20:52:05 jym Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -255,7 +255,7 @@
 		log(LOG_ERR, %s: input error (0x%x)\n,
 		device_xname(k-k_kbd.k_dev), c);
 		c = TTY_CHARMASK;
-		if (!k-k_txflags  K_TXBUSY) {
+		if (!(k-k_txflags  K_TXBUSY)) {
 			ttyflush(tp, FREAD | FWRITE);
 			goto send_reset;
 		}



CVS commit: src/sys/dev/sun

2010-08-14 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Sat Aug 14 20:52:05 UTC 2010

Modified Files:
src/sys/dev/sun: sunkbd.c

Log Message:
Flush tty only when K_TXBUSY is not set.

'!' takes precedence over bitwise operation '', so use parenthesis.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/sun/sunkbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2010-05-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon May 10 14:33:22 UTC 2010

Modified Files:
src/sys/dev/sun: bwtwo.c

Log Message:
Make this compile on sparc64.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/sun/bwtwo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/bwtwo.c
diff -u src/sys/dev/sun/bwtwo.c:1.28 src/sys/dev/sun/bwtwo.c:1.29
--- src/sys/dev/sun/bwtwo.c:1.28	Sat Sep 19 07:07:42 2009
+++ src/sys/dev/sun/bwtwo.c	Mon May 10 14:33:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bwtwo.c,v 1.28 2009/09/19 07:07:42 tsutsui Exp $ */
+/*	$NetBSD: bwtwo.c,v 1.29 2010/05/10 14:33:21 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bwtwo.c,v 1.28 2009/09/19 07:07:42 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: bwtwo.c,v 1.29 2010/05/10 14:33:21 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -117,7 +117,7 @@
 
 const struct cdevsw bwtwo_cdevsw = {
 	bwtwoopen, nullclose, noread, nowrite, bwtwoioctl,
-	nostop, notty, nopoll, bwtwommap, nokqfilter,
+	nostop, notty, nopoll, bwtwommap, nokqfilter, D_OTHER
 };
 
 /* XXX we do not handle frame buffer interrupts (do not know how) */



CVS commit: src/sys/dev/sun

2010-05-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon May 10 14:33:22 UTC 2010

Modified Files:
src/sys/dev/sun: bwtwo.c

Log Message:
Make this compile on sparc64.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/sun/bwtwo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2010-05-03 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue May  4 05:11:06 UTC 2010

Modified Files:
src/sys/dev/sun: cgsix.c

Log Message:
use box drawing font if needed


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/sun/cgsix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.46 src/sys/dev/sun/cgsix.c:1.47
--- src/sys/dev/sun/cgsix.c:1.46	Sat Sep 19 07:07:43 2009
+++ src/sys/dev/sun/cgsix.c	Tue May  4 05:11:06 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.46 2009/09/19 07:07:43 tsutsui Exp $ */
+/*	$NetBSD: cgsix.c,v 1.47 2010/05/04 05:11:06 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.46 2009/09/19 07:07:43 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.47 2010/05/04 05:11:06 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1345,6 +1345,7 @@
 cgsix_putchar(void *cookie, int row, int col, u_int c, long attr)
 {
 	struct rasops_info *ri = cookie;
+	struct wsdisplay_font *font = PICK_FONT(ri, c);
 	struct vcons_screen *scr = ri-ri_hw;
 	struct cgsix_softc *sc = scr-scr_cookie;
 	int inv;
@@ -1359,10 +1360,10 @@
 			int x, y, wi, he;
 			volatile struct cg6_fbc *fbc = sc-sc_fbc;
 
-			wi = ri-ri_font-fontwidth;
-			he = ri-ri_font-fontheight;
+			wi = font-fontwidth;
+			he = font-fontheight;
 			
-			if (!CHAR_IN_FONT(c, ri-ri_font))
+			if (!CHAR_IN_FONT(c, font))
 return;
 			inv = ((attr  8)  WSATTR_REVERSE);
 			if (inv) {
@@ -1383,15 +1384,15 @@
 			if (c == 0x20) {
 cgsix_rectfill(sc, x, y, wi, he, bg);
 			} else {
-uc = c-ri-ri_font-firstchar;
-data = (uint8_t *)ri-ri_font-data + uc * 
+uc = c - font-firstchar;
+data = (uint8_t *)font-data + uc * 
 ri-ri_fontscale;
 
 cgsix_setup_mono(sc, x, y, wi, 1, fg, bg);		
 for (i = 0; i  he; i++) {
-	cgsix_feed_line(sc, ri-ri_font-stride,
+	cgsix_feed_line(sc, font-stride,
 	data);
-	data += ri-ri_font-stride;
+	data += font-stride;
 }
 /* put the chip back to normal */
 fbc-fbc_incy = 0;



CVS commit: src/sys/dev/sun

2010-03-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 23 20:01:09 UTC 2010

Modified Files:
src/sys/dev/sun: disksubr.c

Log Message:
Properly convert values according to block size differences between the
underlying device (might be a CD drive) and the sun label when carrying
over defaults from a ISO9660 partition.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/sun/disksubr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/disksubr.c
diff -u src/sys/dev/sun/disksubr.c:1.13 src/sys/dev/sun/disksubr.c:1.14
--- src/sys/dev/sun/disksubr.c:1.13	Tue Mar 16 14:53:08 2010
+++ src/sys/dev/sun/disksubr.c	Tue Mar 23 20:01:09 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: disksubr.c,v 1.13 2010/03/16 14:53:08 martin Exp $ */
+/*	$NetBSD: disksubr.c,v 1.14 2010/03/23 20:01:09 martin Exp $ */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -55,7 +55,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: disksubr.c,v 1.13 2010/03/16 14:53:08 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: disksubr.c,v 1.14 2010/03/23 20:01:09 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -281,6 +281,7 @@
 	struct partition *npp;
 	struct sun_dkpart *spp;
 	int i, secpercyl;
+	unsigned int secpblck;
 	u_short cksum, *sp1, *sp2;
 
 	sl = (struct sun_disklabel *)cp;
@@ -299,6 +300,8 @@
 	lp-d_magic2 = DISKMAGIC;
 	memcpy(lp-d_packname, sl-sl_text, sizeof(lp-d_packname));
 
+	secpblck = lp-d_secsize / 512;
+	if (secpblck == 0) secpblck = 1; /* can't happen */
 	lp-d_secsize = 512;
 	lp-d_nsectors   = sl-sl_nsectors;
 	lp-d_ntracks= sl-sl_ntracks;
@@ -321,9 +324,10 @@
 	for (i = 0; i  8; i++) {
 		spp = sl-sl_part[i];
 		npp = lp-d_partitions[i];
+
 		if (npp-p_fstype == FS_ISO9660
-		 spp-sdkp_cyloffset * secpercyl == npp-p_offset
-		 spp-sdkp_nsectors = npp-p_size
+		 spp-sdkp_cyloffset * secpercyl == npp-p_offset*secpblck
+		 spp-sdkp_nsectors = npp-p_size*secpblck
 		 npp-p_size  0  spp-sdkp_nsectors  0) {
 			/*
 			 * This happens for example on sunlabel'd hybrid
@@ -332,6 +336,9 @@
 			 * partition (including session parameters), so
 			 * we better not overwrite it.
 			 */
+			npp-p_offset *= secpblck;
+			npp-p_size = spp-sdkp_nsectors;
+			npp-p_cdsession *= secpblck;
 			continue;
 		}
 		npp-p_offset = spp-sdkp_cyloffset * secpercyl;



CVS commit: src/sys/dev/sun

2010-03-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 23 20:01:09 UTC 2010

Modified Files:
src/sys/dev/sun: disksubr.c

Log Message:
Properly convert values according to block size differences between the
underlying device (might be a CD drive) and the sun label when carrying
over defaults from a ISO9660 partition.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/sun/disksubr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2010-03-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 16 14:53:08 UTC 2010

Modified Files:
src/sys/dev/sun: disksubr.c

Log Message:
Do not overwrite a ISO9660 partition (which the sunlabel can not properly
represent, but the cd driver carefully crafted including session data).
This makes it possible to just mount cd0a as cd9660fs on a sparc* install
CD. Solution suggested by mlelstv.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/sun/disksubr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/disksubr.c
diff -u src/sys/dev/sun/disksubr.c:1.12 src/sys/dev/sun/disksubr.c:1.13
--- src/sys/dev/sun/disksubr.c:1.12	Mon Mar 16 23:11:16 2009
+++ src/sys/dev/sun/disksubr.c	Tue Mar 16 14:53:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: disksubr.c,v 1.12 2009/03/16 23:11:16 dsl Exp $ */
+/*	$NetBSD: disksubr.c,v 1.13 2010/03/16 14:53:08 martin Exp $ */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -55,7 +55,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: disksubr.c,v 1.12 2009/03/16 23:11:16 dsl Exp $);
+__KERNEL_RCSID(0, $NetBSD: disksubr.c,v 1.13 2010/03/16 14:53:08 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -321,6 +321,19 @@
 	for (i = 0; i  8; i++) {
 		spp = sl-sl_part[i];
 		npp = lp-d_partitions[i];
+		if (npp-p_fstype == FS_ISO9660
+		 spp-sdkp_cyloffset * secpercyl == npp-p_offset
+		 spp-sdkp_nsectors = npp-p_size
+		 npp-p_size  0  spp-sdkp_nsectors  0) {
+			/*
+			 * This happens for example on sunlabel'd hybrid
+			 * (ffs + ISO9660) CDs, like our install CDs.
+			 * The cd driver has initialized a valid ISO9660
+			 * partition (including session parameters), so
+			 * we better not overwrite it.
+			 */
+			continue;
+		}
 		npp-p_offset = spp-sdkp_cyloffset * secpercyl;
 		npp-p_size = spp-sdkp_nsectors;
 		if (npp-p_size == 0) {



CVS commit: src/sys/dev/sun

2010-01-13 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Jan 14 02:18:59 UTC 2010

Modified Files:
src/sys/dev/sun: wskbdmap_sun.c

Log Message:
actually assign audio control command codes to the audio control keys


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/sun/wskbdmap_sun.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/sun

2010-01-13 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Jan 14 02:18:59 UTC 2010

Modified Files:
src/sys/dev/sun: wskbdmap_sun.c

Log Message:
actually assign audio control command codes to the audio control keys


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/sun/wskbdmap_sun.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/wskbdmap_sun.c
diff -u src/sys/dev/sun/wskbdmap_sun.c:1.16 src/sys/dev/sun/wskbdmap_sun.c:1.17
--- src/sys/dev/sun/wskbdmap_sun.c:1.16	Fri Jan  2 13:09:36 2009
+++ src/sys/dev/sun/wskbdmap_sun.c	Thu Jan 14 02:18:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: wskbdmap_sun.c,v 1.16 2009/01/02 13:09:36 jdc Exp $	*/
+/*	$NetBSD: wskbdmap_sun.c,v 1.17 2010/01/14 02:18:59 macallan Exp $	*/
 /*	$OpenBSD: sunkbd.c,v 1.9 2002/09/08 23:22:00 miod Exp $	*/
 
 /*
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wskbdmap_sun.c,v 1.16 2009/01/02 13:09:36 jdc Exp $);
+__KERNEL_RCSID(0, $NetBSD: wskbdmap_sun.c,v 1.17 2010/01/14 02:18:59 macallan Exp $);
 
 #include sys/types.h
 #include dev/wscons/wsksymdef.h
@@ -51,9 +51,9 @@
 static const keysym_t wssun_keydesctab_us [] = {
 /*  pos  command			normal		shifted */
 KC(0x01), KS_Cmd,
-KC(0x02), KS_Cmd_BrightnessDown,
+KC(0x02), KS_Cmd_VolumeDown,
 KC(0x03),KS_Again,
-KC(0x04), KS_Cmd_BrightnessUp,
+KC(0x04), KS_Cmd_VolumeUp,
 KC(0x05), KS_Cmd_Screen0,KS_f1,
 KC(0x06), KS_Cmd_Screen1,KS_f2,
 KC(0x07), KS_Cmd_Screen9,KS_f10,



CVS commit: src/sys/dev/sun

2009-11-25 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Nov 25 21:10:56 UTC 2009

Modified Files:
src/sys/dev/sun: cgthree.c

Log Message:
make this compile on sparc64


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/sun/cgthree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/cgthree.c
diff -u src/sys/dev/sun/cgthree.c:1.25 src/sys/dev/sun/cgthree.c:1.26
--- src/sys/dev/sun/cgthree.c:1.25	Sat Sep 19 07:07:43 2009
+++ src/sys/dev/sun/cgthree.c	Wed Nov 25 21:10:56 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgthree.c,v 1.25 2009/09/19 07:07:43 tsutsui Exp $ */
+/*	$NetBSD: cgthree.c,v 1.26 2009/11/25 21:10:56 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgthree.c,v 1.25 2009/09/19 07:07:43 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgthree.c,v 1.26 2009/11/25 21:10:56 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -82,7 +82,7 @@
 
 const struct cdevsw cgthree_cdevsw = {
 	cgthreeopen, nullclose, noread, nowrite, cgthreeioctl,
-	nostop, notty, nopoll, cgthreemmap, nokqfilter
+	nostop, notty, nopoll, cgthreemmap, nokqfilter, D_OTHER
 };
 
 /* frame buffer generic driver */



CVS commit: src/sys/dev/sun

2009-09-19 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep 19 07:07:43 UTC 2009

Modified Files:
src/sys/dev/sun: bwtwo.c cgsix.c cgthree.c

Log Message:
Include ioconf.h instead of extern struct cfdriver foo_cd decls.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/sun/bwtwo.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/sun/cgsix.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/sun/cgthree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/bwtwo.c
diff -u src/sys/dev/sun/bwtwo.c:1.27 src/sys/dev/sun/bwtwo.c:1.28
--- src/sys/dev/sun/bwtwo.c:1.27	Sat Sep 19 04:52:44 2009
+++ src/sys/dev/sun/bwtwo.c	Sat Sep 19 07:07:42 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bwtwo.c,v 1.27 2009/09/19 04:52:44 tsutsui Exp $ */
+/*	$NetBSD: bwtwo.c,v 1.28 2009/09/19 07:07:42 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bwtwo.c,v 1.27 2009/09/19 04:52:44 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: bwtwo.c,v 1.28 2009/09/19 07:07:42 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -109,7 +109,7 @@
 #include opt_wsemul.h
 #endif
 
-extern struct cfdriver bwtwo_cd;
+#include ioconf.h
 
 dev_type_open(bwtwoopen);
 dev_type_ioctl(bwtwoioctl);

Index: src/sys/dev/sun/cgsix.c
diff -u src/sys/dev/sun/cgsix.c:1.45 src/sys/dev/sun/cgsix.c:1.46
--- src/sys/dev/sun/cgsix.c:1.45	Thu Aug 20 02:49:30 2009
+++ src/sys/dev/sun/cgsix.c	Sat Sep 19 07:07:43 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix.c,v 1.45 2009/08/20 02:49:30 macallan Exp $ */
+/*	$NetBSD: cgsix.c,v 1.46 2009/09/19 07:07:43 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.45 2009/08/20 02:49:30 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgsix.c,v 1.46 2009/09/19 07:07:43 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -116,11 +116,11 @@
 #include dev/sun/cgsixreg.h
 #include dev/sun/cgsixvar.h
 
+#include ioconf.h
+
 static void	cg6_unblank(device_t);
 static void	cg6_blank(struct cgsix_softc *, int);
 
-extern struct cfdriver cgsix_cd;
-
 dev_type_open(cgsixopen);
 dev_type_close(cgsixclose);
 dev_type_ioctl(cgsixioctl);

Index: src/sys/dev/sun/cgthree.c
diff -u src/sys/dev/sun/cgthree.c:1.24 src/sys/dev/sun/cgthree.c:1.25
--- src/sys/dev/sun/cgthree.c:1.24	Fri Sep 18 16:43:19 2009
+++ src/sys/dev/sun/cgthree.c	Sat Sep 19 07:07:43 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgthree.c,v 1.24 2009/09/18 16:43:19 tsutsui Exp $ */
+/*	$NetBSD: cgthree.c,v 1.25 2009/09/19 07:07:43 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgthree.c,v 1.24 2009/09/18 16:43:19 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgthree.c,v 1.25 2009/09/19 07:07:43 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -69,13 +69,13 @@
 #include opt_wsemul.h
 #endif
 
+#include ioconf.h
+
 static void	cgthreeunblank(device_t);
 static void	cgthreeloadcmap(struct cgthree_softc *, int, int);
 static void	cgthree_set_video(struct cgthree_softc *, int);
 static int	cgthree_get_video(struct cgthree_softc *);
 
-extern struct cfdriver cgthree_cd;
-
 dev_type_open(cgthreeopen);
 dev_type_ioctl(cgthreeioctl);
 dev_type_mmap(cgthreemmap);



CVS commit: src/sys/dev/sun

2009-09-12 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep 12 19:39:12 UTC 2009

Modified Files:
src/sys/dev/sun: bt_subr.c

Log Message:
Remove an extra parenthesis in #ifdef'ed out part. PR kern/41858


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/sun/bt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/bt_subr.c
diff -u src/sys/dev/sun/bt_subr.c:1.13 src/sys/dev/sun/bt_subr.c:1.14
--- src/sys/dev/sun/bt_subr.c:1.13	Sat Apr 18 14:58:04 2009
+++ src/sys/dev/sun/bt_subr.c	Sat Sep 12 19:39:12 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bt_subr.c,v 1.13 2009/04/18 14:58:04 tsutsui Exp $ */
+/*	$NetBSD: bt_subr.c,v 1.14 2009/09/12 19:39:12 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1993
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bt_subr.c,v 1.13 2009/04/18 14:58:04 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: bt_subr.c,v 1.14 2009/09/12 19:39:12 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -217,7 +217,7 @@
 	 * Figure out where to start in the RGB arrays
 	 * See btreg.h for the way RGB triplets are packed into 4-byte words.
 	 */
-	c[0] = cm-red[(4 * count) / 3)];
+	c[0] = cm-red[(4 * count) / 3];
 	c[1] = cm-green[(4 * count) / 3];
 	c[2] = cm-blue[(4 * count) / 3];
 	p = c[0];



CVS commit: src/sys/dev/sun

2009-08-26 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Aug 26 22:34:50 UTC 2009

Modified Files:
src/sys/dev/sun: fbio.h

Log Message:
apparently the official name for the S24 is FBTYPE_TCXCOLOR


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/sun/fbio.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sun/fbio.h
diff -u src/sys/dev/sun/fbio.h:1.10 src/sys/dev/sun/fbio.h:1.11
--- src/sys/dev/sun/fbio.h:1.10	Sat Aug 15 11:33:49 2009
+++ src/sys/dev/sun/fbio.h	Wed Aug 26 22:34:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: fbio.h,v 1.10 2009/08/15 11:33:49 macallan Exp $ */
+/*	$NetBSD: fbio.h,v 1.11 2009/08/26 22:34:50 macallan Exp $ */
 
 /*
  * Copyright (c) 1992 Regents of the University of California.
@@ -73,7 +73,7 @@
 #define FBTYPE_CREATOR		22	/* ffb creator or elite */
 #define FBTYPE_GENERIC_PCI	23	/* machfb, ofb and so on */
 #define FBTYPE_AG10E		24	/* Fujitsu AG-10e */
-#define FBTYPE_SUNTCX		25	/* Sun TCX, S24  */
+#define FBTYPE_TCXCOLOR		25	/* Sun TCX, S24  */
 
 #define	FBTYPE_LASTPLUSONE	26	/* max number of fbs (change as add) */
 



  1   2   >