diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2007-07-17 18:29:43 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-07-30 16:26:24 -0300 |
commit | e42af83f4874ebb2c6af59a05dbe5d45114fb0ed (patch) | |
tree | 7659c0d8dfc1851594ed133bce3ed1368b7ab8ea /drivers/net/dgrs_ether.h | |
parent | c812b67ca4ed13fa5ec60f06c4ed8f648722a186 (diff) |
V4L/DVB (5887): zr36067: Fix poll() operation
During uncompressed capture, the poll() function was looking the wrong frame.
It was using the frame the driver was going to capture into next (pend_tail),
when it should have been looking at the next frame to be de-queued with
DQBUF/SYNC (sync_tail).
It also wasn't looking in the right spot. It was looking at the file handle's
copy of the buffer status, rather than the driver core copy. The interrupt
routine marks frames as done in the driver core copy, the file handle copy
isn't updated. So even if poll() looked at the right frame, it would never
see it transition to done and return POLLIN.
The compressed capture code has this same problem, looking in fh->jpg_buffers
when it should have used zr->jpg_buffers.
There was some logic to detect when there was no current capture in process
nor any frames queued and try to return an error, which ends up being a bad
idea. It's possible to call select() from one thread while no capture is in
process, or no frames queued, and then start a capture or queue frames from
another thread.
The buffer state variables are protected by a spin lock, which the code wasn't
acquiring. That is fixed too.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Acked-by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/net/dgrs_ether.h')
0 files changed, 0 insertions, 0 deletions