27 Aug, 2017

1 commit

  • This change is intended to give to the v4l2 drivers a choice to
    change the default behavior of the v4l2-core DMA mapping direction
    from DMA_TO/FROM_DEVICE (depending on the buffer type CAPTURE or
    OUTPUT) to DMA_BIDIRECTIONAL during queue_init time.

    Initially the issue with DMA mapping direction has been found in
    Venus encoder driver where the hardware (firmware side) adds few
    lines padding on bottom of the image buffer, and the consequence
    is triggering of IOMMU protection faults.

    This will help supporting venus encoder (and probably other drivers
    in the future) which wants to map output type of buffers as
    read/write.

    Signed-off-by: Stanimir Varbanov
    Acked-by: Marek Szyprowski
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Stanimir Varbanov
     

06 Apr, 2017

1 commit


22 Sep, 2016

1 commit

  • As warned by linuxdoc[1] tool, using:

    $ for i in $(git grep kernel-doc Documentation/media/kapi/|cut -d: -f4); do kernel-lintdoc --sloppy $i; done

    include/media/v4l2-dev.h:118 :WARN: function name from comment differs: v4l2_prio_close v4l2_prio_check
    include/media/v4l2-mc.h:56 [kernel-doc WARN] : enum name from comment differs: if_vid_dec_index if_vid_dec_pad_index
    include/media/v4l2-mc.h:71 [kernel-doc WARN] : enum name from comment differs: if_aud_dec_index if_aud_dec_pad_index
    include/media/v4l2-mem2mem.h:396 [kernel-doc WARN] : function name from comment differs: v4l2_m2m_num_src_bufs_ready v4l2_m2m_num_dst_bufs_ready
    drivers/media/dvb-core/dvb_math.h:28 [kernel-doc WARN] : function name from comment differs: cintlog2 intlog2
    include/media/v4l2-subdev.h:215 [kernel-doc WARN] : struct name from comment differs: s_radio v4l2_subdev_tuner_ops
    include/media/v4l2-subdev.h:890 [kernel-doc WARN] : function name from comment differs: v4l2_set_subdevdata v4l2_set_subdev_hostdata
    include/media/v4l2-subdev.h:901 [kernel-doc WARN] : function name from comment differs: v4l2_get_subdevdata v4l2_get_subdev_hostdata
    drivers/media/dvb-core/dvb_ringbuffer.h:196 [kernel-doc WARN] : function name from comment differs: dvb_ringbuffer_writeuser dvb_ringbuffer_write_user
    include/media/videobuf2-core.h:399 [kernel-doc WARN] : struct name from comment differs: vb2_ops vb2_buf_ops
    include/media/media-entity.h:132 [kernel-doc ERROR] : duplicate parameter definition 'source'
    include/media/media-entity.h:477 [kernel-doc WARN] : function name from comment differs: media_entity_enum_test media_entity_enum_test_and_set
    include/media/media-entity.h:535 [kernel-doc WARN] : function name from comment differs: gobj_to_entity gobj_to_pad
    include/media/media-entity.h:544 [kernel-doc WARN] : function name from comment differs: gobj_to_entity gobj_to_link
    include/media/media-entity.h:553 [kernel-doc WARN] : function name from comment differs: gobj_to_entity gobj_to_intf
    include/media/media-entity.h:562 [kernel-doc WARN] : function name from comment differs: gobj_to_entity intf_to_devnode
    include/media/rc-core.h:234 [kernel-doc WARN] : function name from comment differs: rc_open rc_close
    include/media/v4l2-ctrls.h:397 [kernel-doc WARN] : missing initial short description of 'v4l2_ctrl_handler_init'
    include/media/v4l2-dev.h:118 [kernel-doc WARN] : function name from comment differs: v4l2_prio_close v4l2_prio_check
    include/media/v4l2-event.h:225 [kernel-doc WARN] : missing initial short description of 'v4l2_src_change_event_subscribe'

    [1] https://return42.github.io/linuxdoc/linux.html

    The above are real issues at the documentation. On several cases,
    caused by cut-and-paste.

    Fix them.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

09 Sep, 2016

3 commits


24 Aug, 2016

1 commit


04 Aug, 2016

