20 Dec, 2011

1 commit

  • When enumerating an entity, assign the entire entity specification
    instead of only the first two words. (This requires giving the
    specification union a name.)

    So far, no driver actually uses more than two words, but this will
    be needed for ALSA entities.

    Signed-off-by: Clemens Ladisch
    [laurent.pinchart@ideasonboard.com: Rename specification to info]
    Signed-off-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab

    Clemens Ladisch
     

11 Dec, 2011

1 commit


19 Oct, 2011

1 commit


22 Sep, 2011

1 commit


01 Jul, 2011

1 commit

  • Entities associated with video device nodes are unregistered in
    video_unregister_device(). This destroys the entity even though it can
    still be accessed through open video device nodes.

    Move the media_device_unregister_entity() call from
    video_unregister_device() to v4l2_device_release() to ensure that the
    entity isn't unregistered until the last reference to the video device
    is released.

    Also remove the media_entity_get()/put() calls from v4l2-dev.c. Those
    functions were designed for subdevs, to avoid a parent module from being
    removed while still accessible through board code. They're not currently
    needed for video device nodes, and will oops when a hotpluggable device
    is disconnected during streaming, as media_entity_put() called in
    v4l2_device_release() tries to access entity->parent->dev->driver which
    is set to NULL when the device is disconnected.

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

    Laurent Pinchart
     

20 May, 2011

1 commit


19 Apr, 2011

1 commit


23 Mar, 2011

4 commits

  • Rather than guess which driver supports core priority handling, require drivers
    that do to explicitly set the V4L2_FL_USE_FH_PRIO flag in video_device.

    Updated the core prio handling accordingly and set the flag in the three
    drivers that do.

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

    Hans Verkuil
     
  • The video_device struct has proper ref counting and its release function
    will be called when the last user releases it. But no such support was
    available for struct v4l2_device. This made it hard to determine when a
    USB driver can release the device if it has multiple device nodes.

    With one device node it is easy of course, since when the device node is
    released, the whole device can be released.

    This patch adds refcounting to v4l2_device. When registering device nodes
    the v4l2_device refcount will be increased, when releasing device nodes
    it will be decreased. The (optional) release function will be called when
    the last device node was released.

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

    Hans Verkuil
     
  • Integrate the v4l2_prio_state into the core, ready for use.

    One struct v4l2_prio_state is added to v4l2_device and a pointer
    to a prio state is added to video_device.

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

    Hans Verkuil
     
  • We are going to move priority handling into the v4l2 core. As a consequence
    the v4l2_prio helper functions need to be moved into the core videodev
    module as well to prevent circular dependencies.

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

    Hans Verkuil
     

22 Mar, 2011

2 commits

  • V4L2 devices are media entities. As such they need to inherit from
    (include) the media_entity structure.

    When registering/unregistering the device, the media entity is
    automatically registered/unregistered. The entity is acquired on device
    open and released on device close.

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

    Laurent Pinchart
     
  • Create a device node named subdevX for every registered subdev.

    As the device node is registered before the subdev core::s_config
    function is called, return -EGAIN on open until initialization
    completes.

    Signed-off-by: Laurent Pinchart
    Signed-off-by: Vimarsh Zutshi
    Acked-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Laurent Pinchart
     

19 Jan, 2011

1 commit

  • Zeroing video_device.dev causes a memory leak if video_set_drvdata
    was called before video_register_device was called. video_set_drvdata
    calls dev_set_drvdata which allocates video_device.dev.p.

    memsetting this will prevent freeing of that memory.

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

    Hans Verkuil
     

02 Dec, 2010

3 commits

  • The unregister function had a race condition with the v4l2_open
    function. Ensure that both functions test and clear the REGISTER
    flag from within a critical section.

    Thanks to Laurent Pinchart for finding this race.

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

    Hans Verkuil
     
  • The BKL replacement mutex had some serious performance side-effects on
    V4L drivers. It is replaced by a better heuristic that works around the
    worst of the side-effects.

    Read the v4l2-dev.c comments for the whole sorry story. This is a
    temporary measure only until we can convert all v4l drivers to use
    unlocked_ioctl.

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

    Hans Verkuil
     
  • Where reasonable use mutex_lock_interruptible instead of mutex_lock.
    Also fix the poll, read and write error codes when called with an unregistered
    device (e.g. after a USB device was disconnected). Poll must return
    POLLERR|POLLHUP and read/write must return -ENODEV.

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

    Hans Verkuil
     

09 Nov, 2010

1 commit

  • All of the hard problems for BKL removal appear to be solved in the
    v4l-dvb/master tree. This removes the BKL from the various open
    functions that do not need it, or only use it to protect an
    open count.

    The zoran driver is nontrivial in this regard, so I introduce
    a new mutex that locks both the open/release and the ioctl
    functions. Someone with access to the hardware can probably
    improve that by using the existing lock in all cases.

    Finally, all drivers that still use the locked version of the
    ioctl function now get called under a new mutex instead of
    the BKL.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Mauro Carvalho Chehab

    Arnd Bergmann
     

