CVS commit: src/share/mk

2019-06-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Jun 11 04:52:44 UTC 2019

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
turn on MKLLVMRT for aarch64 X11 builds.

with llvmpipe vs swrast, on pinebook 1080p i see 6x speed up for glxgears,
seamonkey & google maps is significantly faster, and ksudoku is workable.


To generate a diff of this commit:
cvs rdiff -u -r1.1145 -r1.1146 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1145 src/share/mk/bsd.own.mk:1.1146
--- src/share/mk/bsd.own.mk:1.1145	Sun Jun  2 21:29:13 2019
+++ src/share/mk/bsd.own.mk	Tue Jun 11 04:52:44 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1145 2019/06/02 21:29:13 mrg Exp $
+#	$NetBSD: bsd.own.mk,v 1.1146 2019/06/11 04:52:44 mrg Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -1156,12 +1156,13 @@ EXTERNAL_MESALIB_DIR?=	MesaLib.old
 EXTERNAL_MESALIB_DIR?=	MesaLib
 .endif
 
-# Default to LLVM run-time if x86 and X11 and Mesa 18
+# Default to LLVM run-time if x86 or aarch64 and X11 and Mesa 18
 # XXX This knows that MKX11=no is default below, but would
 # require splitting the below loop in two parts.
 .if ${MKX11:Uno} != "no" && ${HAVE_MESA_VER} == "18"
 MKLLVMRT.amd64=		yes
 MKLLVMRT.i386=		yes
+MKLLVMRT.aarch64=	yes
 .endif
 
 #



CVS commit: src/share/mk

2019-06-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Jun 11 04:52:44 UTC 2019

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
turn on MKLLVMRT for aarch64 X11 builds.

with llvmpipe vs swrast, on pinebook 1080p i see 6x speed up for glxgears,
seamonkey & google maps is significantly faster, and ksudoku is workable.


To generate a diff of this commit:
cvs rdiff -u -r1.1145 -r1.1146 src/share/mk/bsd.own.mk

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



CVS commit: src/tests/lib/libc/sys

2019-06-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Jun 10 22:16:06 UTC 2019

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Add posix_spawn(3) ATF tests in t_ptrace_wait*

New tests verify whether forking process reports forking events to a
debugger.

Right now there is no support in the kernel for this system.


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/tests/lib/libc/sys/t_ptrace_wait.c

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



CVS commit: src/tests/lib/libc/sys

2019-06-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Jun 10 22:16:06 UTC 2019

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Add posix_spawn(3) ATF tests in t_ptrace_wait*

New tests verify whether forking process reports forking events to a
debugger.

Right now there is no support in the kernel for this system.


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.123 src/tests/lib/libc/sys/t_ptrace_wait.c:1.124
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.123	Mon Jun 10 21:18:04 2019
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Mon Jun 10 22:16:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.123 2019/06/10 21:18:04 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.124 2019/06/10 22:16:06 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.123 2019/06/10 21:18:04 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.124 2019/06/10 22:16:06 kamil Exp $");
 
 #include 
 #include 
