04 Dec, 2014

1 commit


02 Dec, 2014

1 commit


25 Nov, 2014

8 commits


15 Nov, 2014

4 commits

  • Remove unreferenced members from the platform
    data's structure.

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

    Sebastian Reichel
     
  • Add device tree support by changing the device registration order.
    In the device tree the si4713 node is a normal I2C device, which
    will be probed as such. Thus the V4L device must be probed from
    the I2C device and not the other way around.

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

    Sebastian Reichel
     
  • In order to have subsytem agnostic media bus format definitions we've
    moved media bus definition to include/uapi/linux/media-bus-format.h and
    prefixed values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT.

    Reference new definitions in all platform drivers.

    Signed-off-by: Boris Brezillon
    Acked-by: Hans Verkuil
    Acked-by: Sakari Ailus
    Acked-by: Sekhar Nori
    Acked-by: Lad, Prabhakar
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Boris BREZILLON
     
  • Replace references to the v4l2_mbus_pixelcode enum with the new
    media_bus_format enum in all common headers.

    Signed-off-by: Boris Brezillon
    Acked-by: Sakari Ailus
    Acked-by: Hans Verkuil
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Boris BREZILLON
     

11 Nov, 2014

1 commit


03 Nov, 2014

1 commit

  • We can use kfifo_initialized() to check if the fifo in lirc_buffer is
    initialized or not. There's no need to have a dedicated fifo status
    variable in lirc_buffer.

    [m.chehab@samsung.com: add the same change to lirc_zilog, to avoid
    breaking compilation of staging drivers]
    Signed-off-by: Martin Kaiser
    Signed-off-by: Mauro Carvalho Chehab

    Martin Kaiser
     

29 Oct, 2014

3 commits


10 Oct, 2014

1 commit

  • * patchwork: (544 commits)
    [media] ir-hix5hd2: fix build on c6x arch
    [media] pt3: fix DTV FE I2C driver load error paths
    Revert "[media] media: em28xx - remove reset_resume interface"
    [media] exynos4-is: fix some warnings when compiling on arm64
    [media] usb drivers: use %zu instead of %zd
    [media] pci drivers: use %zu instead of %zd
    [media] dvb-frontends: use %zu instead of %zd
    [media] s5p-mfc: Fix several printk warnings
    [media] s5p_mfc_opr: Fix warnings
    [media] ti-vpe: Fix typecast
    [media] s3c-camif: fix dma_addr_t printks
    [media] s5p_mfc_opr_v6: get rid of warnings when compiled with 64 bits
    [media] s5p_mfc_opr_v5: Fix lots of warnings on x86_64
    [media] em28xx: Fix identation
    [media] drxd: remove a dead code
    [media] saa7146: remove return after BUG()
    [media] cx88: remove return after BUG()
    [media] cx88: fix cards table CodingStyle
    [media] radio-sf16fmr2: declare some structs as static
    [media] radio-sf16fmi: declare pnp_attached as static
    ...

    Conflicts:
    Documentation/DocBook/media/v4l/compat.xml

    Mauro Carvalho Chehab
     

24 Sep, 2014

2 commits


22 Sep, 2014

3 commits

  • The recent conversion of saa7134 to vb2 unconvered a poll() bug that
    broke the teletext applications alevt and mtt. These applications
    expect that calling poll() without having called VIDIOC_STREAMON will
    cause poll() to return POLLERR. That did not happen in vb2.

    This patch fixes that behavior. It also fixes what should happen when
    poll() is called when STREAMON is called but no buffers have been
    queued. In that case poll() will also return POLLERR, but only for
    capture queues since output queues will always return POLLOUT
    anyway in that situation.

    This brings the vb2 behavior in line with the old videobuf behavior.

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

    Hans Verkuil
     
  • The comment for start_streaming that tells the developer with which vb2 state
    buffers should be returned to vb2 gave the wrong state. Very confusing.

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

    Hans Verkuil
     
  • this patch adds a helper to get the status if start_streaming()
    was called successfully.

    Signed-off-by: Lad, Prabhakar
    Cc: Pawel Osciak
    Cc: Marek Szyprowski
    Cc: Kyungmin Park
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Prabhakar Lad
     

