linux/drivers/media
Hans Verkuil 4e5a4d8a8e [media] vb2: fix read/write regression
Commit 88e268702b ("vb2: Improve file I/O
emulation to handle buffers in any order") broke read/write support if
the size of the buffer being read/written is less than the size of the
image.

When the commit was tested originally I used qv4l2, which calls read()
with exactly the size of the image. But if you try 'cat /dev/video0'
then it will fail and typically hang after reading two buffers.

This patch fixes the behavior by adding a new cur_index field that
contains the index of the field currently being filled/read, or it
is num_buffers in which case a new buffer needs to be dequeued.

The old index field has been renamed to initial_index in order to be
a bit more descriptive.

This has been tested with both read and write.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11 06:56:36 -03:00
..
common [media, edac] Change my email address 2014-02-07 08:03:07 -02:00
dvb-core [media] dvb_frontend: better handle lna set errors 2014-03-04 14:19:34 -03:00
dvb-frontends Linux 3.14-rc5 2014-03-11 06:55:49 -03:00
firewire firewire: introduce fw_driver.probe and .remove methods 2013-06-09 18:15:00 +02:00
i2c Linux 3.14-rc5 2014-03-11 06:55:49 -03:00
mmc [media] siano: get rid of CammelCase from smscoreapi.h 2013-03-21 10:03:16 -03:00
parport [media] v4l: Rename vb2_queue.timestamp_type as timestamp_flags 2014-03-05 16:34:14 -03:00
pci Linux 3.14-rc5 2014-03-11 06:55:49 -03:00
platform Linux 3.14-rc5 2014-03-11 06:55:49 -03:00
radio [media] radio-cadet: avoid interruptible_sleep_on race 2014-02-28 14:30:30 -03:00
rc [media, edac] Change my email address 2014-02-07 08:03:07 -02:00
tuners [media] xc2028: silence compiler warnings 2014-03-05 15:35:25 -03:00
usb Linux 3.14-rc5 2014-03-11 06:55:49 -03:00
v4l2-core [media] vb2: fix read/write regression 2014-03-11 06:56:36 -03:00
Kconfig [media] subdev autoselect only works if I2C and I2C_MUX is selected 2013-12-21 06:03:06 -02:00
Makefile [media] move i2c files into drivers/media/i2c 2012-09-06 18:42:54 -03:00
media-device.c [media] media: info leak in __media_device_enum_links() 2013-06-12 18:52:45 -03:00
media-devnode.c [media] media: Add 64--32 bit compat ioctl handler 2013-03-18 20:44:36 -03:00
media-entity.c [media] media: Check for active links on pads with MEDIA_PAD_FL_MUST_CONNECT flag 2013-12-04 15:03:45 -02:00