Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Remove rounding by 4 bytes on round_blocksize().
details: https://anonhg.NetBSD.org/src/rev/a224277ea231
branches: trunk
changeset: 969722:a224277ea231
user: isaki <isaki%NetBSD.org@localhost>
date: Sat Feb 29 05:51:10 2020 +0000
description:
Remove rounding by 4 bytes on round_blocksize().
For drivers which supports only 16bit * 2channels sampling,
rounding by 4 bytes no longer meaningful.
diffstat:
sys/arch/amiga/dev/toccata.c | 11 +++++------
sys/arch/arm/rockchip/rk_i2s.c | 15 ++-------------
sys/arch/arm/sunxi/sunxi_codec.c | 15 ++-------------
sys/arch/arm/sunxi/sunxi_i2s.c | 15 ++-------------
sys/arch/evbarm/mini2440/audio_mini2440.c | 14 --------------
sys/arch/prep/isa/paud_isa.c | 5 ++---
sys/dev/ic/ad1848.c | 13 ++-----------
sys/dev/ic/ad1848var.h | 3 +--
sys/dev/ic/interwave.c | 13 ++-----------
sys/dev/ic/interwavevar.h | 5 +----
sys/dev/ic/pl041.c | 12 ++----------
sys/dev/isa/gus.c | 5 ++---
sys/dev/isa/wss.c | 5 ++---
sys/dev/isa/ym.c | 5 ++---
sys/dev/isapnp/gus_isapnp.c | 5 ++---
sys/dev/pci/autri.c | 13 ++-----------
sys/dev/pci/cmpci.c | 15 ++-------------
sys/dev/pci/yds.c | 6 +++---
18 files changed, 36 insertions(+), 139 deletions(-)
diffs (truncated from 606 to 300 lines):
diff -r d7fe9b5d51a9 -r a224277ea231 sys/arch/amiga/dev/toccata.c
--- a/sys/arch/amiga/dev/toccata.c Sat Feb 29 05:39:03 2020 +0000
+++ b/sys/arch/amiga/dev/toccata.c Sat Feb 29 05:51:10 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: toccata.c,v 1.20 2019/06/08 08:02:36 isaki Exp $ */
+/* $NetBSD: toccata.c,v 1.21 2020/02/29 05:51:10 isaki Exp $ */
/*-
* Copyright (c) 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: toccata.c,v 1.20 2019/06/08 08:02:36 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: toccata.c,v 1.21 2020/02/29 05:51:10 isaki Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -415,11 +415,10 @@
toccata_round_blocksize(void *addr, int blk,
int mode, const audio_params_t *param)
{
- int ret;
- ret = blk > 512 ? 512 : (blk & -4);
-
- return ret;
+ if (blk > 512)
+ blk = 512;
+ return blk;
}
size_t
diff -r d7fe9b5d51a9 -r a224277ea231 sys/arch/arm/rockchip/rk_i2s.c
--- a/sys/arch/arm/rockchip/rk_i2s.c Sat Feb 29 05:39:03 2020 +0000
+++ b/sys/arch/arm/rockchip/rk_i2s.c Sat Feb 29 05:51:10 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_i2s.c,v 1.2 2020/01/04 13:54:04 jmcneill Exp $ */
+/* $NetBSD: rk_i2s.c,v 1.3 2020/02/29 05:51:10 isaki Exp $ */
/*-
* Copyright (c) 2019 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk_i2s.c,v 1.2 2020/01/04 13:54:04 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_i2s.c,v 1.3 2020/02/29 05:51:10 isaki Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -231,16 +231,6 @@
AUDIO_PROP_FULLDUPLEX;
}
-static int
-rk_i2s_round_blocksize(void *priv, int bs, int mode,
- const audio_params_t *params)
-{
- bs &= ~3;
- if (bs == 0)
- bs = 4;
- return bs;
-}
-
static void *
rk_i2s_allocm(void *priv, int dir, size_t size)
{
@@ -360,7 +350,6 @@
.query_format = rk_i2s_query_format,
.set_format = rk_i2s_set_format,
.get_props = rk_i2s_get_props,
- .round_blocksize = rk_i2s_round_blocksize,
.allocm = rk_i2s_allocm,
.freem = rk_i2s_freem,
.trigger_output = rk_i2s_trigger_output,
diff -r d7fe9b5d51a9 -r a224277ea231 sys/arch/arm/sunxi/sunxi_codec.c
--- a/sys/arch/arm/sunxi/sunxi_codec.c Sat Feb 29 05:39:03 2020 +0000
+++ b/sys/arch/arm/sunxi/sunxi_codec.c Sat Feb 29 05:51:10 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_codec.c,v 1.7 2019/06/08 08:02:37 isaki Exp $ */
+/* $NetBSD: sunxi_codec.c,v 1.8 2020/02/29 05:51:10 isaki Exp $ */
/*-
* Copyright (c) 2014-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
#include "opt_ddb.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_codec.c,v 1.7 2019/06/08 08:02:37 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_codec.c,v 1.8 2020/02/29 05:51:10 isaki Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -261,16 +261,6 @@
}
static int
-sunxi_codec_round_blocksize(void *priv, int bs, int mode,
- const audio_params_t *params)
-{
- bs &= ~3;
- if (bs == 0)
- bs = 4;
- return bs;
-}
-
-static int
sunxi_codec_trigger_output(void *priv, void *start, void *end, int blksize,
void (*intr)(void *), void *intrarg, const audio_params_t *params)
{
@@ -475,7 +465,6 @@
.get_port = sunxi_codec_get_port,
.query_devinfo = sunxi_codec_query_devinfo,
.get_props = sunxi_codec_get_props,
- .round_blocksize = sunxi_codec_round_blocksize,
.trigger_output = sunxi_codec_trigger_output,
.trigger_input = sunxi_codec_trigger_input,
.halt_output = sunxi_codec_halt_output,
diff -r d7fe9b5d51a9 -r a224277ea231 sys/arch/arm/sunxi/sunxi_i2s.c
--- a/sys/arch/arm/sunxi/sunxi_i2s.c Sat Feb 29 05:39:03 2020 +0000
+++ b/sys/arch/arm/sunxi/sunxi_i2s.c Sat Feb 29 05:51:10 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_i2s.c,v 1.7 2019/11/17 17:33:34 jmcneill Exp $ */
+/* $NetBSD: sunxi_i2s.c,v 1.8 2020/02/29 05:51:10 isaki Exp $ */
/*-
* Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_i2s.c,v 1.7 2019/11/17 17:33:34 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_i2s.c,v 1.8 2020/02/29 05:51:10 isaki Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -390,16 +390,6 @@
}
static int
-sunxi_i2s_round_blocksize(void *priv, int bs, int mode,
- const audio_params_t *params)
-{
- bs &= ~3;
- if (bs == 0)
- bs = 4;
- return bs;
-}
-
-static int
sunxi_i2s_trigger_output(void *priv, void *start, void *end, int blksize,
void (*intr)(void *), void *intrarg, const audio_params_t *params)
{
@@ -587,7 +577,6 @@
.allocm = sunxi_i2s_allocm,
.freem = sunxi_i2s_freem,
.get_props = sunxi_i2s_get_props,
- .round_blocksize = sunxi_i2s_round_blocksize,
.trigger_output = sunxi_i2s_trigger_output,
.trigger_input = sunxi_i2s_trigger_input,
.halt_output = sunxi_i2s_halt_output,
diff -r d7fe9b5d51a9 -r a224277ea231 sys/arch/evbarm/mini2440/audio_mini2440.c
--- a/sys/arch/evbarm/mini2440/audio_mini2440.c Sat Feb 29 05:39:03 2020 +0000
+++ b/sys/arch/evbarm/mini2440/audio_mini2440.c Sat Feb 29 05:51:10 2020 +0000
@@ -74,7 +74,6 @@
int uda_ssio_set_format(void *, int,
const audio_params_t *, const audio_params_t *,
audio_filter_reg_t *, audio_filter_reg_t *);
-int uda_ssio_round_blocksize(void *, int, int, const audio_params_t *);
int uda_ssio_start_output(void *, void *, int, void (*)(void *),
void *);
int uda_ssio_start_input(void *, void *, int, void (*)(void *),
@@ -93,7 +92,6 @@
.close = uda_ssio_close,
.query_format = uda_ssio_query_format,
.set_format = uda_ssio_set_format,
- .round_blocksize = uda_ssio_round_blocksize,
.start_output = uda_ssio_start_output,
.start_input = uda_ssio_start_input,
.halt_output = uda_ssio_halt_output,
@@ -301,18 +299,6 @@
}
int
-uda_ssio_round_blocksize(void *handle, int bs, int mode,
- const audio_params_t *param)
-{
- int out_bs;
- DPRINTF(("%s: %d\n", __func__, bs));
-
- out_bs = (bs + 0x03) & ~0x03;
- DPRINTF(("%s: out_bs: %d\n", __func__, out_bs));
- return out_bs;
-}
-
-int
uda_ssio_start_output(void *handle, void *block, int bsize,
void (*intr)(void *), void *intrarg)
{
diff -r d7fe9b5d51a9 -r a224277ea231 sys/arch/prep/isa/paud_isa.c
--- a/sys/arch/prep/isa/paud_isa.c Sat Feb 29 05:39:03 2020 +0000
+++ b/sys/arch/prep/isa/paud_isa.c Sat Feb 29 05:51:10 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: paud_isa.c,v 1.18 2019/05/08 13:40:16 isaki Exp $ */
+/* $NetBSD: paud_isa.c,v 1.19 2020/02/29 05:51:11 isaki Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: paud_isa.c,v 1.18 2019/05/08 13:40:16 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: paud_isa.c,v 1.19 2020/02/29 05:51:11 isaki Exp $");
#include "audio.h"
#if NAUDIO > 0
@@ -98,7 +98,6 @@
.close = ad1848_isa_close,
.query_format = ad1848_query_format,
.set_format = ad1848_set_format,
- .round_blocksize = ad1848_round_blocksize,
.commit_settings = ad1848_commit_settings,
.halt_output = ad1848_isa_halt_output,
.halt_input = ad1848_isa_halt_input,
diff -r d7fe9b5d51a9 -r a224277ea231 sys/dev/ic/ad1848.c
--- a/sys/dev/ic/ad1848.c Sat Feb 29 05:39:03 2020 +0000
+++ b/sys/dev/ic/ad1848.c Sat Feb 29 05:51:10 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ad1848.c,v 1.32 2019/05/08 13:40:18 isaki Exp $ */
+/* $NetBSD: ad1848.c,v 1.33 2020/02/29 05:51:11 isaki Exp $ */
/*-
* Copyright (c) 1999, 2008 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ad1848.c,v 1.32 2019/05/08 13:40:18 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ad1848.c,v 1.33 2020/02/29 05:51:11 isaki Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -863,15 +863,6 @@
}
int
-ad1848_round_blocksize(void *addr, int blk,
- int mode, const audio_params_t *param)
-{
-
- /* Round to a multiple of the biggest sample size. */
- return blk &= -4;
-}
-
-int
ad1848_open(void *addr, int flags)
{
struct ad1848_softc *sc;
diff -r d7fe9b5d51a9 -r a224277ea231 sys/dev/ic/ad1848var.h
--- a/sys/dev/ic/ad1848var.h Sat Feb 29 05:39:03 2020 +0000
+++ b/sys/dev/ic/ad1848var.h Sat Feb 29 05:51:10 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ad1848var.h,v 1.19 2019/05/08 13:40:18 isaki Exp $ */
+/* $NetBSD: ad1848var.h,v 1.20 2020/02/29 05:51:11 isaki Exp $ */
/*-
* Copyright (c) 1999, 2008 The NetBSD Foundation, Inc.
@@ -176,7 +176,6 @@
int ad1848_set_format(void *, int,
const audio_params_t *, const audio_params_t *,
audio_filter_reg_t *, audio_filter_reg_t *);
-int ad1848_round_blocksize(void *, int, int, const audio_params_t *);
int ad1848_commit_settings(void *);
int ad1848_set_rec_port(struct ad1848_softc *, int);
int ad1848_get_rec_port(struct ad1848_softc *);
diff -r d7fe9b5d51a9 -r a224277ea231 sys/dev/ic/interwave.c
--- a/sys/dev/ic/interwave.c Sat Feb 29 05:39:03 2020 +0000
+++ b/sys/dev/ic/interwave.c Sat Feb 29 05:51:10 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: interwave.c,v 1.42 2019/06/08 08:02:38 isaki Exp $ */
+/* $NetBSD: interwave.c,v 1.43 2020/02/29 05:51:11 isaki Exp $ */
/*
* Copyright (c) 1997, 1999, 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: interwave.c,v 1.42 2019/06/08 08:02:38 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interwave.c,v 1.43 2020/02/29 05:51:11 isaki Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -698,15 +698,6 @@
return 0;
}
-int
Home |
Main Index |
Thread Index |
Old Index