CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2021-12-02 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Dec  3 06:10:07 UTC 2021

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c

Log Message:
draw very narrow rectangles correctly


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.16 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.17
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.16	Thu Dec  2 22:35:26 2021
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c	Fri Dec  3 06:10:07 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: cg14_accel.c,v 1.16 2021/12/02 22:35:26 macallan Exp $ */
+/* $NetBSD: cg14_accel.c,v 1.17 2021/12/03 06:10:07 macallan Exp $ */
 /*
  * Copyright (c) 2013 Michael Lorenz
  * All rights reserved.
@@ -594,10 +594,12 @@ CG14Solid8(Cg14Ptr p, uint32_t start, ui
 		for (line = 0; line < h; line++) {
 			ptr = start;
 			cnt = w;
+			pre = min(pre, cnt);
 			if (pre) {
 write_sx_io(p, ptr & ~7, SX_STBS(8, pre - 1, ptr & 7));
 ptr += pre;
 cnt -= pre;
+if (cnt == 0) goto next;
 			}
 			/* now do the aligned pixels in 32bit chunks */
 			if (ptr & 3) xf86Msg(X_ERROR, "%s %x\n", __func__, ptr);
@@ -612,6 +614,7 @@ CG14Solid8(Cg14Ptr p, uint32_t start, ui
 write_sx_io(p, ptr & ~7, SX_STBS(8, cnt - 1, ptr & 7));
 			}
 			if ((ptr + cnt) != (start + w)) xf86Msg(X_ERROR, "%s %x vs %x\n", __func__, ptr + cnt, start + w);
