• Hans Verkuil's avatar
    [media] videobuf2-core: fix plane_sizes handling in VIDIOC_CREATE_BUFS · 58e1ba3c
    Hans Verkuil authored
    The handling of q->plane_sizes was wrong in vb2_core_create_bufs().
    The q->plane_sizes array was global and it was overwritten by create_bufs.
    So if reqbufs was called with e.g. size 100000 then q->plane_sizes[0] would
    be set to 100000. If create_bufs was called afterwards with size 200000,
    then q->plane_sizes[0] would be overwritten with the new value. Calling
    create_bufs again for size 100000 would cause an error since 100000 is now
    less than q->plane_sizes[0].
    
    This patch fixes this problem by 1) removing q->plane_sizes and using the
    vb->planes[].length field instead, and 2) by introducing a min_length field
    in struct vb2_plane. This field is set to the plane size as returned by
    the queue_setup op and is the minimum required plane size. So user pointers
    or dmabufs should all be at least this size.
    Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
    Reported-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
    58e1ba3c
Name
Last commit
Last update
..
blackfin Loading commit data...
davinci Loading commit data...
drv-intf Loading commit data...
i2c Loading commit data...
i2c-addr.h Loading commit data...
lirc.h Loading commit data...
lirc_dev.h Loading commit data...
media-device.h Loading commit data...
media-devnode.h Loading commit data...
media-entity.h Loading commit data...
rc-core.h Loading commit data...
rc-map.h Loading commit data...
soc_camera.h Loading commit data...
tuner-types.h Loading commit data...
tuner.h Loading commit data...
tveeprom.h Loading commit data...
v4l2-async.h Loading commit data...
v4l2-clk.h Loading commit data...
v4l2-common.h Loading commit data...
v4l2-ctrls.h Loading commit data...
v4l2-dev.h Loading commit data...
v4l2-device.h Loading commit data...
v4l2-dv-timings.h Loading commit data...
v4l2-event.h Loading commit data...
v4l2-fh.h Loading commit data...
v4l2-flash-led-class.h Loading commit data...
v4l2-image-sizes.h Loading commit data...
v4l2-ioctl.h Loading commit data...
v4l2-mediabus.h Loading commit data...
v4l2-mem2mem.h Loading commit data...
v4l2-of.h Loading commit data...
v4l2-subdev.h Loading commit data...
videobuf-core.h Loading commit data...
videobuf-dma-contig.h Loading commit data...
videobuf-dma-sg.h Loading commit data...
videobuf-dvb.h Loading commit data...
videobuf-vmalloc.h Loading commit data...
videobuf2-core.h Loading commit data...
videobuf2-dma-contig.h Loading commit data...
videobuf2-dma-sg.h Loading commit data...
videobuf2-dvb.h Loading commit data...
videobuf2-memops.h Loading commit data...
videobuf2-v4l2.h Loading commit data...
videobuf2-vmalloc.h Loading commit data...