summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/pci/fm801.c
diff options
context:
space:
mode:
authorcg <cg@FreeBSD.org>2000-12-23 03:16:13 +0000
committercg <cg@FreeBSD.org>2000-12-23 03:16:13 +0000
commitd0b795f25b705ff883368ba3e49f31c3541d3b11 (patch)
tree076eb63fe5bbf4764062f83df117a0ee11cfc3ed /sys/dev/sound/pci/fm801.c
parent818087b543b4be6d1211cb39cb7b7204e9ae9f6c (diff)
downloadFreeBSD-src-d0b795f25b705ff883368ba3e49f31c3541d3b11.zip
FreeBSD-src-d0b795f25b705ff883368ba3e49f31c3541d3b11.tar.gz
update code dealing with snd_dbuf objects to do so using a functional interface
modify chn_setblocksize() to pick a default soft-blocksize appropriate to the sample rate and format in use. it will aim for a power of two size small enough to generate block sizes of at most 20ms. it will also set the hard-blocksize taking into account rate/format conversions in use. update drivers to implement setblocksize correctly: updated, tested: sb16, emu10k1, maestro, solo updated, untested: ad1816, ess, mss, sb8, csa not updated: ds1, es137x, fm801, neomagic, t4dwave, via82c686 i lack hardware to test: ad1816, csa, fm801, neomagic others will be updated/tested in the next few days.
Diffstat (limited to 'sys/dev/sound/pci/fm801.c')
-rw-r--r--sys/dev/sound/pci/fm801.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/sound/pci/fm801.c b/sys/dev/sound/pci/fm801.c
index a01ea8e..33b9915 100644
--- a/sys/dev/sound/pci/fm801.c
+++ b/sys/dev/sound/pci/fm801.c
@@ -331,9 +331,8 @@ fm801ch_init(kobj_t obj, void *devinfo, snd_dbuf *b, pcm_channel *c, int dir)
ch->parent = fm801;
ch->channel = c;
ch->buffer = b;
- ch->buffer->bufsize = FM801_BUFFSIZE;
ch->dir = dir;
- if( chn_allocbuf(ch->buffer, fm801->parent_dmat) == -1) return NULL;
+ if (sndbuf_alloc(ch->buffer, fm801->parent_dmat, FM801_BUFFSIZE) == -1) return NULL;
return (void *)ch;
}
@@ -435,7 +434,7 @@ fm801ch_trigger(kobj_t obj, void *data, int go)
{
struct fm801_chinfo *ch = data;
struct fm801_info *fm801 = ch->parent;
- u_int32_t baseaddr = vtophys(ch->buffer->buf);
+ u_int32_t baseaddr = vtophys(sndbuf_getbuf(ch->buffer));
snd_dbuf *b = ch->buffer;
u_int32_t k1;
OpenPOWER on IntegriCloud