1 commit

  • The dma-mapping core and the implementations do not change the DMA
    attributes passed by pointer. Thus the pointer can point to const data.
    However the attributes do not have to be a bitfield. Instead unsigned
    long will do fine:

    1. This is just simpler. Both in terms of reading the code and setting
    attributes. Instead of initializing local attributes on the stack
    and passing pointer to it to dma_set_attr(), just set the bits.

    2. It brings safeness and checking for const correctness because the
    attributes are passed by value.

    Semantic patches for this change (at least most of them):

    virtual patch
    virtual context

    @r@
    identifier f, attrs;

    @@
    f(...,
    - struct dma_attrs *attrs
    + unsigned long attrs
    , ...)
    {
    ...
    }

    @@
    identifier r.f;
    @@
    f(...,
    - NULL
    + 0
    )

    and

    // Options: --all-includes
    virtual patch
    virtual context

    @r@
    identifier f, attrs;
    type t;

    @@
    t f(..., struct dma_attrs *attrs);

    @@
    identifier r.f;
    @@
    f(...,
    - NULL
    + 0
    )

    Link: http://lkml.kernel.org/r/1468399300-5399-2-git-send-email-k.kozlowski@samsung.com
    Signed-off-by: Krzysztof Kozlowski
    Acked-by: Vineet Gupta
    Acked-by: Robin Murphy
    Acked-by: Hans-Christian Noren Egtvedt
    Acked-by: Mark Salter [c6x]
    Acked-by: Jesper Nilsson [cris]
    Acked-by: Daniel Vetter [drm]
    Reviewed-by: Bart Van Assche
    Acked-by: Joerg Roedel [iommu]
    Acked-by: Fabien Dessenne [bdisp]
    Reviewed-by: Marek Szyprowski [vb2-core]
    Acked-by: David Vrabel [xen]
    Acked-by: Konrad Rzeszutek Wilk [xen swiotlb]
    Acked-by: Joerg Roedel [iommu]
    Acked-by: Richard Kuo [hexagon]
    Acked-by: Geert Uytterhoeven [m68k]
    Acked-by: Gerald Schaefer [s390]
    Acked-by: Bjorn Andersson
    Acked-by: Hans-Christian Noren Egtvedt [avr32]
    Acked-by: Vineet Gupta [arc]
    Acked-by: Robin Murphy [arm64 and dma-iommu]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Kozlowski
     

23 Jul, 2016

2 commits

  • Some extra escape codes are needed to avoid Sphinx to not
    identify the tags.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • * patchwork: (1492 commits)
    [media] cec: always check all_device_types and features
    [media] cec: poll should check if there is room in the tx queue
    [media] vivid: support monitor all mode
    [media] cec: fix test for unconfigured adapter in main message loop
    [media] cec: limit the size of the transmit queue
    [media] cec: zero unused msg part after msg->len
    [media] cec: don't set fh to NULL in CEC_TRANSMIT
    [media] cec: clear all status fields before transmit and always fill in sequence
    [media] cec: CEC_RECEIVE overwrote the timeout field
    [media] cxd2841er: Reading SNR for DVB-C added
    [media] cxd2841er: Reading BER and UCB for DVB-C added
    [media] cxd2841er: fix switch-case for DVB-C
    [media] cxd2841er: fix signal strength scale for ISDB-T
    [media] cxd2841er: adjust the dB scale for DVB-C
    [media] cxd2841er: provide signal strength for DVB-C
    [media] cxd2841er: fix BER report via DVBv5 stats API
    [media] mb86a20s: apply mask to val after checking for read failure
    [media] airspy: fix error logic during device register
    [media] s5p-cec/TODO: add TODO item
    [media] cec/TODO: drop comment about sphinx documentation
    ...

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

18 Jul, 2016

1 commit

  • The conversion from DocBook lead into some conversion issues,
    basically due to the lack of proper support at kernel-doc.

    So, address them:

    - Now, the C files with the exported symbols also need to be
    added. So, all headers need to be included twice: one to
    get the structs/enums/.. and another one for the functions;

    - Notes should use the ReST tag, as kernel-doc doesn't
    recognizes it anymore;

    - Identation needs to be fixed, as ReST uses it to identify
    when a format "tag" ends.

    - kernel-doc doesn't escape things like *pointer, so we
    need to manually add a escape char before it.

    - On some cases, kernel-doc conversion requires violating
    the 80-cols, as otherwise it won't properly parse the
    source code.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

