Module Name: src
Committed By: jmcneill
Date: Sun Aug 15 16:21:46 UTC 2010
Modified Files:
src/sys/dev/pci/hdaudio: hdaudio_afg.c
Log Message:
properly round block and buffer sizes -- nvidia HDA controllers work now
To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/hdaudio/hdaudio_afg.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/pci/hdaudio/hdaudio_afg.c
diff -u src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.22 src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.23
--- src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.22 Tue Aug 10 13:47:38 2010
+++ src/sys/dev/pci/hdaudio/hdaudio_afg.c Sun Aug 15 16:21:46 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio_afg.c,v 1.22 2010/08/10 13:47:38 joerg Exp $ */
+/* $NetBSD: hdaudio_afg.c,v 1.23 2010/08/15 16:21:46 jmcneill Exp $ */
/*
* Copyright (c) 2009 Precedence Technologies Ltd <[email protected]>
@@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdaudio_afg.c,v 1.22 2010/08/10 13:47:38 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio_afg.c,v 1.23 2010/08/15 16:21:46 jmcneill Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -3350,7 +3350,7 @@
}
/* Multiple of 128 */
- blksize &= ~128;
+ blksize &= ~127;
if (blksize <= 0)
blksize = 128;
@@ -3358,7 +3358,7 @@
if (bufsize > HDAUDIO_BDL_MAX * blksize) {
blksize = bufsize / HDAUDIO_BDL_MAX;
if (blksize & 128)
- blksize = (blksize + 128) & ~128;
+ blksize = (blksize + 128) & ~127;
}
return blksize;
@@ -3572,7 +3572,7 @@
hdaudio_afg_round_buffersize(void *opaque, int direction, size_t bufsize)
{
/* Multiple of 128 */
- bufsize &= ~128;
+ bufsize &= ~127;
if (bufsize <= 0)
bufsize = 128;
return bufsize;