21 Oct, 2010

5 commits

  • Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Drivers can optionally set a pointer to a mutex in struct video_device.
    The core will use that to lock before calling open, read, write, unlocked_ioctl,
    poll, mmap or release.

    Updated the documentation as well and ensure that v4l2-event knows about the
    lock: it will unlock it before doing a blocking wait on an event and relock it
    afterwards.

    Ensure that the 'video_is_registered' check is done when the lock is held:
    a typical disconnect will take the lock as well before unregistering the
    device nodes, so to prevent race conditions the video_is_registered check
    should also be done with the lock held.

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

    Hans Verkuil
     
  • The get_unmapped_area file operation is unused. Remove.

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

    Hans Verkuil
     
  • Until now all fops except release and (unlocked_)ioctl returned an error
    after the device node was unregistered. Extend this as well to the ioctl
    fops. There is nothing useful that an application can do here and it
    complicates the driver code unnecessarily.

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

    Hans Verkuil
     
  • Remove the vtx (aka videotext aka teletext) API from the v4l2 core.
    This API was scheduled for removal in kernel 2.6.35.

    The vtx device nodes have been superseded by vbi device nodes
    for many years. No applications exist that use the vtx support.
    Of the two i2c drivers that actually support this API the saa5249
    has been impossible to use for a year now and no known hardware
    that supports this device exists. The saa5246a is theoretically
    supported by the old mxb boards, but it never actually worked.

    In summary: there is no hardware that can use this API and there
    are no applications actually implementing this API.

    The vtx support still reserves minors 192-223 and we would really
    like to reuse those for upcoming new functionality. In the unlikely
    event that new hardware appears that wants to use the functionality
    provided by the vtx API, then that functionality should be build
    around the sliced VBI API instead.

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

    Hans Verkuil
     

11 Aug, 2010

1 commit

  • * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (94 commits)
    V4L/DVB: tvp7002: fix write to H-PLL Feedback Divider LSB register
    V4L/DVB: dvb: siano: free spinlock before schedule()
    V4L/DVB: media: video: pvrusb2: remove custom hex_to_bin()
    V4L/DVB: drivers: usbvideo: remove custom implementation of hex_to_bin()
    V4L/DVB: Report supported QAM modes on bt8xx
    V4L/DVB: media: ir-keytable: null dereference in debug code
    V4L/DVB: ivtv: convert to the new control framework
    V4L/DVB: ivtv: convert gpio subdev to new control framework
    V4L/DVB: wm8739: convert to the new control framework
    V4L/DVB: cs53l32a: convert to new control framework
    V4L/DVB: wm8775: convert to the new control framework
    V4L/DVB: cx2341x: convert to the control framework
    V4L/DVB: cx25840: convert to the new control framework
    V4L/DVB: cx25840/ivtv: replace ugly priv control with s_config
    V4L/DVB: saa717x: convert to the new control framework
    V4L/DVB: msp3400: convert to the new control framework
    V4L/DVB: saa7115: convert to the new control framework
    V4L/DVB: v4l2: hook up the new control framework into the core framework
    V4L/DVB: Documentation: add v4l2-controls.txt documenting the new controls API
    V4L/DVB: v4l2-ctrls: Whitespace cleanups
    ...

    Linus Torvalds
     

09 Aug, 2010

3 commits


03 Aug, 2010

1 commit

  • Since commit b4028437876866aba4747a655ede00f892089e14
    the 'driver_data' field resides in device's struct device_private
    which may be allocated by dev_set_drvdata() if device_private
    struct was not allocated previously.

    dev_set_drvdata() is used in video_set_drvdata() to set
    the driver's private data pointer in v4l2 drivers. Setting
    the private data _before_ registering the v4l2 device results
    in a memory leak since __video_register_device() also calls
    video_set_drvdata(), but after zeroing the device structure.
    Thus, the reference to the previously allocated device_private
    struct goes lost and a new device_private will be allocated.

    All v4l drivers which call video_set_drvdata() _before_
    calling video_register_device() are affected. The patch fixes
    __video_register_device() to preserve previously allocated
    device_private reference.

    Caught by kmemleak.

    Signed-off-by: Anatolij Gustschin
    Signed-off-by: Mauro Carvalho Chehab

    Anatolij Gustschin
     

19 May, 2010

2 commits


16 Dec, 2009

2 commits


19 Sep, 2009

4 commits


13 Jul, 2009

1 commit

  • * Remove smp_lock.h from files which don't need it (including some headers!)
    * Add smp_lock.h to files which do need it
    * Make smp_lock.h include conditional in hardirq.h
    It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT

    This will make hardirq.h inclusion cheaper for every PREEMPT=n config
    (which includes allmodconfig/allyesconfig, BTW)

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

07 Apr, 2009

1 commit


30 Mar, 2009

2 commits