09 Jul, 2016

3 commits

  • Make this a proper typed array. Drop the old allocate context code since
    that is no longer used.

    Note that the memops functions now get a struct device pointer instead of
    the struct device ** that was there initially (actually a void pointer to
    a struct containing only a struct device pointer).

    This code is now a lot cleaner.

    Signed-off-by: Hans Verkuil
    Reviewed-by: Laurent Pinchart
    Cc: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • The allocation context is nothing more than a per-plane device pointer
    to use when allocating buffers. So just provide a dev pointer in vb2_queue
    for that purpose and drivers can skip allocating/releasing/filling in
    the allocation context unless they require different per-plane device
    pointers as used by some Samsung SoCs.

    Signed-off-by: Hans Verkuil
    Reviewed-by: Laurent Pinchart
    Cc: Sakari Ailus
    Cc: Florian Echtler
    Cc: Federico Vaga
    Cc: "Lad, Prabhakar"
    Cc: Scott Jiang
    Acked-by: Philipp Zabel
    Cc: Fabien Dessenne
    Acked-by: Benoit Parrot
    Cc: Mikhail Ulyanov
    Cc: Guennadi Liakhovetski
    Cc: Jonathan Corbet
    Cc: Ludovic Desroches
    Cc: Sergei Shtylyov
    Cc: Kyungmin Park
    Cc: Sylwester Nawrocki
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Make the dma attributes struct part of vb2_queue. This greatly simplifies
    the remainder of the patch series since the dma_contig alloc context is
    now (as before) just a struct device pointer.

    Signed-off-by: Hans Verkuil
    Reviewed-by: Laurent Pinchart
    Cc: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

25 Apr, 2016

1 commit

  • When using a device is read/write mode, vb2 does not handle properly the
    first select/poll operation.

    The reason for this, is that when this code has been refactored, some of
    the operations have changed their order, and now fileio emulator is not
    started.

    The reintroduced check to the core is enabled by a quirk flag, that
    avoids this check by other subsystems like DVB.

    Fixes: 49d8ab9feaf2 ("media] media: videobuf2: Separate vb2_poll()")

    Reported-by: Dimitrios Katsaros
    Cc: Junghak Sung
    Cc: # for v4.5 and up
    Signed-off-by: Ricardo Ribalda Delgado
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Ricardo Ribalda
     

14 Apr, 2016

1 commit

  • The number of planes in videobuf2 is specific to a buffer. In order to
    verify that the planes array provided by the user is long enough, a new
    vb2_buf_op is required.

    Call __verify_planes_array() when the dequeued buffer is known. Return an
    error to the caller if there was one, otherwise remove the buffer from the
    done list.

    Signed-off-by: Sakari Ailus
    Acked-by: Hans Verkuil
    Cc: stable@vger.kernel.org # for v4.4 and later
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     

04 Feb, 2016

1 commit

  • The vb2_thread implementation was made generic and was moved from
    videobuf2-v4l2.c to videobuf2-core.c in commit af3bac1a. Unfortunately
    that clearly was never tested since it broke read() causing NULL address
    references.

    The root cause was confused handling of vb2_buffer vs v4l2_buffer (the pb
    pointer in various core functions).

    The v4l2_buffer no longer exists after moving the code into the core and
    it is no longer needed. However, the vb2_thread code passed a pointer to
    a vb2_buffer to the core functions were a v4l2_buffer pointer was expected
    and vb2_thread expected that the vb2_buffer fields would be filled in
    correctly.

    This is obviously wrong since v4l2_buffer != vb2_buffer. Note that the
    pb pointer is a void pointer, so no type-checking took place.

    This patch fixes this problem:

    1) allow pb to be NULL for vb2_core_(d)qbuf. The vb2_thread code will use
    a NULL pointer here since they don't care about v4l2_buffer anyway.
    2) let vb2_core_dqbuf pass back the index of the received buffer. This is
    all vb2_thread needs: this index is the index into the q->bufs array
    and vb2_thread just gets the vb2_buffer from there.
    3) the fileio->b pointer (that originally contained a v4l2_buffer) is
    removed altogether since it is no longer needed.

    Tested with vivid and the cobalt driver.

    Cc: stable@vger.kernel.org # Kernel >= 4.3
    Signed-off-by: Hans Verkuil
    Reported-by: Matthias Schwarzott
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