27 Aug, 2014

1 commit


22 Aug, 2014

2 commits

  • The following lockdep warning has been there ever since commit a517cca6b24fc54ac209e44118ec8962051662e3
    one year ago:

    [ 403.117947] ======================================================
    [ 403.117949] [ INFO: possible circular locking dependency detected ]
    [ 403.117953] 3.16.0-rc6-test-media #961 Not tainted
    [ 403.117954] -------------------------------------------------------
    [ 403.117956] v4l2-ctl/15377 is trying to acquire lock:
    [ 403.117959] (&dev->mutex#3){+.+.+.}, at: [] vb2_fop_mmap+0x33/0x90 [videobuf2_core]
    [ 403.117974]
    [ 403.117974] but task is already holding lock:
    [ 403.117976] (&mm->mmap_sem){++++++}, at: [] vm_mmap_pgoff+0x6f/0xc0
    [ 403.117987]
    [ 403.117987] which lock already depends on the new lock.
    [ 403.117987]
    [ 403.117990]
    [ 403.117990] the existing dependency chain (in reverse order) is:
    [ 403.117992]
    [ 403.117992] -> #1 (&mm->mmap_sem){++++++}:
    [ 403.117997] [] validate_chain.isra.39+0x5fc/0x9a0
    [ 403.118006] [] __lock_acquire+0x4d3/0xd30
    [ 403.118010] [] lock_acquire+0xa7/0x160
    [ 403.118014] [] might_fault+0x7c/0xb0
    [ 403.118018] [] video_usercopy+0x425/0x610 [videodev]
    [ 403.118028] [] video_ioctl2+0x15/0x20 [videodev]
    [ 403.118034] [] v4l2_ioctl+0x184/0x1a0 [videodev]
    [ 403.118040] [] do_vfs_ioctl+0x2f0/0x4f0
    [ 403.118307] [] SyS_ioctl+0x81/0xa0
    [ 403.118311] [] system_call_fastpath+0x16/0x1b
    [ 403.118319]
    [ 403.118319] -> #0 (&dev->mutex#3){+.+.+.}:
    [ 403.118324] [] check_prevs_add+0x746/0x9f0
    [ 403.118329] [] validate_chain.isra.39+0x5fc/0x9a0
    [ 403.118333] [] __lock_acquire+0x4d3/0xd30
    [ 403.118336] [] lock_acquire+0xa7/0x160
    [ 403.118340] [] mutex_lock_interruptible_nested+0x64/0x640
    [ 403.118344] [] vb2_fop_mmap+0x33/0x90 [videobuf2_core]
    [ 403.118349] [] v4l2_mmap+0x62/0xa0 [videodev]
    [ 403.118354] [] mmap_region+0x3d0/0x5d0
    [ 403.118359] [] do_mmap_pgoff+0x31d/0x400
    [ 403.118363] [] vm_mmap_pgoff+0x90/0xc0
    [ 403.118366] [] SyS_mmap_pgoff+0x1df/0x2a0
    [ 403.118369] [] SyS_mmap+0x22/0x30
    [ 403.118376] [] system_call_fastpath+0x16/0x1b
    [ 403.118381]
    [ 403.118381] other info that might help us debug this:
    [ 403.118381]
    [ 403.118383] Possible unsafe locking scenario:
    [ 403.118383]
    [ 403.118385] CPU0 CPU1
    [ 403.118387] ---- ----
    [ 403.118388] lock(&mm->mmap_sem);
    [ 403.118391] lock(&dev->mutex#3);
    [ 403.118394] lock(&mm->mmap_sem);
    [ 403.118397] lock(&dev->mutex#3);
    [ 403.118400]
    [ 403.118400] *** DEADLOCK ***
    [ 403.118400]
    [ 403.118403] 1 lock held by v4l2-ctl/15377:
    [ 403.118405] #0: (&mm->mmap_sem){++++++}, at: [] vm_mmap_pgoff+0x6f/0xc0
    [ 403.118411]
    [ 403.118411] stack backtrace:
    [ 403.118415] CPU: 0 PID: 15377 Comm: v4l2-ctl Not tainted 3.16.0-rc6-test-media #961
    [ 403.118418] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/31/2013
    [ 403.118420] ffffffff82a6c9d0 ffff8800af37fb00 ffffffff819916a2 ffffffff82a6c9d0
    [ 403.118425] ffff8800af37fb40 ffffffff810d5715 ffff8802308e4200 0000000000000000
    [ 403.118429] ffff8802308e4a48 ffff8802308e4a48 ffff8802308e4200 0000000000000001
    [ 403.118433] Call Trace:
    [ 403.118441] [] dump_stack+0x4e/0x7a
    [ 403.118445] [] print_circular_bug+0x1d5/0x2a0
    [ 403.118449] [] check_prevs_add+0x746/0x9f0
    [ 403.118455] [] ? find_vmap_area+0x42/0x70
    [ 403.118459] [] validate_chain.isra.39+0x5fc/0x9a0
    [ 403.118463] [] __lock_acquire+0x4d3/0xd30
    [ 403.118468] [] lock_acquire+0xa7/0x160
    [ 403.118472] [] ? vb2_fop_mmap+0x33/0x90 [videobuf2_core]
    [ 403.118476] [] ? vb2_fop_mmap+0x33/0x90 [videobuf2_core]
    [ 403.118480] [] mutex_lock_interruptible_nested+0x64/0x640
    [ 403.118484] [] ? vb2_fop_mmap+0x33/0x90 [videobuf2_core]
    [ 403.118488] [] ? vb2_fop_mmap+0x33/0x90 [videobuf2_core]
    [ 403.118493] [] ? mark_held_locks+0x75/0xa0
    [ 403.118497] [] vb2_fop_mmap+0x33/0x90 [videobuf2_core]
    [ 403.118502] [] v4l2_mmap+0x62/0xa0 [videodev]
    [ 403.118506] [] mmap_region+0x3d0/0x5d0
    [ 403.118510] [] do_mmap_pgoff+0x31d/0x400
    [ 403.118513] [] vm_mmap_pgoff+0x90/0xc0
    [ 403.118517] [] SyS_mmap_pgoff+0x1df/0x2a0
    [ 403.118521] [] SyS_mmap+0x22/0x30
    [ 403.118525] [] system_call_fastpath+0x16/0x1b

    The reason is that vb2_fop_mmap and vb2_fop_get_unmapped_area take the core lock
    while they are called with the mmap_sem semaphore held. But elsewhere in the code
    the core lock is taken first but calls to copy_to/from_user() can take the mmap_sem
    semaphore as well, potentially causing a classical A-B/B-A deadlock.

    However, the mmap/get_unmapped_area calls really shouldn't take the core lock
    at all. So what would happen if they don't take the core lock anymore?

    There are two situations that need to be taken into account: calling mmap while
    new buffers are being added and calling mmap while buffers are being deleted.

    The first case works almost fine without a lock: in all cases mmap relies on
    correctly filled-in q->num_buffers/q->num_planes values and those are only
    updated by reqbufs and create_buffers *after* any new buffers have been
    initialized completely. Except in one case: if an error occurred while allocating
    the buffers it will increase num_buffers and rely on __vb2_queue_free to
    decrease it again. So there is a short period where the buffer information
    may be wrong.

    The second case definitely does pose a problem: buffers may be in the process
    of being deleted, without the internal structure being updated.

    In order to fix this a new mutex is added to vb2_queue that is taken when
    buffers are allocated or deleted, and in vb2_mmap. That way vb2_mmap won't
    get stale buffer data. Note that this is a problem only for MEMORY_MMAP, so
    even though __qbuf_userptr and __qbuf_dmabuf also mess around with buffers
    (mem_priv in particular), this doesn't clash with vb2_mmap or
    vb2_get_unmapped_area since those are MMAP specific.

    As an additional bonus the hack in __buf_prepare, the USERPTR case, can be
    removed as well since mmap() no longer takes the core lock.

    All in all a much cleaner solution.

    Signed-off-by: Hans Verkuil
    Acked-by: Laurent Pinchart
    Acked-by: Marek Szyprowski
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • When the CCDC input is interlaced enable the alternate field order on
    the CCDC output video node. The field signal polarity is specified
    through platform data.

    Signed-off-by: Laurent Pinchart
    Tested-by: Enrico Butera
    Acked-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Laurent Pinchart
     

31 Jul, 2014

1 commit


27 Jul, 2014

3 commits


26 Jul, 2014

7 commits

  • Patch originally written by Konrad. Rebased on current linux media tree.

    Under Xen, vmalloc_32() isn't guaranteed to return pages which are really
    under 4G in machine physical addresses (only in virtual pseudo-physical
    addresses). To work around this, implement a vmalloc variant which
    allocates each page with dma_alloc_coherent() to guarantee that each
    page is suitable for the device in question.

    Signed-off-by: Konrad Rzeszutek Wilk
    Signed-off-by: James Harper
    Signed-off-by: Mauro Carvalho Chehab

    James Harper
     
  • The hole point of IR_dprintk() is that, once a level is
    given at debug parameter, all enabled IR parsers will show their
    debug messages.

    While converting it to dynamic_printk might be a good idea,
    right now it just makes very hard to debug the drivers, as
    one needs to both pass debug=1 or debug=2 to rc-core and
    to use the dynamic printk to enable all the desired lines.

    That doesn't make sense!

    So, revert to the old way, as a single line is changed,
    and the debug parameter will now work as expected.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • The si4713 supports several RDS features not yet implemented in the driver.

    This patch adds the missing RDS functionality to the list of RDS controls.

    The ALT_FREQS control is a compound control containing an array of up
    to 25 (the maximum according to the RDS standard) frequencies. To support
    that the V4L2_CTRL_TYPE_U32 was added.

    Signed-off-by: Hans Verkuil
    Cc: Eduardo Valentin
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • A lot of work was done in vb2 to regulate how drivers and the vb2 core handle
    buffer ownership, but inexplicably the videobuf2-core.h comments were never
    updated. Do so now. The same was true for the replacement of the -ENOBUFS
    mechanism by the min_buffers_needed field.

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

    Hans Verkuil
     
  • Rather than always having to use a v4l2_ext_control struct to set
    a control value from within a driver, switch to just setting the
    new value. This is faster and it makes it possible to set more
    complex types such as a string control as is added by this
    patch.

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

    Hans Verkuil
     
  • We already have dev->scancode_filter and dev->scancode_wakeup_filter
    so rename dev->scanmask to dev->scancode_mask for consistency.

    Signed-off-by: David Härdeman
    Signed-off-by: Mauro Carvalho Chehab

    David Härdeman
     
  • The basic API of rc-core used to be:

    dev = rc_allocate_device();
    dev->x = a;
    dev->y = b;
    dev->z = c;
    rc_register_device();

    which is a pretty common pattern in the kernel, after the introduction of
    protocol arrays the API looks something like:

    dev = rc_allocate_device();
    dev->x = a;
    rc_set_allowed_protocols(dev, RC_BIT_X);
    dev->z = c;
    rc_register_device();

    There's no real need for the protocols to be an array, so change it
    back to be consistent (and in preparation for the following patches).

    [m.chehab@samsung.com: added missing changes at some files]
    Signed-off-by: David Härdeman
    Signed-off-by: Mauro Carvalho Chehab

    David Härdeman
     

24 Jul, 2014

1 commit

  • Right now the protocol information is not preserved, rc-core gets handed a
    scancode but has no idea which protocol it corresponds to.

    This patch (which required reading through the source/keymap for all drivers,
    not fun) makes the protocol information explicit which is important
    documentation and makes it easier to e.g. support multiple protocols with one
    decoder (think rc5 and rc-streamzap). The information isn't used yet so there
    should be no functional changes.

    [m.chehab@samsung.com: rebased, added cxusb and removed bad whitespacing]
    Signed-off-by: David Härdeman
    Signed-off-by: Mauro Carvalho Chehab

    David Härdeman