Commit ff0159c3 authored by David Staessens's avatar David Staessens Committed by Commit Bot

media/gpu/V4L2: Fix bug causing V4L2 device poller to hang.

When we dequeue a buffer on the V4L2 device queue, we will immediately schedule
another poll on the device when there are more buffers left to dequeue. It is
possible however that we're notified of an event while there are no buffers
ready to dequeue. Trying to dequeue a buffer at this time would cause polling to
not be resumed, and we won't be notified when future buffers are ready to be
dequeued.

TEST=./video_encode_accelerator_unittest on hana with CL:1994545

BUG=b:147786740

Change-Id: Ieb2becd246ecbdb632ed930471cbc3fbfcf15e20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2004354
Commit-Queue: David Staessens <dstaessens@chromium.org>
Reviewed-by: default avatarAlexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732701}
parent 89d20c2e
...@@ -1051,7 +1051,9 @@ std::pair<bool, V4L2ReadableBufferRef> V4L2Queue::DequeueBuffer() { ...@@ -1051,7 +1051,9 @@ std::pair<bool, V4L2ReadableBufferRef> V4L2Queue::DequeueBuffer() {
switch (errno) { switch (errno) {
case EAGAIN: case EAGAIN:
case EPIPE: case EPIPE:
// This is not an error but won't provide a buffer either. // This is not an error so we'll need to continue polling but won't
// provide a buffer.
device_->SchedulePoll();
return std::make_pair(true, nullptr); return std::make_pair(true, nullptr);
default: default:
VPQLOGF(1) << "VIDIOC_DQBUF failed"; VPQLOGF(1) << "VIDIOC_DQBUF failed";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment