04 Nov, 2011

4 commits


07 Sep, 2011

4 commits

  • This patch changes the order of operations during stream on call. Now the
    buffers are first queued to the driver and then the start_streaming method
    is called.

    This resolves the most common case when the driver needs to know buffer
    addresses to enable dma engine and start streaming. Additional parameter
    to start_streaming method have been added to simplify drivers code. The
    driver are now obliged to check if the number of queued buffers is high
    enough to enable hardware streaming. If not - it can return an error. In
    such case all the buffers that have been pre-queued are invalidated.

    This patch also updates all videobuf2 clients to work properly with the
    changed order of operations.

    Signed-off-by: Marek Szyprowski
    Signed-off-by: Kyungmin Park
    CC: Pawel Osciak
    CC: Guennadi Liakhovetski
    CC: Hans Verkuil
    CC: Tomasz Stanislawski
    CC: Sylwester Nawrocki
    CC: Kamil Debski
    CC: Jonathan Corbet
    CC: Josh Wu
    CC: Hans de Goede
    CC: Paul Mundt
    Tested-by: Josh Wu
    Signed-off-by: Mauro Carvalho Chehab

    Marek Szyprowski
     
  • Plane sizes array was declared as unsigned long[], while unsigned int is
    more than enough for storing size of the video buffer. This patch reduces
    the size of the array by definiting it as unsigned int[].

    Reported-by: Laurent Pinchart
    Signed-off-by: Marek Szyprowski
    Signed-off-by: Kyungmin Park
    CC: Pawel Osciak
    Signed-off-by: Mauro Carvalho Chehab

    Marek Szyprowski
     
  • MAPPED flag was set for the buffer only if all it's planes were mapped and
    relied on a simple mapping counter. This assumption is really bogus,
    especially because the buffers may be mapped multiple times. Also the
    meaning of this flag for muliplane buffers was not really useful. This
    patch fixes this issue by setting the MAPPED flag for the buffer if any of
    it's planes is in use (what means that has been mapped at least once), so
    MAPPED flag can be used as 'in_use' indicator.

    Reported-by: Hans Verkuil
    Signed-off-by: Marek Szyprowski
    Signed-off-by: Kyungmin Park
    CC: Pawel Osciak
    Tested-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Marek Szyprowski
     
  • Videobuf2 accepted any userptr buffer without verifying if its size is
    large enough to store the video data from the driver. The driver reports
    the minimal size of video data once in queue_setup and expects that
    videobuf2 provides buffers that match these requirements. This patch
    adds the required check.

    Reported-by: Laurent Pinchart
    Signed-off-by: Marek Szyprowski
    Signed-off-by: Kyungmin Park
    CC: Pawel Osciak
    Acked-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab

    Marek Szyprowski
     

22 Mar, 2011

4 commits

  • Signed-off-by: Pawel Osciak
    Signed-off-by: Mauro Carvalho Chehab

    Pawel Osciak
     
  • vb2_get_plane_payload() gets the bytesused field for a plane, it doesn't
    set it.

    Signed-off-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab

    Laurent Pinchart
     
  • Add a generic file io (read and write) emulator for videobuf2. It uses
    MMAP memory type buffers and generic vb2 calls: req_bufs, qbuf and
    dqbuf. Video date is being copied from mmap buffers to userspace with
    standard copy_to_user() function. To add support for file io the driver
    needs to provide an additional callback - read_setup or write_setup. It
    should provide the default number of buffers used by emulator and flags.

    With these flags one can detemine the style of read() or write()
    emulation. By default 'streaming' style is used. With
    VB2_FILEIO_READ_ONCE flag one can select 'one shot' mode for read()
    emulator. With VB2_FILEIO_WRITE_IMMEDIATE flag one can select immediate
    conversion of write calls to qbuf for write() emulator, so the vb2 will
    not wait until each buffer is filled completely before queueing it to
    the driver.

    Signed-off-by: Marek Szyprowski
    Signed-off-by: Kyungmin Park
    CC: Pawel Osciak
    Reviewed-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Marek Szyprowski
     
  • Videobuf2 is a Video for Linux 2 API-compatible driver framework for
    multimedia devices. It acts as an intermediate layer between userspace
    applications and device drivers. It also provides low-level, modular
    memory management functions for drivers.

    Videobuf2 eases driver development, reduces drivers' code size and aids in
    proper and consistent implementation of V4L2 API in drivers.

    Videobuf2 memory management backend is fully modular. This allows custom
    memory management routines for devices and platforms with non-standard
    memory management requirements to be plugged in, without changing the
    high-level buffer management functions and API.

    The framework provides:
    - implementations of streaming I/O V4L2 ioctls and file operations
    - high-level video buffer, video queue and state management functions
    - video buffer memory allocation and management

    Signed-off-by: Pawel Osciak
    Signed-off-by: Marek Szyprowski
    Signed-off-by: Kyungmin Park
    CC: Pawel Osciak
    Reviewed-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Pawel Osciak