19 Dec, 2015

2 commits

  • 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: Hans Verkuil
    Reported-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • This ops can never fail, so make these void functions.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

18 Dec, 2015

4 commits

  • Move things related with vb2 file I/O and vb2_thread without doing any
    functional changes. After that, videobuf2-internal.h is removed because
    it is not necessary any more.

    Signed-off-by: Junghak Sung
    Signed-off-by: Geunyoung Kim
    Acked-by: Seung-Woo Kim
    Acked-by: Inki Dae
    Acked-by: Hans Verkuil
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Junghak Sung
     
  • Add copy_timestamp to struct vb2_queue as a flag set if vb2-core should
    copy timestamps.

    Signed-off-by: Junghak Sung
    Signed-off-by: Geunyoung Kim
    Acked-by: Seung-Woo Kim
    Acked-by: Inki Dae
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Junghak Sung
     
  • Move timestamp from struct vb2_v4l2_buffer to struct vb2_buffer
    for common use, and change its type to u64 in order to handling
    y2038 problem. This patch also includes all device drivers' changes related to
    this restructuring.

    Signed-off-by: Junghak Sung
    Signed-off-by: Geunyoung Kim
    Acked-by: Seung-Woo Kim
    Acked-by: Inki Dae
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Junghak Sung
     
  • The queue_setup callback has a void pointer that is just for V4L2
    and is the pointer to the v4l2_format struct that was passed to
    VIDIOC_CREATE_BUFS. The idea was that drivers would use the information
    from that struct to buffers suitable for the requested format.

    After the vb2 split series this pointer is now a void pointer,
    which is ugly, and the reality is that all existing drivers will
    effectively just look at the sizeimage field of v4l2_format.

    To make this more generic the queue_setup callback is changed:
    the void pointer is dropped, instead if the *num_planes argument
    is 0, then use the current format size, if it is non-zero, then
    it contains the number of requested planes and the sizes array
    contains the requested sizes. If either is unsupported, then return
    -EINVAL, otherwise use the requested size(s).

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

21 Oct, 2015

4 commits

  • Move v4l2-specific stuff from videobu2-core to videobuf2-v4l2
    without doing any functional changes.

    Signed-off-by: Junghak Sung
    Signed-off-by: Geunyoung Kim
    Acked-by: Seung-Woo Kim
    Acked-by: Inki Dae
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Junghak Sung
     
  • Prepare to divide videobuf2
    - Separate vb2 trace events from v4l2 trace event.
    - Make wrapper functions that will move to v4l2-side.
    - Make vb2_core_* functions that will remain in core-side.
    - Add a callback function table for buffer operation which makes vb2-core
    to be able to invoke a v4l2-side functions.
    - Rename internal functions as vb2_*.

    Signed-off-by: Junghak Sung
    Signed-off-by: Geunyoung Kim
    Acked-by: Seung-Woo Kim
    Acked-by: Inki Dae
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Junghak Sung
     
  • Simple changes that replace v4l2-specific data with vb2 data
    in videobuf2-core.

    enum v4l2_buf_type --> int
    enum v4l2_memory --> enum vb2_memory
    VIDEO_MAX_FRAME --> VB2_MAX_FRAME
    VIDEO_MAX_PLANES --> VB2_MAX_PLANES
    struct v4l2_fh *owner --> void *owner
    V4L2_TYPE_IS_MULTIPLANAR() --> is_multiplanar
    V4L2_TYPE_IS_OUTPUT() --> is_output

    Signed-off-by: Junghak Sung
    Signed-off-by: Geunyoung Kim
    Acked-by: Seung-Woo Kim
    Acked-by: Inki Dae
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Junghak Sung
     
  • Replace struct v4l2_format * with void * to make queue_setup()
    for common use.
    And then, modify all device drivers related with this change.

    Signed-off-by: Junghak Sung
    Signed-off-by: Geunyoung Kim
    Acked-by: Seung-Woo Kim
    Acked-by: Inki Dae
    Signed-off-by: Hans Verkuil
    [hans.verkuil@cisco.com: fix missing const in fimc-lite.c]

    Signed-off-by: Mauro Carvalho Chehab

    Junghak Sung
     