+next:
 			start += pitch;
 		}
 	} else if (p->last_rop == 0xaa) {



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2021-12-02 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Dec  3 06:10:07 UTC 2021

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c

Log Message:
draw very narrow rectangles correctly


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c

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



CVS commit: src/sys/arch/arm/sociox

2021-12-02 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Fri Dec  3 05:28:33 UTC 2021

Removed Files:
src/sys/arch/arm/sociox: sni_exiu.c

Log Message:
retire sni_exiu.c in favour of ACPI0013 generic event divice to
respond power button press.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r0 src/sys/arch/arm/sociox/sni_exiu.c

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



CVS commit: src/sys/arch/arm/sociox

2021-12-02 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Fri Dec  3 05:28:33 UTC 2021

Removed Files:
src/sys/arch/arm/sociox: sni_exiu.c

Log Message:
retire sni_exiu.c in favour of ACPI0013 generic event divice to
respond power button press.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r0 src/sys/arch/arm/sociox/sni_exiu.c

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



CVS commit: src/sys/arch/arm/sociox

2021-12-02 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Fri Dec  3 05:21:52 UTC 2021

Modified Files:
src/sys/arch/arm/sociox: files.sociox

Log Message:
retire sni_exiu.c in favour of ACPI0013 generic event device implemented
by dev/acpi/acpi_ged.c


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/sociox/files.sociox

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

Modified files:

Index: src/sys/arch/arm/sociox/files.sociox
diff -u src/sys/arch/arm/sociox/files.sociox:1.9 src/sys/arch/arm/sociox/files.sociox:1.10
--- src/sys/arch/arm/sociox/files.sociox:1.9	Thu Mar 19 22:17:45 2020
+++ src/sys/arch/arm/sociox/files.sociox	Fri Dec  3 05:21:52 2021
@@ -1,6 +1,6 @@
-#	$NetBSD: files.sociox,v 1.9 2020/03/19 22:17:45 nisimura Exp $
+#	$NetBSD: files.sociox,v 1.10 2021/12/03 05:21:52 nisimura Exp $
 #
-# Configuration info for Socionext Unifier/SC2A11
+# Configuration info for Socionext SC2A11
 #
 #
 
@@ -32,9 +32,3 @@ device	snigpio: gpiobus
 attach	snigpio at acpinodebus with snigpio_acpi
 attach	snigpio at fdt with snigpio_fdt
 file	arch/arm/sociox/sni_gpio.c		snigpio
-
-# Socionext EXIU external interrupt controller unit
-device	sniexiu
-attach	sniexiu at acpinodebus with sniexitu_acpi
-attach	sniexiu at fdt with sniexiu_fdt
-file	arch/arm/sociox/sni_exiu.c		sniexiu



CVS commit: src/sys/arch/arm/sociox

2021-12-02 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Fri Dec  3 05:21:52 UTC 2021

Modified Files:
src/sys/arch/arm/sociox: files.sociox

Log Message:
retire sni_exiu.c in favour of ACPI0013 generic event device implemented
by dev/acpi/acpi_ged.c


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/sociox/files.sociox

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



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2021-12-02 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Thu Dec  2 22:53:43 UTC 2021

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_driver.c

Log Message:
fix shadow fb geometry calculations
... not that a shadow fb helps much on this hardware.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c

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



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2021-12-02 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Thu Dec  2 22:53:43 UTC 2021

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_driver.c

Log Message:
fix shadow fb geometry calculations
... not that a shadow fb helps much on this hardware.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c:1.18 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c:1.19
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c:1.18	Thu Dec  2 22:32:35 2021
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c	Thu Dec  2 22:53:43 2021
@@ -797,9 +797,10 @@ CG14WindowLinear(ScreenPtr pScreen, CARD
 {
 ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
 Cg14Ptr pCg14 = GET_CG14_FROM_SCRN(pScrn);
+int shift = (pScrn->bitsPerPixel > 8) ? 2 : 0;
 
-*size = pCg14->width << 2;
-return (CARD8 *)pCg14->fb + row * (pCg14->width << 2) + offset;
+*size = pCg14->width << shift;
+return (CARD8 *)pCg14->fb + row * (pCg14->width << shift) + offset;
 }
 
 /* Free up any per-generation data structures */



CVS commit: src/usr.bin/make/unit-tests

2021-12-02 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Dec  2 22:41:01 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: varname-dot-make-save_dollars.mk

Log Message:
tests/make: fix test for .MAKE.SAVE_DOLLARS

The previous assumption was wrong that only literal '$$' that occur
directly in the right-hand side of a variable assignment would be
affected.  Indirect variable definitions are affected as well when they
are evaluated nestedly, as long as the '$$' appears in the text of the
variable that is actually parsed.  Whether the '$$' ends up in the
expanded value of the expression doesn't matter though.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk
diff -u src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk:1.5 src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk:1.6
--- src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk:1.5	Wed Dec  1 23:15:38 2021
+++ src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk	Thu Dec  2 22:41:01 2021
@@ -1,4 +1,4 @@
-# $NetBSD: varname-dot-make-save_dollars.mk,v 1.5 2021/12/01 23:15:38 rillig Exp $
+# $NetBSD: varname-dot-make-save_dollars.mk,v 1.6 2021/12/02 22:41:01 rillig Exp $
 #
 # Tests for the special .MAKE.SAVE_DOLLARS variable, which controls whether
 # the assignment operator ':=' converts '$$' to a single '$' or keeps it
@@ -17,8 +17,8 @@
 .endif
 
 
-# Even when dollars are preserved, it only applies to literal dollars, not
-# to those that come indirectly from other expressions.
+# When dollars are preserved, this setting not only applies to literal
+# dollars, but also to those that come indirectly from other expressions.
 DOLLARS=		
 .MAKE.SAVE_DOLLARS=	yes
 VAR:=			${DOLLARS}
@@ -29,6 +29,15 @@ VAR:=			${DOLLARS}
 .  error
 .endif
 
+# When dollars are preserved, this setting not only applies to literal
+# dollars, but also to those that come indirectly from other expressions.
+DOLLARS=		
+.MAKE.SAVE_DOLLARS=	no
+VAR:=			${DOLLARS}
+.if ${VAR} != "\$\$"
+.  error
+.endif
+
 # The 'yes' preserves the dollars from the literal.
 .MAKE.SAVE_DOLLARS=	yes
 VAR:=			
@@ -51,8 +60,10 @@ VAR:=		-${.MAKE.SAVE_DOLLARS::=yes}-
 .  error
 .endif
 
-# The '$' from the ':U' expressions are indirect, therefore .MAKE.SAVE_DOLLARS
-# doesn't apply to them.
+# The '$' from the ':U' expressions do not appear as literal '$$' to the
+# parser (no matter whether directly or indirectly), they only appear as '$$'
+# in the value of an expression, therefore .MAKE.SAVE_DOLLARS doesn't apply
+# here.
 .MAKE.SAVE_DOLLARS=	no
 VAR:=		${:U\$\$\$\$}-${.MAKE.SAVE_DOLLARS::=yes}-${:U\$\$\$\$}
 .if ${VAR} != "\$\$--\$\$"
@@ -77,4 +88,24 @@ VAR:=		
 .  error
 .endif
 
+# The variable '.MAKE.SAVE_DOLLARS' not only affects literal '$$' on the
+# right-hand side of the assignment operator ':=', it also affects dollars
+# in indirect expressions.
+#
+# In this example, it affects the command in CMD itself, not the result of
+# running that command.
+.MAKE.SAVE_DOLLARS=	no
+CMD=			echo ''
+VAR:=			${CMD:sh}
+.if ${VAR} != "\$\$"
+.  error
+.endif
+
+.MAKE.SAVE_DOLLARS=	yes
+CMD=			echo ''
+VAR:=			${CMD:sh}
+.if ${VAR} != "\$\$\$\$"
+.  error
+.endif
+
 all:



CVS commit: src/usr.bin/make/unit-tests

2021-12-02 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Dec  2 22:41:01 UTC 2021

Modified Files:
src/usr.bin/make/unit-tests: varname-dot-make-save_dollars.mk

Log Message:
tests/make: fix test for .MAKE.SAVE_DOLLARS

The previous assumption was wrong that only literal '$$' that occur
directly in the right-hand side of a variable assignment would be
affected.  Indirect variable definitions are affected as well when they
are evaluated nestedly, as long as the '$$' appears in the text of the
variable that is actually parsed.  Whether the '$$' ends up in the
expanded value of the expression doesn't matter though.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk

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



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2021-12-02 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Thu Dec  2 22:35:26 UTC 2021

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c

Log Message:
first step towards acceleration in 8 bit colour
- Copy() uses byte mode
- Solid() uses 32bit writes where possible for plain fills
... mostly works, but could be quite a bit faster


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.15 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.16
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.15	Wed Jul 24 16:07:59 2019
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c	Thu Dec  2 22:35:26 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: cg14_accel.c,v 1.15 2019/07/24 16:07:59 macallan Exp $ */
+/* $NetBSD: cg14_accel.c,v 1.16 2021/12/02 22:35:26 macallan Exp $ */
 /*
  * Copyright (c) 2013 Michael Lorenz
  * All rights reserved.
@@ -42,7 +42,7 @@
 
 #include "cg14.h"
 
-/*#define SX_DEBUG*/
+//#define SX_DEBUG
 
 #ifdef SX_DEBUG
 #define ENTER xf86Msg(X_ERROR, "%s>\n", __func__);
@@ -492,8 +492,14 @@ CG14PrepareSolid(PixmapPtr pPixmap, int 
 	Cg14Ptr p = GET_CG14_FROM_SCRN(pScrn);
 
 	ENTER;
-	DPRINTF(X_ERROR, "bits per pixel: %d\n",
-	pPixmap->drawable.bitsPerPixel);
+	DPRINTF(X_ERROR, "bits per pixel: %d %08x\n",
+	pPixmap->drawable.bitsPerPixel, fg);
+
+	/* repeat the colour in every sub byte if we're in 8 bit */
+	if (pPixmap->drawable.bitsPerPixel == 8) {
+		fg |= fg << 8;
+		fg |= fg << 16;
+	}
 	write_sx_reg(p, SX_QUEUED(8), fg);
 	write_sx_reg(p, SX_QUEUED(9), fg);
 	if (planemask != p->last_mask) {
@@ -507,6 +513,7 @@ CG14PrepareSolid(PixmapPtr pPixmap, int 
 		write_sx_reg(p, SX_ROP_CONTROL, alu);
 		p->last_rop = alu;
 	}
+	if (0) return FALSE;
 	DPRINTF(X_ERROR, "%s: %x\n", __func__, alu);
 	return TRUE;
 }
@@ -575,24 +582,36 @@ CG14Solid32(Cg14Ptr p, uint32_t start, u
 static void
 CG14Solid8(Cg14Ptr p, uint32_t start, uint32_t pitch, int w, int h)
 {
-	int line, x, num, off;
+	int line, x, num, off, pre, cnt;
 	uint32_t ptr;
 
 	ENTER;
-	off = start & 7;
-	start &= ~7;
+	pre = start & 3;
+	if (pre != 0) pre = 4 - pre;
 
 	if (p->last_rop == 0xcc) {
 		/* simple fill */
 		for (line = 0; line < h; line++) {
-			x = 0;
-			while (x < w) {
-ptr = start + x;
-num = min(32, w - x);
-write_sx_io(p, ptr,
-SX_STBS(8, num - 1, off));
-x += 32;
+			ptr = start;
+			cnt = w;
+			if (pre) {
+write_sx_io(p, ptr & ~7, SX_STBS(8, pre - 1, ptr & 7));
+ptr += pre;
+cnt -= pre;
+			}
+			/* now do the aligned pixels in 32bit chunks */
+			if (ptr & 3) xf86Msg(X_ERROR, "%s %x\n", __func__, ptr);
+			while(cnt > 3) {
+num = min(32, cnt >> 2);
+write_sx_io(p, ptr & ~7, SX_STS(8, num - 1, ptr & 7));
+ptr += num << 2;
+cnt -= num << 2;
+			}
+			if (cnt > 3) xf86Msg(X_ERROR, "%s cnt %d\n", __func__, cnt);
+			if (cnt > 0) {
+write_sx_io(p, ptr & ~7, SX_STBS(8, cnt - 1, ptr & 7));
 			}
+			if ((ptr + cnt) != (start + w)) xf86Msg(X_ERROR, "%s %x vs %x\n", __func__, ptr + cnt, start + w);
 			start += pitch;
 		}
 	} else if (p->last_rop == 0xaa) {
@@ -600,6 +619,8 @@ CG14Solid8(Cg14Ptr p, uint32_t start, ui
 		return;
 	} else {
 		/* alright, let's do actual ROP stuff */
+		off = start & 7;
+		start &= ~7;
 
 		/* first repeat the fill colour into 16 registers */
 		write_sx_reg(p, SX_INSTRUCTIONS,
@@ -1076,7 +1097,7 @@ CG14InitAccel(ScreenPtr pScreen)
 
 	pExa->memoryBase = p->fb;
 	pExa->memorySize = p->memsize;
-	pExa->offScreenBase = p->width * p->height * 4;
+	pExa->offScreenBase = p->width * p->height * (pScrn->depth >> 3);
 
 	/*
 	 * SX memory instructions are written to 64bit aligned addresses with



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2021-12-02 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Thu Dec  2 22:35:26 UTC 2021

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c

Log Message:
first step towards acceleration in 8 bit colour
- Copy() uses byte mode
- Solid() uses 32bit writes where possible for plain fills
... mostly works, but could be quite a bit faster


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c

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



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2021-12-02 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Thu Dec  2 22:32:36 UTC 2021

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_driver.c

Log Message:
support 8 bit colour
no acceleration yet, the code is riddled with 32bit per pixel assumptions


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c

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



CVS commit: xsrc/external/mit/xf86-video-suncg14/dist/src

2021-12-02 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Thu Dec  2 22:32:36 UTC 2021

Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_driver.c

Log Message:
support 8 bit colour
no acceleration yet, the code is riddled with 32bit per pixel assumptions


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c:1.17 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c:1.18
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c:1.17	Wed Dec  1 17:47:11 2021
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_driver.c	Thu Dec  2 22:32:35 2021
@@ -370,6 +370,7 @@ CG14PreInit(ScrnInfoPtr pScrn, int flags
 switch (pScrn->depth) {
 	case 32:
 	case 24:
+	case 8:
 	/* OK */
 	break;
 	default:
@@ -593,9 +594,11 @@ CG14ScreenInit(SCREEN_INIT_ARGS_DECL)
  */
 miClearVisualTypes();
 
-/* Setup the visuals we support. */
+/* Set the bits per RGB for 8bpp mode */
+pScrn->rgbBits = 8;
 
-if (!miSetVisualTypes(pScrn->depth, TrueColorMask,
+/* Setup the visuals we support. */
+if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth),
 			  pScrn->rgbBits, pScrn->defaultVisual))
 	return FALSE;
 
@@ -617,6 +620,7 @@ CG14ScreenInit(SCREEN_INIT_ARGS_DECL)
  */
 
 CG14InitCplane24(pScrn);
+
 ret = fbScreenInit(pScreen, pCg14->use_shadow ? pCg14->shadow : pCg14->fb,
 		   pScrn->virtualX,
 		   pScrn->virtualY, pScrn->xDpi, pScrn->yDpi,
@@ -683,6 +687,9 @@ CG14ScreenInit(SCREEN_INIT_ARGS_DECL)
 if (!miCreateDefColormap(pScreen))
 	return FALSE;
 
+if(!xf86SbusHandleColormaps(pScreen, pCg14->psdp))
+	return FALSE;
+
 pCg14->CloseScreen = pScreen->CloseScreen;
 pScreen->CloseScreen = CG14CloseScreen;
 pScreen->SaveScreen = CG14SaveScreen;
@@ -774,8 +781,7 @@ CG14CloseScreen(CLOSE_SCREEN_ARGS_DECL)
 
 pScrn->vtSema = FALSE;
 CG14ExitCplane24 (pScrn);
-xf86UnmapSbusMem(pCg14->psdp, pCg14->fb,
-		 (pCg14->psdp->width * pCg14->psdp->height * 4));
+xf86UnmapSbusMem(pCg14->psdp, pCg14->fb, pCg14->memsize);
 xf86UnmapSbusMem(pCg14->psdp, pCg14->x32,
 		 (pCg14->psdp->width * pCg14->psdp->height));
 xf86UnmapSbusMem(pCg14->psdp, pCg14->xlut, 4096);
@@ -864,9 +870,12 @@ CG14InitCplane24(ScrnInfoPtr pScrn)
   int size, bpp;
   
   size = pScrn->virtualX * pScrn->virtualY;
-  bpp = 32;
+  if (pScrn->bitsPerPixel > 8) {
+  	bpp = 32;
+  } else
+  	bpp = 8;
   ioctl (pCg14->psdp->fd, CG14_SET_PIXELMODE, );
-  memset (pCg14->fb, 0, size * 4);
+  memset (pCg14->fb, 0, size * (bpp >> 3));
   memset (pCg14->x32, 0, size);
   memset (pCg14->xlut, 0, 0x200);
 }  



CVS commit: src/usr.sbin/bta2dpd/bta2dpd

2021-12-02 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Dec  2 21:59:22 UTC 2021

Modified Files:
src/usr.sbin/bta2dpd/bta2dpd: bta2dpd.8

Log Message:
bta2dpd(8): s/conection/connection/


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.8

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

Modified files:

Index: src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.8
diff -u src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.8:1.5 src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.8:1.6
--- src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.8:1.5	Sun Mar  7 13:09:43 2021
+++ src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.8	Thu Dec  2 21:59:22 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: bta2dpd.8,v 1.5 2021/03/07 13:09:43 nat Exp $
+.\"	$NetBSD: bta2dpd.8,v 1.6 2021/12/02 21:59:22 andvar Exp $
 .\"
 .\" Copyright (c) 2015 - 2016  Nathanial Sloss 
 .\" All rights reserved.
@@ -108,7 +108,7 @@ option and the maximum bitpool for your 
 .It Fl D
 Run in the background.
 .It Fl n
-Do not close conection on end of file (EOF).
+Do not close connection on end of file (EOF).
 Useful for
 .Xr pad 4 .
 .It Fl d Ar device



CVS commit: src/usr.sbin/bta2dpd/bta2dpd

2021-12-02 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Dec  2 21:59:22 UTC 2021

Modified Files:
src/usr.sbin/bta2dpd/bta2dpd: bta2dpd.8

Log Message:
bta2dpd(8): s/conection/connection/


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.8

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



CVS commit: src/usr.sbin/btconfig

2021-12-02 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Dec  2 21:55:22 UTC 2021

Modified Files:
src/usr.sbin/btconfig: btconfig.8

Log Message:
btconfig(8): s/fomat/format/ and article fix.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/btconfig/btconfig.8

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



CVS commit: src/usr.sbin/btconfig

2021-12-02 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Dec  2 21:55:22 UTC 2021

Modified Files:
src/usr.sbin/btconfig: btconfig.8

Log Message:
btconfig(8): s/fomat/format/ and article fix.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/btconfig/btconfig.8

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

Modified files:

Index: src/usr.sbin/btconfig/btconfig.8
diff -u src/usr.sbin/btconfig/btconfig.8:1.18 src/usr.sbin/btconfig/btconfig.8:1.19
--- src/usr.sbin/btconfig/btconfig.8:1.18	Thu Mar 15 22:35:03 2012
+++ src/usr.sbin/btconfig/btconfig.8	Thu Dec  2 21:55:22 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: btconfig.8,v 1.18 2012/03/15 22:35:03 njoly Exp $
+.\" $NetBSD: btconfig.8,v 1.19 2021/12/02 21:55:22 andvar Exp $
 .\"
 .\" Copyright (c) 2006 Itronix Inc.
 .\" All rights reserved.
@@ -152,7 +152,7 @@ Enable Remote Signal Strength Indicator 
 This will only work if the device features indicate
 .Aq RSSI with inquiry result .
 .It ext
-Inquiry Result with RSSI format or Extended Inquiry Result fomat.
+Inquiry Result with RSSI format or Extended Inquiry Result format.
 This will only work where the device features indicate
 .Aq extended inquiry ,
 and the Extended Inquiry Result will only occur when the remote device
@@ -183,7 +183,7 @@ Super-user privileges are required to ch
 .Sh DIAGNOSTICS
 Messages indicating the specified device does not exist, the
 requested address is unknown, or the user is not privileged and
-tried to alter an device's configuration.
+tried to alter a device's configuration.
 .Sh SEE ALSO
 .Xr bcsp 4 ,
 .Xr bluetooth 4 ,



CVS commit: src/usr.sbin/fstyp

2021-12-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec  2 14:26:42 UTC 2021

Modified Files:
src/usr.sbin/fstyp: hammer2.c

Log Message:
PR/56530: RVP: use ioctl to get the partition size if possible (avoids SEGV)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/fstyp/hammer2.c

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

Modified files:

Index: src/usr.sbin/fstyp/hammer2.c
diff -u src/usr.sbin/fstyp/hammer2.c:1.8 src/usr.sbin/fstyp/hammer2.c:1.9
--- src/usr.sbin/fstyp/hammer2.c:1.8	Sun Jan 10 08:44:57 2021
+++ src/usr.sbin/fstyp/hammer2.c	Thu Dec  2 09:26:42 2021
@@ -1,4 +1,4 @@
-/*$NetBSD: hammer2.c,v 1.8 2021/01/10 13:44:57 martin Exp $  */
+/*$NetBSD: hammer2.c,v 1.9 2021/12/02 14:26:42 christos Exp $  */
 
 /*-
  * Copyright (c) 2017-2019 The DragonFly Project
@@ -27,7 +27,11 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hammer2.c,v 1.8 2021/01/10 13:44:57 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hammer2.c,v 1.9 2021/12/02 14:26:42 christos Exp $");
+
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -44,32 +48,37 @@ static ssize_t
 get_file_size(FILE *fp)
 {
 	ssize_t siz;
+	struct dkwedge_info dkw;
+
+	if (ioctl(fileno(fp), DIOCGWEDGEINFO, ) != -1) {
+		return (ssize_t)dkw.dkw_size * DEV_BSIZE;
+	}
 
 	if (fseek(fp, 0, SEEK_END) == -1) {
 		warnx("hammer2: failed to seek media end");
-		return (-1);
+		return -1;
 	}
 
 	siz = ftell(fp);
 	if (siz == -1) {
 		warnx("hammer2: failed to tell media end");
-		return (-1);
+		return -1;
 	}
 
-	return (siz);
+	return siz;
 }
 
 static hammer2_volume_data_t *
 read_voldata(FILE *fp, int i)
 {
 	if (i < 0 || i >= HAMMER2_NUM_VOLHDRS)
-		return (NULL);
+		return NULL;
 
 	if ((hammer2_off_t)i * (hammer2_off_t)HAMMER2_ZONE_BYTES64 >= (hammer2_off_t)get_file_size(fp))
-		return (NULL);
+		return NULL;
 
-	return (read_buf(fp, (off_t)i * (off_t)HAMMER2_ZONE_BYTES64,
-	sizeof(hammer2_volume_data_t)));
+	return read_buf(fp, (off_t)i * (off_t)HAMMER2_ZONE_BYTES64,
+	sizeof(hammer2_volume_data_t));
 }
 
 static int
@@ -86,20 +95,20 @@ test_voldata(FILE *fp)
 		voldata = read_voldata(fp, i);
 		if (voldata == NULL) {
 			warnx("hammer2: failed to read volume data");
-			return (1);
+			return 1;
 		}
 		if (voldata->magic != HAMMER2_VOLUME_ID_HBO &&
 		voldata->magic != HAMMER2_VOLUME_ID_ABO) {
 			free(voldata);
-			return (1);
+			return 1;
 		}
 		if (voldata->volu_id > HAMMER2_MAX_VOLUMES - 1) {
 			free(voldata);
-			return (1);
+			return 1;
 		}
 		if (voldata->nvolumes > HAMMER2_MAX_VOLUMES) {
 			free(voldata);
-			return (1);
+			return 1;
 		}
 
 		if (count == 0) {
@@ -109,21 +118,21 @@ test_voldata(FILE *fp)
 		} else {
 			if (voldata->nvolumes != count) {
 free(voldata);
-return (1);
+return 1;
 			}
 			if (!uuid_equal(, >fsid, NULL)) {
 free(voldata);
-return (1);
+return 1;
 			}
 			if (!uuid_equal(, >fstype, NULL)) {
 free(voldata);
-return (1);
+return 1;
 			}
 		}
 		free(voldata);
 	}
 
-	return (0);
+	return 0;
 }
 
 static hammer2_media_data_t*
@@ -140,7 +149,7 @@ read_media(FILE *fp, const hammer2_block
 
 	if (!bytes) {
 		warnx("hammer2: blockref has no data");
-		return (NULL);
+		return NULL;
 	}
 
 	io_off = bref->data_off & ~HAMMER2_OFF_MASK_RADIX;
@@ -153,7 +162,7 @@ read_media(FILE *fp, const hammer2_block
 
 	if (io_bytes > sizeof(hammer2_media_data_t)) {
 		warnx("hammer2: invalid I/O bytes");
-		return (NULL);
+		return NULL;
 	}
 
 	/*
@@ -163,26 +172,26 @@ read_media(FILE *fp, const hammer2_block
 	fbytes = (size_t)get_file_size(fp);
 	if ((ssize_t)fbytes == -1) {
 		warnx("hammer2: failed to get media size");
-		return (NULL);
+		return NULL;
 	}
 	if (io_base >= fbytes) {
 		warnx("hammer2: XXX read beyond HAMMER2 root volume limit unsupported");
-		return (NULL);
+		return NULL;
 	}
 
 	if (fseeko(fp, (off_t)io_base, SEEK_SET) == -1) {
 		warnx("hammer2: failed to seek media");
-		return (NULL);
+		return NULL;
 	}
 	media = read_buf(fp, (off_t)io_base, io_bytes);
 	if (media == NULL) {
 		warnx("hammer2: failed to read media");
-		return (NULL);
+		return NULL;
 	}
 	if (boff)
 		memcpy(media, (char *)media + boff, bytes);
 
-	return (media);
+	return media;
 }
 
 static int
@@ -196,7 +205,7 @@ find_pfs(FILE *fp, const hammer2_blockre
 
 	media = read_media(fp, bref, );
 	if (media == NULL)
-		return (-1);
+		return -1;
 
 	switch (bref->type) {
 	case HAMMER2_BREF_TYPE_INODE:
@@ -221,7 +230,7 @@ find_pfs(FILE *fp, const hammer2_blockre
 }
 			} else {
 free(media);
-return (-1);
+return -1;
 			}
 		}
 		break;
@@ -239,13 +248,13 @@ find_pfs(FILE *fp, const hammer2_blockre
 		if (bscan[i].type != HAMMER2_BREF_TYPE_EMPTY) {
 			if (find_pfs(fp, [i], pfs, res) == -1) {
 free(media);
-return (-1);
+return -1;
 			}
 		}
 	}
 	free(media);
 
-	return (0);
+	return 0;
 }
 
 static 

CVS commit: src/usr.sbin/fstyp

2021-12-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec  2 14:26:42 UTC 2021

Modified Files:
src/usr.sbin/fstyp: hammer2.c

Log Message:
PR/56530: RVP: use ioctl to get the partition size if possible (avoids SEGV)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/fstyp/hammer2.c

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



CVS commit: src/usr.sbin/fstyp

2021-12-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec  2 14:26:12 UTC 2021

Modified Files:
src/usr.sbin/fstyp: ntfs.c

Log Message:
PR/56530: RVP: fix iconv open error.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/fstyp/ntfs.c

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

Modified files:

Index: src/usr.sbin/fstyp/ntfs.c
diff -u src/usr.sbin/fstyp/ntfs.c:1.2 src/usr.sbin/fstyp/ntfs.c:1.3
--- src/usr.sbin/fstyp/ntfs.c:1.2	Sat Dec 28 03:22:30 2019
+++ src/usr.sbin/fstyp/ntfs.c	Thu Dec  2 09:26:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntfs.c,v 1.2 2019/12/28 08:22:30 tkusumi Exp $	*/
+/*	$NetBSD: ntfs.c,v 1.3 2021/12/02 14:26:12 christos Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -35,10 +35,11 @@
  * SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: ntfs.c,v 1.2 2019/12/28 08:22:30 tkusumi Exp $");
+__RCSID("$NetBSD: ntfs.c,v 1.3 2021/12/02 14:26:12 christos Exp $");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -108,8 +109,7 @@ convert_label(const void *label /* LE */
 	iconv_t cd;
 	size_t rc;
 
-	/* dstname="" means convert to the current locale. */
-	cd = iconv_open("", NTFS_ENC);
+	cd = iconv_open(nl_langinfo(CODESET), NTFS_ENC);
 	if (cd == (iconv_t)-1) {
 		warn("ntfs: Could not open iconv");
 		return;



CVS commit: src/usr.sbin/fstyp

2021-12-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec  2 14:26:12 UTC 2021

Modified Files:
src/usr.sbin/fstyp: ntfs.c

Log Message:
PR/56530: RVP: fix iconv open error.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/fstyp/ntfs.c

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



CVS commit: src/sbin/mount

2021-12-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec  2 13:26:40 UTC 2021

Modified Files:
src/sbin/mount: mount.c

Log Message:
PR/56529: RVP: mount should try ffs when DIOCGWEDGEINFO returns an empty
dkw_ptype.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sbin/mount/mount.c

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

Modified files:

Index: src/sbin/mount/mount.c
diff -u src/sbin/mount/mount.c:1.105 src/sbin/mount/mount.c:1.106
--- src/sbin/mount/mount.c:1.105	Sun Nov 21 00:09:15 2021
+++ src/sbin/mount/mount.c	Thu Dec  2 08:26:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount.c,v 1.105 2021/11/21 05:09:15 simonb Exp $	*/
+/*	$NetBSD: mount.c,v 1.106 2021/12/02 13:26:39 christos Exp $	*/
 
 /*
  * Copyright (c) 1980, 1989, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)mount.c	8.25 (Berkeley) 5/8/95";
 #else
-__RCSID("$NetBSD: mount.c,v 1.105 2021/11/21 05:09:15 simonb Exp $");
+__RCSID("$NetBSD: mount.c,v 1.106 2021/12/02 13:26:39 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -348,7 +348,7 @@ hasopt(const char *mntopts, const char *
 			found = !negative;
 	}
 	free(optbuf);
-	return (found);
+	return found;
 }
 
 static int
@@ -376,7 +376,7 @@ mountfs(const char *vfstype, const char 
 
 	if (realpath(name, mntpath) == NULL) {
 		warn("realpath `%s'", name);
-		return (1);
+		return 1;
 	}
 
 	name = mntpath;
@@ -399,7 +399,7 @@ mountfs(const char *vfstype, const char 
 	else if (skipmounted) {
 		if ((numfs = getmntinfo(, MNT_WAIT)) == 0) {
 			warn("getmntinfo");
-			return (1);
+			return 1;
 		}
 		for(i = 0; i < numfs; i++) {
 			const char *mountedtype = sfp[i].f_fstypename;
@@ -427,7 +427,7 @@ mountfs(const char *vfstype, const char 
 	(int)sizeof(sfp[i].f_fstypename),
 	sfp[i].f_fstypename,
 	"already mounted");
-return (0);
+return 0;
 			}
 		}
 	}
@@ -482,7 +482,7 @@ mountfs(const char *vfstype, const char 
 		if (optbuf)
 			free(optbuf);
 		free(argv);
-		return (1);
+		return 1;
 
 	case 0:	/* Child. */
 		if (debug)
@@ -543,22 +543,22 @@ mountfs(const char *vfstype, const char 
 
 		if (waitpid(pid, , 0) == -1) {
 			warn("waitpid");
-			return (1);
+			return 1;
 		}
 
 		if (WIFEXITED(status)) {
 			if (WEXITSTATUS(status) != 0)
-return (WEXITSTATUS(status));
+return WEXITSTATUS(status);
 		} else if (WIFSIGNALED(status)) {
 			warnx("%s: %s", name, strsignal(WTERMSIG(status)));
-			return (1);
+			return 1;
 		}
 
 		if (buf == NULL) {
 			if (verbose) {
 if (statvfs(name, ) == -1) {
 	warn("statvfs %s", name);
-	return (1);
+	return 1;
 }
 prmount();
 			}
@@ -566,7 +566,7 @@ mountfs(const char *vfstype, const char 
 		break;
 	}
 
-	return (0);
+	return 0;
 }
 
 static void
@@ -628,13 +628,13 @@ getmntargs(struct statvfs *sfs, char *bu
 
 	if (mountfs(sfs->f_fstypename, sfs->f_mntfromname, sfs->f_mntonname, 0,
 	"getargs", NULL, 0, buf, buflen))
-		return (0);
+		return 0;
 	else {
 		if (*buf == '\0')
-			return (0);
+			return 0;
 		if ((buf = strchr(buf, '\n')) != NULL)
 			*buf = '\0';
-		return (1);
+		return 1;
 	}
 }
 
@@ -648,8 +648,8 @@ getmntpt(const char *name)
 	for (i = 0; i < mntsize; i++)
 		if (strcmp(mntbuf[i].f_mntfromname, name) == 0 ||
 		strcmp(mntbuf[i].f_mntonname, name) == 0)
-			return ([i]);
-	return (NULL);
+			return [i];
+	return NULL;
 }
 
 static void
@@ -736,19 +736,21 @@ getfslab(const char *str)
 
 		/* Silently fail here - mount call can display error */
 		if ((fd = open(buf, O_RDONLY)) == -1)
-			return (NULL);
+			return NULL;
 	}
 
 	/* Check to see if this is a wedge. */
 	if (ioctl(fd, DIOCGWEDGEINFO, ) == 0) {
 		/* Yup, this is easy. */
-		(void) close(fd);
-		return (dkw.dkw_ptype);
+		close(fd);
+		if (dkw.dkw_ptype && *dkw.dkw_ptype)
+			return dkw.dkw_ptype;
+		return NULL;
 	}
 
 	if (ioctl(fd, DIOCGDINFO, ) == -1) {
 		(void) close(fd);
-		return (NULL);
+		return NULL;
 	}
 
 	(void) close(fd);
@@ -756,7 +758,7 @@ getfslab(const char *str)
 	part = str[strlen(str) - 1] - 'a';
 
 	if (part < 0 || part >= dl.d_npartitions)
-		return (NULL);
+		return NULL;
 
 	/* Return NULL for unknown types - caller can fall back to ffs */
 	if ((fstype = dl.d_partitions[part].p_fstype) >= FSMAXMOUNTNAMES)
@@ -764,7 +766,7 @@ getfslab(const char *str)
 	else
 		vfstype = mountnames[fstype];
 
-	return (vfstype);
+	return vfstype;
 }
 
 static void



CVS commit: src/sbin/mount

2021-12-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec  2 13:26:40 UTC 2021

Modified Files:
src/sbin/mount: mount.c

Log Message:
PR/56529: RVP: mount should try ffs when DIOCGWEDGEINFO returns an empty
dkw_ptype.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sbin/mount/mount.c

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