@@ -46,6 +46,7 @@ __RCSID("$NetBSD: t_ptrace_wait.c,v 1.12
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2985,7 +2986,7 @@ EVENTMASK_PRESERVED(eventmask_preserved_
 /// 
 
 static void
-fork_body(pid_t (*fn)(void), bool trackfork, bool trackvfork,
+fork_body(pid_t (*fn)(void), bool spawn, bool trackfork, bool trackvfork,
 bool trackvforkdone)
 {
 	const int exitval = 5;
@@ -3000,6 +3001,11 @@ fork_body(pid_t (*fn)(void), bool trackf
 	ptrace_event_t event;
 	const int elen = sizeof(event);
 
+	char * const arg[] = { __UNCONST("/bin/echo"), NULL };
+
+	if (spawn)
+		atf_tc_skip("posix_spawn() is not supported");
+
 	DPRINTF("Before forking process PID=%d\n", getpid());
 	SYSCALL_REQUIRE((child = fork()) != -1);
 	if (child == 0) {
@@ -3009,11 +3015,15 @@ fork_body(pid_t (*fn)(void), bool trackf
 		DPRINTF("Before raising %s from child\n", strsignal(sigval));
 		FORKEE_ASSERT(raise(sigval) == 0);
 
-		FORKEE_ASSERT((child2 = (fn)()) != -1);
-
-		if (child2 == 0)
-			_exit(exitval2);
+		if (spawn) {
+			FORKEE_ASSERT_EQ(posix_spawn(,
+			arg[0], NULL, NULL, arg, NULL), 0);
+		} else if (fn == fork || fn == vfork) {
+			FORKEE_ASSERT((child2 = (fn)()) != -1);
 
+			if (child2 == 0)
+_exit(exitval2);
+		}
 		FORKEE_REQUIRE_SUCCESS
 		(wpid = TWAIT_GENERIC(child2, , 0), child2);
 
@@ -3158,7 +3168,7 @@ fork_body(pid_t (*fn)(void), bool trackf
 	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, , 0));
 }
 
-#define FORK_TEST(name,fun,tfork,tvfork,tvforkdone)			\
+#define FORK_TEST(name,fun,spawn,tfork,tvfork,tvforkdone)		\
 ATF_TC(name);\
 ATF_TC_HEAD(name, tc)			\
 {	\
@@ -3172,37 +3182,51 @@ ATF_TC_HEAD(name, tc)			\
 ATF_TC_BODY(name, tc)			\
 {	\
 	\
-	fork_body(fun, tfork, tvfork, tvforkdone);			\
+	fork_body(fun, spawn, tfork, tvfork, tvforkdone);		\
 }
 
-FORK_TEST(fork1, fork, false, false, false)
+FORK_TEST(fork1, fork, false, false, false, false)
 #if defined(TWAIT_HAVE_PID)
-FORK_TEST(fork2, fork, true, false, false)
-FORK_TEST(fork3, fork, false, true, false)
-FORK_TEST(fork4, fork, true, true, false)
+FORK_TEST(fork2, fork, false, true, false, false)
+FORK_TEST(fork3, fork, false, false, true, false)
+FORK_TEST(fork4, fork, false, true, true, false)
 #endif
-FORK_TEST(fork5, fork, false, false, true)
+FORK_TEST(fork5, fork, false, false, false, true)
 #if defined(TWAIT_HAVE_PID)
-FORK_TEST(fork6, fork, true, false, true)
-FORK_TEST(fork7, fork, false, true, true)
-FORK_TEST(fork8, fork, true, true, true)
+FORK_TEST(fork6, fork, false, true, false, true)
+FORK_TEST(fork7, fork, false, false, true, true)
+FORK_TEST(fork8, fork, false, true, true, true)
 #endif
 
 #if TEST_VFORK_ENABLED
-FORK_TEST(vfork1, vfork, false, false, false)
+FORK_TEST(vfork1, vfork, false, false, false, false)
 #if defined(TWAIT_HAVE_PID)
-FORK_TEST(vfork2, vfork, true, false, false)
-FORK_TEST(vfork3, vfork, false, true, false)
-FORK_TEST(vfork4, vfork, true, true, false)
+FORK_TEST(vfork2, vfork, false, true, false, false)
+FORK_TEST(vfork3, vfork, false, false, true, false)
+FORK_TEST(vfork4, vfork, false, true, true, false)
 #endif
-FORK_TEST(vfork5, vfork, false, false, true)
+FORK_TEST(vfork5, vfork, false, false, false, true)
 #if defined(TWAIT_HAVE_PID)
-FORK_TEST(vfork6, vfork, true, false, true)
-FORK_TEST(vfork7, vfork, false, true, true)
-FORK_TEST(vfork8, vfork, true, true, true)
+FORK_TEST(vfork6, vfork, false, true, false, true)
+FORK_TEST(vfork7, vfork, false, false, true, true)
+FORK_TEST(vfork8, vfork, false, true, true, true)
 

CVS commit: src/tests/lib/libc/sys

2019-06-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Jun 10 21:18:04 UTC 2019

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Add more verbosity to debug messages in t_ptrace_wait

Log func() file:line for each debug message.

Most messages are similar one with the other and this change allows easier
navigation in the code.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/tests/lib/libc/sys/t_ptrace_wait.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/audio

2019-06-10 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Mon Jun 10 13:49:39 UTC 2019

Modified Files:
src/sys/dev/audio: audio.c audiodef.h

Log Message:
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/audio/audio.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/audio/audiodef.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/audio

2019-06-10 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Mon Jun 10 13:49:39 UTC 2019

Modified Files:
src/sys/dev/audio: audio.c audiodef.h

Log Message:
Use AUDIO_SCALEDOWN() macro rather than seemingly strange ifdefs.
Discussed on source-changes-d.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/audio/audio.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/audio/audiodef.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/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.15 src/sys/dev/audio/audio.c:1.16
--- src/sys/dev/audio/audio.c:1.15	Mon Jun 10 13:28:08 2019
+++ src/sys/dev/audio/audio.c	Mon Jun 10 13:49:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.15 2019/06/10 13:28:08 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.16 2019/06/10 13:49:39 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -142,7 +142,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.15 2019/06/10 13:28:08 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.16 2019/06/10 13:49:39 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -458,6 +458,28 @@ audio_track_bufstat(audio_track_t *track
 #define SPECIFIED(x)	((x) != ~0)
 #define SPECIFIED_CH(x)	((x) != (u_char)~0)
 
+/*
+ * AUDIO_SCALEDOWN()
+ * This macro should be used for audio wave data only.
+ *
+ * The arithmetic shift right (ASR) (in other words, floor()) is good for
+ * this purpose, and will be faster than division on the most platform.
+ * The division (in other words, truncate()) is not so bad alternate for
+ * this purpose, and will be fast enough.
+ * (Using ASR is 1.9 times faster than division on my amd64, and 1.3 times
+ * faster on my m68k.  -- isaki 201801.)
+ *
+ * However, the right shift operator ('>>') for negative integer is
+ * "implementation defined" behavior in C (note that it's not "undefined"
+ * behavior).  So only if implementation defines '>>' as ASR, we use it.
+ */
+#if defined(__GNUC__)
+/* gcc defines '>>' as ASR. */
+#define AUDIO_SCALEDOWN(value, bits)	((value) >> (bits))
+#else
+#define AUDIO_SCALEDOWN(value, bits)	((value) / (1 << (bits)))
+#endif
+
 /* Device timeout in msec */
 #define AUDIO_TIMEOUT	(3000)
 
@@ -3200,11 +3222,7 @@ audio_track_chvol(audio_filter_arg_t *ar
 		for (ch = 0; ch < channels; ch++) {
 			aint2_t val;
 			val = *s++;
-#if defined(AUDIO_USE_C_IMPLEMENTATION_DEFINED_BEHAVIOR) && defined(__GNUC__)
-			val = val * ch_volume[ch] >> 8;
-#else
-			val = val * ch_volume[ch] / 256;
-#endif
+			val = AUDIO_SCALEDOWN(val * ch_volume[ch], 8);
 			*d++ = (aint_t)val;
 		}
 	}
@@ -3226,11 +3244,7 @@ audio_track_chmix_mixLR(audio_filter_arg
 	d = arg->dst;
 
 	for (i = 0; i < arg->count; i++) {
-#if defined(AUDIO_USE_C_IMPLEMENTATION_DEFINED_BEHAVIOR) && defined(__GNUC__)
-		*d++ = (s[0] >> 1) + (s[1] >> 1);
-#else
-		*d++ = (s[0] / 2) + (s[1] / 2);
-#endif
+		*d++ = AUDIO_SCALEDOWN(s[0], 1) + AUDIO_SCALEDOWN(s[1], 1);
 		s += arg->srcfmt->channels;
 	}
 }
@@ -5027,11 +5041,7 @@ audio_pmixer_process(struct audio_softc 
 		if (vol != 256) {
 			m = mixer->mixsample;
 			for (i = 0; i < sample_count; i++) {
-#if defined(AUDIO_USE_C_IMPLEMENTATION_DEFINED_BEHAVIOR) && defined(__GNUC__)
-*m = *m * vol >> 8;
-#else
-*m = *m * vol / 256;
-#endif
+*m = AUDIO_SCALEDOWN(*m * vol, 8);
 m++;
 			}
 		}
@@ -5119,11 +5129,9 @@ audio_pmixer_mix_track(audio_trackmixer_
 #if defined(AUDIO_SUPPORT_TRACK_VOLUME)
 		if (track->volume != 256) {
 			for (i = 0; i < sample_count; i++) {
-#if defined(AUDIO_USE_C_IMPLEMENTATION_DEFINED_BEHAVIOR) && defined(__GNUC__)
-*d++ = ((aint2_t)*s++) * track->volume >> 8;
-#else
-*d++ = ((aint2_t)*s++) * track->volume / 256;
-#endif
+aint2_t v;
+v = *s++;
+*d++ = AUDIO_SCALEDOWN(v * track->volume, 8)
 			}
 		} else
 #endif
@@ -5137,11 +5145,9 @@ audio_pmixer_mix_track(audio_trackmixer_
 #if defined(AUDIO_SUPPORT_TRACK_VOLUME)
 		if (track->volume != 256) {
 			for (i = 0; i < sample_count; i++) {
-#if defined(AUDIO_USE_C_IMPLEMENTATION_DEFINED_BEHAVIOR) && defined(__GNUC__)
-*d++ += ((aint2_t)*s++) * track->volume >> 8;
-#else
-*d++ += ((aint2_t)*s++) * track->volume / 256;
-#endif
+aint2_t v;
+v = *s++;
+*d++ += AUDIO_SCALEDOWN(v * track->volume, 8);
 			}
 		} else
 #endif

Index: src/sys/dev/audio/audiodef.h
diff -u src/sys/dev/audio/audiodef.h:1.3 src/sys/dev/audio/audiodef.h:1.4
--- src/sys/dev/audio/audiodef.h:1.3	Thu May 23 12:20:27 2019
+++ src/sys/dev/audio/audiodef.h	Mon Jun 10 13:49:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: audiodef.h,v 1.3 2019/05/23 12:20:27 isaki Exp $	*/
+/*	$NetBSD: audiodef.h,v 1.4 2019/06/10 13:49:39 isaki Exp $	*/
 
 /*
  * Copyright (C) 2017 Tetsuya Isaki. All rights reserved.
@@ -63,12 +63,6 @@
  */
 /* #define AUDIO_SUPPORT_TRACK_VOLUME */
 
-/*
- * Whether use C language's "implementation defined" behavior (note that
- * it's not "undefined" behavior). 

CVS commit: src/sys/dev/audio

2019-06-10 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Mon Jun 10 13:28:09 UTC 2019

Modified Files:
src/sys/dev/audio: audio.c

Log Message:
Add missing newline to some error messages.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/audio/audio.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/audio

2019-06-10 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Mon Jun 10 13:28:09 UTC 2019

Modified Files:
src/sys/dev/audio: audio.c

Log Message:
Add missing newline to some error messages.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/audio/audio.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/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.14 src/sys/dev/audio/audio.c:1.15
--- src/sys/dev/audio/audio.c:1.14	Mon Jun 10 13:12:51 2019
+++ src/sys/dev/audio/audio.c	Mon Jun 10 13:28:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.14 2019/06/10 13:12:51 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.15 2019/06/10 13:28:08 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -142,7 +142,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.14 2019/06/10 13:12:51 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.15 2019/06/10 13:28:08 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -5205,7 +5205,7 @@ audio_pmixer_output(struct audio_softc *
 			start, end, blksize, audio_pintr, sc, );
 			if (error) {
 device_printf(sc->sc_dev,
-"trigger_output failed with %d", error);
+"trigger_output failed with %d\n", error);
 return;
 			}
 		}
@@ -5217,7 +5217,7 @@ audio_pmixer_output(struct audio_softc *
 		start, blksize, audio_pintr, sc);
 		if (error) {
 			device_printf(sc->sc_dev,
-			"start_output failed with %d", error);
+			"start_output failed with %d\n", error);
 			return;
 		}
 	}
@@ -5476,7 +5476,7 @@ audio_rmixer_input(struct audio_softc *s
 			start, end, blksize, audio_rintr, sc, );
 			if (error) {
 device_printf(sc->sc_dev,
-"trigger_input failed with %d", error);
+"trigger_input failed with %d\n", error);
 return;
 			}
 		}
@@ -5488,7 +5488,7 @@ audio_rmixer_input(struct audio_softc *s
 		start, blksize, audio_rintr, sc);
 		if (error) {
 			device_printf(sc->sc_dev,
-			"start_input failed with %d", error);
+			"start_input failed with %d\n", error);
 			return;
 		}
 	}



CVS commit: src/sys/dev/audio

2019-06-10 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Mon Jun 10 13:12:51 UTC 2019

Modified Files:
src/sys/dev/audio: audio.c audiovar.h

Log Message:
Call get_props() once at attach.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/audio/audio.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/audio/audiovar.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/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.13 src/sys/dev/audio/audio.c:1.14
--- src/sys/dev/audio/audio.c:1.13	Sat Jun  8 08:20:10 2019
+++ src/sys/dev/audio/audio.c	Mon Jun 10 13:12:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.13 2019/06/08 08:20:10 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.14 2019/06/10 13:12:51 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -121,7 +121,7 @@
  *	allocm 			-	- +	(*1)
  *	freem 			-	- +	(*1)
  *	round_buffersize 	-	x
- *	get_props 		-	x
+ *	get_props 		-	x	Called at attach time
  *	trigger_output 		x	x +
  *	trigger_input 		x	x +
  *	dev_ioctl 		-	x
@@ -142,7 +142,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.13 2019/06/08 08:20:10 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.14 2019/06/10 13:12:51 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -550,7 +550,6 @@ static int audio_hw_set_format(struct au
 	audio_filter_reg_t *, audio_filter_reg_t *);
 static int audiogetinfo(struct audio_softc *, struct audio_info *, int,
 	audio_file_t *);
-static int audio_get_props(struct audio_softc *);
 static bool audio_can_playback(struct audio_softc *);
 static bool audio_can_capture(struct audio_softc *);
 static int audio_check_params(audio_format2_t *);
@@ -843,7 +842,6 @@ audioattach(device_t parent, device_t se
 	bool has_indep;
 	bool has_fulldup;
 	int mode;
-	int props;
 	int error;
 
 	sc = device_private(self);
@@ -884,13 +882,16 @@ audioattach(device_t parent, device_t se
 	cv_init(>sc_exlockcv, "audiolk");
 
 	mutex_enter(sc->sc_lock);
-	props = audio_get_props(sc);
+	sc->sc_props = hw_if->get_props(sc->hw_hdl);
 	mutex_exit(sc->sc_lock);
 
-	has_playback = (props & AUDIO_PROP_PLAYBACK);
-	has_capture  = (props & AUDIO_PROP_CAPTURE);
-	has_indep= (props & AUDIO_PROP_INDEPENDENT);
-	has_fulldup  = (props & AUDIO_PROP_FULLDUPLEX);
+	/* MMAP is now supported by upper layer.  */
+	sc->sc_props |= AUDIO_PROP_MMAP;
+
+	has_playback = (sc->sc_props & AUDIO_PROP_PLAYBACK);
+	has_capture  = (sc->sc_props & AUDIO_PROP_CAPTURE);
+	has_indep= (sc->sc_props & AUDIO_PROP_INDEPENDENT);
+	has_fulldup  = (sc->sc_props & AUDIO_PROP_FULLDUPLEX);
 
 	KASSERT(has_playback || has_capture);
 	/* Unidirectional device must have neither FULLDUP nor INDEPENDENT. */
@@ -1859,7 +1860,7 @@ audio_open(dev_t dev, struct audio_softc
 		goto bad1;
 	}
 
-	fullduplex = (audio_get_props(sc) & AUDIO_PROP_FULLDUPLEX);
+	fullduplex = (sc->sc_props & AUDIO_PROP_FULLDUPLEX);
 
 	/*
 	 * On half duplex hardware,
@@ -2652,16 +2653,14 @@ audio_ioctl(dev_t dev, struct audio_soft
 		 * it is full duplex.  Otherwise half duplex.
 		 */
 		mutex_enter(sc->sc_lock);
-		fd = (audio_get_props(sc) & AUDIO_PROP_FULLDUPLEX)
+		fd = (sc->sc_props & AUDIO_PROP_FULLDUPLEX)
 		&& (sc->sc_pmixer && sc->sc_rmixer);
 		mutex_exit(sc->sc_lock);
 		*(int *)addr = fd;
 		break;
 
 	case AUDIO_GETPROPS:
-		mutex_enter(sc->sc_lock);
-		*(int *)addr = audio_get_props(sc);
-		mutex_exit(sc->sc_lock);
+		*(int *)addr = sc->sc_props;
 		break;
 
 	case AUDIO_QUERYFORMAT:
@@ -6296,7 +6295,6 @@ audio_mixers_set_format(struct audio_sof
 	audio_filter_reg_t pfil;
 	audio_filter_reg_t rfil;
 	int mode;
-	int props;
 	int error;
 
 	KASSERT(mutex_owned(sc->sc_lock));
@@ -6329,8 +6327,7 @@ audio_mixers_set_format(struct audio_sof
 	}
 
 	/* On non-independent devices, use the same format for both. */
-	props = audio_get_props(sc);
-	if ((props & AUDIO_PROP_INDEPENDENT) == 0) {
+	if ((sc->sc_props & AUDIO_PROP_INDEPENDENT) == 0) {
 		if (mode == AUMODE_RECORD) {
 			phwfmt = rhwfmt;
 		} else {
@@ -6340,9 +6337,9 @@ audio_mixers_set_format(struct audio_sof
 	}
 
 	/* Then, unset the direction not exist on the hardware. */
-	if ((props & AUDIO_PROP_PLAYBACK) == 0)
+	if ((sc->sc_props & AUDIO_PROP_PLAYBACK) == 0)
 		mode &= ~AUMODE_PLAY;
-	if ((props & AUDIO_PROP_CAPTURE) == 0)
+	if ((sc->sc_props & AUDIO_PROP_CAPTURE) == 0)
 		mode &= ~AUMODE_RECORD;
 
 	/* debug */
@@ -7162,26 +7159,6 @@ audiogetinfo(struct audio_softc *sc, str
 }
 
 /*
- * Must be called with sc_lock held.
- */
-static int
-audio_get_props(struct audio_softc *sc)
-{
-	const struct audio_hw_if *hw;
-	int props;
-
-	KASSERT(mutex_owned(sc->sc_lock));
-
-	hw = sc->hw_if;
-	props = hw->get_props(sc->hw_hdl);
-
-	/* MMAP is now supported by upper layer.  */
-	props |= AUDIO_PROP_MMAP;
-
-	return props;
-}
-
-/*
  * Return true if playback is configured.
  * This function can be used after audioattach.
  */


CVS commit: src/sys/dev/audio

2019-06-10 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Mon Jun 10 13:12:51 UTC 2019

Modified Files:
src/sys/dev/audio: audio.c audiovar.h

Log Message:
Call get_props() once at attach.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/audio/audio.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/audio/audiovar.h

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



CVS commit: src/distrib/sets/lists/comp

2019-06-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jun 10 10:28:41 UTC 2019

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
it's html not himl.  should fix build.


To generate a diff of this commit:
cvs rdiff -u -r1.2276 -r1.2277 src/distrib/sets/lists/comp/mi

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



CVS commit: src/distrib/sets/lists/comp

2019-06-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jun 10 10:28:41 UTC 2019

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
it's html not himl.  should fix build.


To generate a diff of this commit:
cvs rdiff -u -r1.2276 -r1.2277 src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2276 src/distrib/sets/lists/comp/mi:1.2277
--- src/distrib/sets/lists/comp/mi:1.2276	Sun Jun  9 18:42:43 2019
+++ src/distrib/sets/lists/comp/mi	Mon Jun 10 10:28:41 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2276 2019/06/09 18:42:43 christos Exp $
+#	$NetBSD: mi,v 1.2277 2019/06/10 10:28:41 mrg Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -13148,7 +13148,7 @@
 ./usr/share/man/html3/SQLITE_VERSION.html	comp-c-htmlman		html
 ./usr/share/man/html3/SQLITE_VTAB_CONSTRAINT_SUPPORT.html	comp-c-htmlman		html
 ./usr/share/man/html3/SQLITE_WIN32_DATA_DIRECTORY_TYPE.html   comp-c-htmlman  html
-./usr/share/man/html3/SSL_get_peer_tmp_key.html	comp-c-htmlman		himl,openssl=11
+./usr/share/man/html3/SSL_get_peer_tmp_key.html	comp-c-htmlman		html,openssl=11
 ./usr/share/man/html3/SSL_CIPHER_get_name.html	comp-c-htmlman		html
 ./usr/share/man/html3/SSL_COMP_add_compression_method.html	comp-c-htmlman		html
 ./usr/share/man/html3/SSL_CONF_CTX_new.html		comp-c-htmlman	html,openssl=11