05 Oct, 2015

1 commit


02 Oct, 2015

1 commit

  • include/media/videobuf2-core.h:112: warning: No description found for parameter 'get_dmabuf'
    include/media/videobuf2-core.h:146: warning: No description found for parameter 'm'
    include/media/videobuf2-core.h:146: warning: Excess struct/union/enum/typedef member 'mem_offset' description in 'vb2_plane'

    There are still several warnings, but those are hard to fix,
    as they're actually a bug at DocBook. Those should be fixed on
    separate patches.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

01 Oct, 2015

2 commits

  • Remove v4l2 stuff - v4l2_buf, v4l2_plane - from struct vb2_buffer.

    Add new member variables - bytesused, length, offset, userptr, fd,
    data_offset - to struct vb2_plane in order to cover all information
    of v4l2_plane.
    struct vb2_plane {

    unsigned int bytesused;
    unsigned int length;
    union {
    unsigned int offset;
    unsigned long userptr;
    int fd;
    } m;
    unsigned int data_offset;
    }

    Replace v4l2_buf with new member variables - index, type, memory - which
    are common fields for buffer management.
    struct vb2_buffer {

    unsigned int index;
    unsigned int type;
    unsigned int memory;
    unsigned int num_planes;
    struct vb2_plane planes[VIDEO_MAX_PLANES];

    };

    v4l2 specific fields - flags, field, timestamp, timecode,
    sequence - are moved to vb2_v4l2_buffer in videobuf2-v4l2.c
    struct vb2_v4l2_buffer {
    struct vb2_buffer vb2_buf;

    __u32 flags;
    __u32 field;
    struct timeval timestamp;
    struct v4l2_timecode timecode;
    __u32 sequence;
    };

    Signed-off-by: Junghak Sung
    Signed-off-by: Geunyoung Kim
    Acked-by: Seung-Woo Kim
    Acked-by: Inki Dae
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Junghak Sung
     
  • Make videobuf2-v4l2 as a wrapper of videobuf2-core for v4l2-use.
    And replace videobuf2-core.h with videobuf2-v4l2.h.
    This renaming change should be accompanied by the modifications
    of all device drivers that include videobuf2-core.h.
    It can be done with just running this shell script.

    replace()
    {
    str1=$1
    str2=$2
    dir=$3
    for file in $(find $dir -name *.h -o -name *.c -o -name Makefile)
    do
    echo $file
    sed "s/$str1/$str2/g" $file > $file.out
    mv $file.out $file
    done
    }

    replace "videobuf2-core" "videobuf2-v4l2" "include/media/"
    replace "videobuf2-core" "videobuf2-v4l2" "drivers/media/"
    replace "videobuf2-core" "videobuf2-v4l2" "drivers/usb/gadget/"
    replace "videobuf2-core" "videobuf2-v4l2" "drivers/staging/media/"

    Signed-off-by: Junghak Sung
    Signed-off-by: Geunyoung Kim
    Acked-by: Seung-Woo Kim
    Acked-by: Inki Dae
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Junghak Sung
     

06 Sep, 2015

1 commit

  • Pull media updates from Mauro Carvalho Chehab:
    - new DVB frontend drivers: ascot2e, cxd2841er, horus3a, lnbh25
    - new HDMI capture driver: tc358743
    - new driver for NetUP DVB new boards (netup_unidvb)
    - IR support for DVBSky cards (smipcie-ir)
    - Coda driver has gain macroblock tiling support
    - Renesas R-Car gains JPEG codec driver
    - new DVB platform driver for STi boards: c8sectpfe
    - added documentation for the media core kABI to device-drivers DocBook
    - lots of driver fixups, cleanups and improvements

    * tag 'media/v4.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (297 commits)
    [media] c8sectpfe: Remove select on undefined LIBELF_32
    [media] i2c: fix platform_no_drv_owner.cocci warnings
    [media] cx231xx: Use wake_up_interruptible() instead of wake_up_interruptible_nr()
    [media] tc358743: only queue subdev notifications if devnode is set
    [media] tc358743: add missing Kconfig dependency/select
    [media] c8sectpfe: Use %pad to print 'dma_addr_t'
    [media] DocBook media: Fix typo "the the" in xml files
    [media] tc358743: make reset gpio optional
    [media] tc358743: set direction of reset gpio using devm_gpiod_get
    [media] dvbdev: document most of the functions/data structs
    [media] dvb_frontend.h: document the struct dvb_frontend
    [media] dvb-frontend.h: document struct dtv_frontend_properties
    [media] dvb-frontend.h: document struct dvb_frontend_ops
    [media] dvb: Use DVBFE_ALGO_HW where applicable
    [media] dvb_frontend.h: document struct analog_demod_ops
    [media] dvb_frontend.h: Document struct dvb_tuner_ops
    [media] Docbook: Document struct analog_parameters
    [media] dvb_frontend.h: get rid of dvbfe_modcod
    [media] add documentation for struct dvb_tuner_info
    [media] dvb_frontend: document dvb_frontend_tune_settings
    ...

    Linus Torvalds
     

