28 Jul, 2011

1 commit


29 Dec, 2010

3 commits


21 Oct, 2010

4 commits


28 Sep, 2010

1 commit

  • This fixes a nasty memory corruption bug when using userptr I/O.
    The function videobuf_pages_to_sg() sets up the scatter-gather list for the
    DMA transfer to the userspace pages. The first transfer is setup correctly
    (the size is set to PAGE_SIZE - offset), but all other transfers have size
    PAGE_SIZE. This is wrong for the last transfer which may be less than PAGE_SIZE.

    Most, if not all, drivers will program the boards DMA engine correctly, i.e.
    even though the size in the last sg element is wrong, they will do their
    own size calculations and make sure the right amount is DMA-ed, and so seemingly
    prevent memory corruption.

    However, behind the scenes the dynamic DMA mapping support (in lib/swiotlb.c)
    may create bounce buffers if the memory pages are not in DMA-able memory.
    This happens for example on a 64-bit linux with a board that only supports
    32-bit DMA.

    These bounce buffers DO use the information in the sg list to determine the
    size. So while the DMA engine transfers the correct amount of data, when the
    data is 'bounced' back too much is copied, causing buffer overwrites.

    The fix is simple: calculate and set the correct size for the last sg list
    element.

    Signed-off-by: Hans Verkuil
    Cc: stable@kernel.org
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

03 Aug, 2010

5 commits


19 May, 2010

8 commits


18 May, 2010

1 commit


27 Feb, 2010

1 commit


06 Dec, 2009

2 commits

  • The videobuf_queue_ops function vector is not declared constant, but
    there's no need for the videobuf layer to ever change it. Make it const
    so that videobuf users can make their operations const without warnings.

    Signed-off-by: Jonathan Corbet
    Signed-off-by: Andrew Morton
    Signed-off-by: Mauro Carvalho Chehab

    Jonathan Corbet
     
  • When the image size (bytesperline*height) is not multiple
    of PAGE_SIZE, v4l2 rounded the required buffer size to
    be multiple of PAGE_SIZE. This prevented user space
    to store images directly into userptr buffers which were
    not multiple of PAGE_SIZE. This constraint is removed.

    The start address is still assumed to be required
    page-aligned, ie., when v4l2 allocates mmap buffers,
    the offset between different buffers is page-aligned.

    Signed-off-by: Tuukka Toivonen
    Signed-off-by: Mauro Carvalho Chehab

    Tuukka Toivonen
     

12 Oct, 2009

1 commit


28 Sep, 2009

1 commit


17 Jun, 2009

2 commits


08 Jan, 2009

1 commit


20 Jul, 2008

2 commits


25 Apr, 2008

7 commits