Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys/dev Pull up following revision(s) (requested by nat i...
details: https://anonhg.NetBSD.org/src/rev/a35cb25d0c3a
branches: netbsd-8
changeset: 434167:a35cb25d0c3a
user: snj <snj%NetBSD.org@localhost>
date: Tue Aug 01 23:21:30 2017 +0000
description:
Pull up following revision(s) (requested by nat in ticket #165):
sys/dev/auconv.c: revision 1.29
sys/dev/auconv.h: revision 1.19
sys/dev/ic/am7930.c: revision 1.56
Add a null_filter to help with the audio autoconfig of pmax.
Tested by flxd@.
diffstat:
sys/dev/auconv.c | 22 ++++++++++++++++++++--
sys/dev/auconv.h | 3 ++-
sys/dev/ic/am7930.c | 11 +++++++++--
3 files changed, 31 insertions(+), 5 deletions(-)
diffs (116 lines):
diff -r 436aef378e8a -r a35cb25d0c3a sys/dev/auconv.c
--- a/sys/dev/auconv.c Tue Aug 01 23:18:30 2017 +0000
+++ b/sys/dev/auconv.c Tue Aug 01 23:21:30 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: auconv.c,v 1.26.2.1 2017/06/30 06:38:00 snj Exp $ */
+/* $NetBSD: auconv.c,v 1.26.2.2 2017/08/01 23:21:30 snj Exp $ */
/*
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.26.2.1 2017/06/30 06:38:00 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.26.2.2 2017/08/01 23:21:30 snj Exp $");
#include <sys/types.h>
#include <sys/audioio.h>
@@ -456,6 +456,24 @@
return 0;
}
+DEFINE_FILTER(null_filter)
+{
+ stream_filter_t *this;
+ int m, err;
+
+ this = (stream_filter_t *)self;
+ max_used = (max_used + 1) & ~1; /* round up to even */
+ if ((err = this->prev->fetch_to(sc, this->prev, this->src, max_used)))
+ return err;
+ m = (dst->end - dst->start) & ~1;
+ m = min(m, max_used);
+ FILTER_LOOP_PROLOGUE(this->src, 1, dst, 1, m) {
+ *d = *s;
+ } FILTER_LOOP_EPILOGUE(this->src, dst);
+
+ return 0;
+}
+
DEFINE_FILTER(swap_bytes_change_sign16)
{
stream_filter_t *this;
diff -r 436aef378e8a -r a35cb25d0c3a sys/dev/auconv.h
--- a/sys/dev/auconv.h Tue Aug 01 23:18:30 2017 +0000
+++ b/sys/dev/auconv.h Tue Aug 01 23:21:30 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: auconv.h,v 1.16.42.1 2017/06/30 06:38:00 snj Exp $ */
+/* $NetBSD: auconv.h,v 1.16.42.2 2017/08/01 23:21:30 snj Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -82,6 +82,7 @@
extern stream_filter_factory_t linear8_8_to_linear24;
extern stream_filter_factory_t linear8_8_to_linear16;
extern stream_filter_factory_t linear8_8_to_linear8;
+extern stream_filter_factory_t null_filter;
#define linear16_to_linear8 linear16_16_to_linear8
#define linear8_to_linear16 linear8_8_to_linear16
diff -r 436aef378e8a -r a35cb25d0c3a sys/dev/ic/am7930.c
--- a/sys/dev/ic/am7930.c Tue Aug 01 23:18:30 2017 +0000
+++ b/sys/dev/ic/am7930.c Tue Aug 01 23:21:30 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: am7930.c,v 1.53.8.1 2017/06/30 06:32:21 snj Exp $ */
+/* $NetBSD: am7930.c,v 1.53.8.2 2017/08/01 23:21:30 snj Exp $ */
/*
* Copyright (c) 1995 Rolf Grossmann
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: am7930.c,v 1.53.8.1 2017/06/30 06:32:21 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: am7930.c,v 1.53.8.2 2017/08/01 23:21:30 snj Exp $");
#include "audio.h"
#if NAUDIO > 0
@@ -137,6 +137,7 @@
#define NGER (sizeof(ger_coeff) / sizeof(ger_coeff[0]))
};
+extern stream_filter_factory_t null_filter;
/*
* Reset chip and set boot-time softc defaults.
@@ -239,11 +240,14 @@
if (sc->sc_glue->output_conv != NULL) {
hw = *p;
hw.encoding = AUDIO_ENCODING_NONE;
+ hw.precision = 8;
+ pfil->append(pfil, null_filter, &hw);
hw.precision *= sc->sc_glue->factor;
pfil->append(pfil, sc->sc_glue->output_conv, &hw);
}
if (p->encoding == AUDIO_ENCODING_SLINEAR) {
hw = *p;
+ hw.precision = 8;
hw.encoding = AUDIO_ENCODING_ULAW;
pfil->append(pfil, linear8_to_mulaw, &hw);
}
@@ -260,11 +264,14 @@
if (sc->sc_glue->input_conv != NULL) {
hw = *r;
hw.encoding = AUDIO_ENCODING_NONE;
+ hw.precision = 8;
+ pfil->append(pfil, null_filter, &hw);
hw.precision *= sc->sc_glue->factor;
pfil->append(rfil, sc->sc_glue->input_conv, &hw);
}
if (r->encoding == AUDIO_ENCODING_SLINEAR) {
hw = *r;
+ hw.precision = 8;
hw.encoding = AUDIO_ENCODING_ULAW;
rfil->append(rfil, mulaw_to_linear8, &hw);
}
Home |
Main Index |
Thread Index |
Old Index