CVS commit: src/sys/dev

2017-05-05 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat May  6 00:13:25 UTC 2017

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

Log Message:
Improved hw draining.  Draining of hw will only complete if silence has
been played in the mix ring.

Must hold sc_intr_lock when gettin used value of mix ring.

Clearing of the next block to be written to of the mix ring has moved into
audio_mix.


To generate a diff of this commit:
cvs rdiff -u -r1.334 -r1.335 src/sys/dev/audio.c
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/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.c
diff -u src/sys/dev/audio.c:1.334 src/sys/dev/audio.c:1.335
--- src/sys/dev/audio.c:1.334	Fri May  5 05:46:49 2017
+++ src/sys/dev/audio.c	Sat May  6 00:13:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.334 2017/05/05 05:46:49 nat Exp $	*/
+/*	$NetBSD: audio.c,v 1.335 2017/05/06 00:13:25 nat Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.334 2017/05/05 05:46:49 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.335 2017/05/06 00:13:25 nat Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -2161,6 +2161,7 @@ audio_open(dev_t dev, struct audio_softc
 		audio_init_ringbuffer(sc, >sc_rr, AUMODE_RECORD);
 		sc->schedule_wih = false;
 		sc->schedule_rih = false;
+		sc->sc_last_drops = 0;
 		sc->sc_eof = 0;
 		vc->sc_rbus = false;
 		sc->sc_async_audio = 0;
@@ -3607,10 +3608,12 @@ audio_pint(void *v)
 	if (sc->sc_dying == true || sc->sc_trigger_started == false)
 		return;
 
-	if (vc->sc_draining == true) {
+	if (vc->sc_draining == true && sc->sc_pr.drops !=
+		sc->sc_last_drops) {
 		vc->sc_mpr.drops += blksize;
 		cv_broadcast(>sc_wchan);
 	}
+	sc->sc_last_drops = sc->sc_pr.drops;
 
 	vc->sc_mpr.s.outp = audio_stream_add_outp(>sc_mpr.s,
 	vc->sc_mpr.s.outp, blksize);
@@ -3646,7 +3649,7 @@ audio_mix(void *v)
 	struct audio_ringbuffer *cb;
 	stream_fetcher_t *fetcher;
 	uint8_t *inp;
-	int cc, used, blksize;
+	int cc, cc1, used, blksize;
 	
 	sc = v;
 
@@ -3809,9 +3812,19 @@ audio_mix(void *v)
 	if (sc->sc_writeme == false) {
 		DPRINTFN(3, ("MIX RING EMPTY - INSERT SILENCE\n"));
 		audio_fill_silence(>sc_mpr.s.param, inp, cc);
+		sc->sc_pr.drops += cc;
 	} else
 		cc = blksize;
 	cb->s.inp = audio_stream_add_inp(>s, cb->s.inp, cc);
+	cc = blksize;
+	cc1 = sc->sc_pr.s.end - sc->sc_pr.s.inp;
+	if (cc1 < cc) {
+		memset(sc->sc_pr.s.inp, 0, cc1);
+		cc -= cc1;
+		memset(sc->sc_pr.s.start, 0, cc);
+	} else
+		memset(sc->sc_pr.s.inp, 0, cc);
+
 	mutex_exit(sc->sc_intr_lock);
 
 	kpreempt_disable();
@@ -5493,15 +5506,6 @@ mix_write(void *arg)
 	vc->sc_pustream->inp = audio_stream_add_inp(vc->sc_pustream,
 	inp, blksize);
 
-	cc = blksize;
-	cc2 = sc->sc_pr.s.end - sc->sc_pr.s.inp;
-	if (cc2 < cc) {
-		memset(sc->sc_pr.s.inp, 0, cc2);
-		cc -= cc2;
-		memset(sc->sc_pr.s.start, 0, cc);
-	} else
-		memset(sc->sc_pr.s.inp, 0, cc);
-
 	sc->sc_pr.s.outp = audio_stream_add_outp(>sc_pr.s,
 	sc->sc_pr.s.outp, blksize);
 
@@ -5819,13 +5823,15 @@ audio_play_thread(void *v)
 			mutex_exit(sc->sc_intr_lock);
 			kthread_exit(0);
 		}
-		mutex_exit(sc->sc_intr_lock);
 
 		while (audio_stream_get_used(>sc_pr.s) < sc->sc_pr.blksize) {
+			mutex_exit(sc->sc_intr_lock);
 			mutex_enter(sc->sc_lock);
 			audio_mix(sc);
 			mutex_exit(sc->sc_lock);
+			mutex_enter(sc->sc_intr_lock);
 		}
+		mutex_exit(sc->sc_intr_lock);
 	}
 }
 

Index: src/sys/dev/audiovar.h
diff -u src/sys/dev/audiovar.h:1.53 src/sys/dev/audiovar.h:1.54
--- src/sys/dev/audiovar.h:1.53	Mon Apr 17 22:40:06 2017
+++ src/sys/dev/audiovar.h	Sat May  6 00:13:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audiovar.h,v 1.53 2017/04/17 22:40:06 nat Exp $	*/
+/*	$NetBSD: audiovar.h,v 1.54 2017/05/06 00:13:25 nat Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -255,6 +255,7 @@ struct audio_softc {
 	 *  userland
 	 */
 	struct audio_ringbuffer	sc_rr;		/* Record ring */