22 Aug, 2015

1 commit

  • Most of the stuff at videobuf2-core are ok for adding it to
    DocBook.

    Two notes here:
    1) As videobuf2-core will be soon be changed, better to
    not spend too much efforts right now, as things will
    change soon;

    2) struct vb2_queue has a number of private elements that are
    documented. As Kernel nano documentation format handles
    "private:" arguments, we need to put them on a separate
    comment block or to remove. Keeping the comments is
    obviously better ;)

    Signed-off-by: Mauro Carvalho Chehab
    Acked-by: Jonathan Corbet

    Mauro Carvalho Chehab
     

17 Jul, 2015

1 commit

  • Buffers can be returned back to videobuf2 in driver's streamon handler. In
    this case vb2_buffer_done() with buffer state VB2_BUF_STATE_QUEUED will
    cause the driver's buf_queue vb2 operation to be called, queueing the same
    buffer again only to be returned to videobuf2 using vb2_buffer_done() and so
    on.

    Add a new buffer state VB2_BUF_STATE_REQUEUEING which, when used as the
    state argument to vb2_buffer_done(), will result in buffers queued to the
    driver. Using VB2_BUF_STATE_QUEUED will leave the buffer to videobuf2, as it
    was before "[media] vb2: allow requeuing buffers while streaming".

    Fixes: ce0eff016f72 ("[media] vb2: allow requeuing buffers while streaming")

    [mchehab@osg.samsung.com: fix warning: enumeration value 'VB2_BUF_STATE_REQUEUEING' not handled in switch]

    Signed-off-by: Sakari Ailus
    Acked-by: Hans Verkuil
    Cc: stable@vger.kernel.org # for v4.1
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     

12 May, 2015

1 commit

  • If the last buffer was dequeued from a capture queue, let poll return
    immediately and let DQBUF return -EPIPE to signal there will no more
    buffers to dequeue until STREAMOFF.
    The driver signals the last buffer by setting the V4L2_BUF_FLAG_LAST.
    To reenable dequeuing on the capture queue, the driver must explicitly
    call vb2_clear_last_buffer_queued. The last buffer queued flag is
    cleared automatically during STREAMOFF.

    Signed-off-by: Philipp Zabel
    Acked-by: Hans Verkuil
    Signed-off-by: Kamil Debski
    Signed-off-by: Mauro Carvalho Chehab

    Philipp Zabel
     

10 Apr, 2015

2 commits

  • The vb2: fix bytesused == 0 handling (8a75ffb) patch changed the behavior
    of __fill_vb2_buffer function, so that if bytesused is 0 it is set to the
    size of the buffer. However, bytesused set to 0 is used by older codec
    drivers as as indication used to mark the end of stream.

    To keep backward compatibility, this patch adds a flag passed to the
    vb2_queue_init function - allow_zero_bytesused. If the flag is set upon
    initialization of the queue, the videobuf2 keeps the value of bytesused
    intact in the OUTPUT queue and passes it to the driver.

    Reported-by: Nicolas Dufresne
    Signed-off-by: Kamil Debski
    Acked-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Kamil Debski
     
  • This patch splits the io_flags member of vb2_queue into a bit field.
    Instead of an enum with flags separate bit fields were introduced.

    Signed-off-by: Kamil Debski
    Acked-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Kamil Debski
     

25 Nov, 2014

3 commits