1. 17 4月, 2014 10 次提交
    • H
      [media] vb2: simplify a confusing condition · 57394b72
      Hans Verkuil 提交于
      q->start_streaming_called is always true, so the WARN_ON check against
      it being false can be dropped.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Acked-by: NPawel Osciak <pawel@osciak.com>
      Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      57394b72
    • H
      [media] vb2: reject output buffers with V4L2_FIELD_ALTERNATE · e35e41b5
      Hans Verkuil 提交于
      This is not allowed by the spec and does in fact not make any sense.
      Return -EINVAL if this is the case.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Acked-by: NPawel Osciak <pawel@osciak.com>
      Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      e35e41b5
    • H
      [media] vb2: set timestamp when using write() · ebd7c505
      Hans Verkuil 提交于
      When using write() to write data to an output video node the vb2 core
      should set timestamps if V4L2_BUF_FLAG_TIMESTAMP_COPY is set. Nobody
      else is able to provide this information with the write() operation.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Acked-by: NPawel Osciak <pawel@osciak.com>
      Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      ebd7c505
    • H
      [media] vb2: move __qbuf_mmap before __qbuf_userptr · dcc2428a
      Hans Verkuil 提交于
      __qbuf_mmap was sort of hidden in between the much larger __qbuf_userptr
      and __qbuf_dmabuf functions. Move it before __qbuf_userptr which is
      also conform the usual order these memory models are implemented: first
      mmap, then userptr, then dmabuf.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Acked-by: NPawel Osciak <pawel@osciak.com>
      Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      dcc2428a
    • H
      [media] vb2: use correct prefix · fd4354cf
      Hans Verkuil 提交于
      Many dprintk's in vb2 use a hardcoded prefix with the function name. In
      many cases that is now outdated. To keep things consistent the dprintk
      macro has been changed to print the function name in addition to the "vb2:"
      prefix. Superfluous prefixes elsewhere in the code have been removed.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Acked-by: NPawel Osciak <pawel@osciak.com>
      Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      fd4354cf
    • H
      [media] vb2: if bytesused is 0, then fill with output buffer length · 61bd8fb3
      Hans Verkuil 提交于
      The application should really always fill in bytesused for output
      buffers, unfortunately the vb2 framework never checked for that.
      
      So for single planar formats replace a bytesused of 0 by the length
      of the buffer, and for multiplanar format do the same if bytesused is
      0 for ALL planes.
      
      This seems to be what the user really intended if v4l2_buffer was
      just memset to 0.
      
      I'm afraid that just checking for this and returning an error would
      break too many applications. Quite a few drivers never check for bytesused
      at all and just use the buffer length instead.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Acked-by: NPawel Osciak <pawel@osciak.com>
      Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      61bd8fb3
    • H
      [media] vb2: fix handling of data_offset and v4l2_plane.reserved[] · 412376a1
      Hans Verkuil 提交于
      The videobuf2-core did not zero the 'planes' array in __qbuf_userptr()
      and __qbuf_dmabuf(). That's now memset to 0. Without this the reserved
      array in struct v4l2_plane would be non-zero, causing v4l2-compliance
      errors.
      
      More serious is the fact that data_offset was not handled correctly:
      
      - for capture devices it was never zeroed, which meant that it was
        uninitialized. Unless the driver sets it it was a completely random
        number. With the memset above this is now fixed.
      
      - __qbuf_dmabuf had a completely incorrect length check that included
        data_offset.
      
      - in __fill_vb2_buffer in the DMABUF case the data_offset field was
        unconditionally copied from v4l2_buffer to v4l2_plane when this
        should only happen in the output case.
      
      - in the single-planar case data_offset was never correctly set to 0.
        The single-planar API doesn't support data_offset, so setting it
        to 0 is the right thing to do. This too is now solved by the memset.
      
      All these issues were found with v4l2-compliance.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Acked-by: NPawel Osciak <pawel@osciak.com>
      Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      412376a1
    • H
      [media] v4l2-dv-timings.c: add the new 4K timings to the list · bc96f30c
      Hans Verkuil 提交于
      Add the new CEA-861-F and DMT 4K timings to the list of predefined
      timings.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      bc96f30c
    • H
      [media] v4l2-ioctl.c: fix sparse __user-related warnings · ba2d35c1
      Hans Verkuil 提交于
      Fix the use of __user in the check_array_args() prototype: instead of
      using 'void * __user *' you should use 'void __user **' for sparse to
      understand this correctly.
      
      This also required the use of __force in the '*kernel_ptr = user_ptr'
      assignment.
      
      Also replace a wrong cast (void *) with the correct one (void **)
      in check_array_args().
      
      This fixes these sparse warnings:
      
      drivers/media/v4l2-core/v4l2-ioctl.c:2284:35: warning: incorrect type in assignment (different address spaces)
      drivers/media/v4l2-core/v4l2-ioctl.c:2301:35: warning: incorrect type in assignment (different address spaces)
      drivers/media/v4l2-core/v4l2-ioctl.c:2319:35: warning: incorrect type in assignment (different address spaces)
      drivers/media/v4l2-core/v4l2-ioctl.c:2386:57: warning: incorrect type in argument 4 (different address spaces)
      drivers/media/v4l2-core/v4l2-ioctl.c:2420:29: warning: incorrect type in assignment (different address spaces)
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      ba2d35c1
    • H
      [media] videobuf2-core: fix sparse errors · a1d36d8c
      Hans Verkuil 提交于
      Sparse generated a bunch of errors like this:
      
      drivers/media/v4l2-core/videobuf2-core.c:2045:25: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:136:17: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:151:17: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:168:25: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:183:17: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:185:9: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:385:25: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:1115:17: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:1268:33: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:1270:25: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:1315:17: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:1324:25: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:1396:25: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:1457:17: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:1482:17: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:1484:9: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:1523:17: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:1525:17: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:1815:17: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:1828:17: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:1914:25: error: incompatible types in conditional expression (different base types)
      drivers/media/v4l2-core/videobuf2-core.c:1944:9: error: incompatible types in conditional expression (different base types)
      
      These are caused by the call*op defines which do something like this:
      
              (ops->op) ? ops->op(args) : 0
      
      which is OK as long as op is not a void function, because in that case one part
      of the conditional expression returns void, the other an integer. Hence the sparse
      errors.
      
      I've replaced this by introducing three variants of the call_ macros:
      call_*op for int returns, call_void_*op for void returns and call_ptr_*op for
      pointer returns.
      
      That's the bad news. The good news is that the fail_*op macros could be removed
      since the call_*op macros now have enough information to determine if the op
      succeeded or not and can increment the op counter only on success. This at least
      makes it more robust w.r.t. future changes.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Acked-by: NPawel Osciak <pawel@osciak.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      a1d36d8c
  2. 29 3月, 2014 1 次提交
  3. 13 3月, 2014 3 次提交
  4. 11 3月, 2014 18 次提交
  5. 07 3月, 2014 2 次提交
  6. 06 3月, 2014 6 次提交