+	ulong		sc_last_drops;		/* Drops from mix ring */
 
 	int		sc_eof;		/* EOF, i.e. zero sized write, counter */
 	struct	au_mixer_ports sc_inports, sc_outports;



CVS commit: src/share/misc

2017-05-05 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Fri May  5 14:23:47 UTC 2017

Modified Files:
src/share/misc: acronyms.comp

Log Message:
add EEE, MII, RGMII, SGMII


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.179 src/share/misc/acronyms.comp:1.180
--- src/share/misc/acronyms.comp:1.179	Fri Mar 24 12:49:43 2017
+++ src/share/misc/acronyms.comp	Fri May  5 14:23:47 2017
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.179 2017/03/24 12:49:43 ginsbach Exp $
+$NetBSD: acronyms.comp,v 1.180 2017/05/05 14:23:47 ginsbach Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -406,6 +406,7 @@ EDGE	explicit data graph execution
 EDID	extended display identification data
 EDO	extended data out
 EDS	electronical data sheet
+EEE	energy efficient ethernet
 EEPROM	electrically erasable programmable read only memory
 EFI	extensible firmware interface
 EFL	emitter follower logic
@@ -756,6 +757,7 @@ MIC	message integrity {check,code}
 MID	mobile Internet device
 MIDI	musical instrument digital interface
 MIF	management information format
+MII	media independent interface
 MIM	man in the middle
 MIMD	multiple instruction, multiple data
 MIME	Multipurpose Internet Mail Extensions
@@ -1064,6 +1066,7 @@ RFI	radio frequency interference
 RFO	request for ownership
 RGB	red green blue
 RGBA	red green blue alpha
+RGMII	reduced gigabit media independent interface
 RH	read hit
 RHEL	Red Hat Enterprise Linux
 RHL	Red Hat Linux
@@ -1160,6 +1163,7 @@ SFI	software fault isolation
 SFTP	SSH File Transfer Protocol
 SFTP	Serial File Transfer Protocol
 SFTP	Simple File Transfer Protocol
+SGMII	serial gigabit media independent interface
 SGRAM	synchronous graphics random access memory
 SHA	secure hash algorithm
 SIDH	supersingular isogeny Diffie-Hellman



CVS commit: src/usr.bin/tic

2017-05-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May  5 12:21:28 UTC 2017

Modified Files:
src/usr.bin/tic: tic.c

Log Message:
fix the tools build. reported by Utkarsh Anand


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/tic/tic.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.bin/tic/tic.c
diff -u src/usr.bin/tic/tic.c:1.29 src/usr.bin/tic/tic.c:1.30
--- src/usr.bin/tic/tic.c:1.29	Thu May  4 10:07:33 2017
+++ src/usr.bin/tic/tic.c	Fri May  5 08:21:28 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tic.c,v 1.29 2017/05/04 14:07:33 roy Exp $ */
+/* $NetBSD: tic.c,v 1.30 2017/05/05 12:21:28 christos Exp $ */
 
 /*
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: tic.c,v 1.29 2017/05/04 14:07:33 roy Exp $");
+__RCSID("$NetBSD: tic.c,v 1.30 2017/05/05 12:21:28 christos Exp $");
 
 #include 
 #include 
@@ -587,7 +587,13 @@ main(int argc, char **argv)
 		free(term->name);
 		free(term);
 	}
+#ifndef HAVE_NBTOOL_CONFIG_H
+	/*
+	 * hdestroy1 is not standard but we don't really care if we
+	 * leak in the tools version
+	 */
 	hdestroy1(free, NULL);
+#endif
 
 	return EXIT_SUCCESS;
 }