Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171354078
D57833.id180647.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D57833.id180647.diff
View Options
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -3003,6 +3003,7 @@
dsp_kqevent(struct knote *kn, long hint)
{
struct pcm_channel *ch = kn->kn_hook;
+ int fire;
CHN_LOCKASSERT(ch);
if (ch->flags & CHN_F_DEAD) {
@@ -3010,7 +3011,11 @@
return (1);
}
kn->kn_data = 0;
- if (chn_polltrigger(ch)) {
+ if (ch->flags & CHN_F_MMAP)
+ fire = (ch->bufsoft->total - (u_int64_t)kn->kn_sdata) >= ch->lw;
+ else
+ fire = chn_polltrigger(ch);
+ if (fire) {
if (kn->kn_filter == EVFILT_READ) {
kn->kn_data = sndbuf_getready(ch->bufsoft);
if (ch->flags & CHN_F_MMAP)
@@ -3025,6 +3030,7 @@
kn->kn_kevent.ext[0] = sndbuf_getready(ch->bufsoft) / ch->bufsoft->align;
}
kn->kn_kevent.ext[1] = ch->xruns;
+ kn->kn_sdata = ch->bufsoft->total;
}
return (kn->kn_data > 0);
@@ -3070,6 +3076,7 @@
knlist_add(&ch->bufsoft->sel.si_note, kn, 1);
CHN_UNLOCK(ch);
kn->kn_hook = ch;
+ kn->kn_sdata = ch->bufsoft->prev_total;
} else
err = EINVAL;
PCM_GIANT_LEAVE(d);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Sep 11, 3:26 PM (17 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34369778
Default Alt Text
D57833.id180647.diff (1 KB)
Attached To
Mode
D57833: sound: track kqueue low watermark per-knote for mmaped channels
Attached
Detach File
Event Timeline
Log In to Comment