Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci round_blocksize must return a multiple of the fr...
details: https://anonhg.NetBSD.org/src/rev/dcbda990892f
branches: trunk
changeset: 969725:dcbda990892f
user: isaki <isaki%NetBSD.org@localhost>
date: Sat Feb 29 06:25:33 2020 +0000
description:
round_blocksize must return a multiple of the framesize.
It's not divisible when blk=GCSCAUDI_PRD_SIZE_MAX and channels=4.
diffstat:
sys/dev/pci/gcscaudio.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diffs (30 lines):
diff -r 51e7a930b021 -r dcbda990892f sys/dev/pci/gcscaudio.c
--- a/sys/dev/pci/gcscaudio.c Sat Feb 29 06:06:29 2020 +0000
+++ b/sys/dev/pci/gcscaudio.c Sat Feb 29 06:25:33 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gcscaudio.c,v 1.18 2019/06/08 08:02:38 isaki Exp $ */
+/* $NetBSD: gcscaudio.c,v 1.19 2020/02/29 06:25:33 isaki Exp $ */
/*-
* Copyright (c) 2008 SHIMIZU Ryo <ryo%nerv.org@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gcscaudio.c,v 1.18 2019/06/08 08:02:38 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gcscaudio.c,v 1.19 2020/02/29 06:25:33 isaki Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -549,9 +549,10 @@
gcscaudio_round_blocksize(void *arg, int blk, int mode,
const audio_params_t *param)
{
- blk &= -4;
+
if (blk > GCSCAUDIO_PRD_SIZE_MAX)
blk = GCSCAUDIO_PRD_SIZE_MAX;
+ blk = rounddown(blk, param->channels * param->precision / NBBY);
return blk;
}
Home |
Main Index |
Thread Index |
Old Index