Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] videobuf2: don't return POLLERR when only polling for events

If you only poll for events, then vb2_poll will return POLLPRI | POLLERR if
no streaming is in progress. That's not right, it's perfectly valid to
poll just for events.

Cc: Pawel Osciak <pawel@osciak.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
cd13823f 971dfc67

+5
+5
drivers/media/v4l2-core/videobuf2-core.c
··· 1965 1965 poll_wait(file, &fh->wait, wait); 1966 1966 } 1967 1967 1968 + if (!V4L2_TYPE_IS_OUTPUT(q->type) && !(req_events & (POLLIN | POLLRDNORM))) 1969 + return res; 1970 + if (V4L2_TYPE_IS_OUTPUT(q->type) && !(req_events & (POLLOUT | POLLWRNORM))) 1971 + return res; 1972 + 1968 1973 /* 1969 1974 * Start file I/O emulator only if streaming API has not been used yet. 1970 1975 */