21 Apr, 2016

26 commits

  • The test pattern generator will be used by other drivers as the virtual
    media controller (vimc)

    Signed-off-by: Helen Mae Koike Fornazier
    Acked-by: Laurent Pinchart
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Helen Mae Koike Fornazier
     
  • The v4l2_rect helper functions have been moved to
    include/media/v4l2-rect.h. Use this new header, dropping the functions
    from vivid.

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

    Hans Verkuil
     
  • This makes it easier to share this code with any driver that needs to
    manipulate the v4l2_rect datastructure.

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

    Hans Verkuil
     
  • Instead of rolling our own define, just use the new mask defines.

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

    Hans Verkuil
     
  • The v4l2_device_call_* defines filter subdevs based on the grp_id value.
    But some drivers use a bitmask, so instead of filtering by grp_id == value,
    you want to filter by grp_id & value.

    Make variants of these defines to do this.

    The 'has_op' define has been extended to have a grp_id argument as well, and
    a mask variant has been added.

    This extra argument required a change to go7007.

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

    Hans Verkuil
     
  • The ADV7180 supports NTSC, PAL and SECAM.

    Signed-off-by: Niklas Söderlund
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Niklas Söderlund
     
  • Add support to get the pixel aspect ratio depending on the current
    standard (50 vs 60 Hz).

    Signed-off-by: Niklas Söderlund
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Niklas Söderlund
     
  • Add support to get the standard to the adv7180 driver.

    Signed-off-by: Niklas Söderlund
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Niklas Söderlund
     
  • This patch defines region_configs[] array as const array since it
    is not changed anywhere in code.

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

    Claudiu Beznea
     
  • The DV_TIMINGS_CAP documentation didn't state clearly that the pad and
    reserved fields should be zeroed by the application. For subdev pad can
    be other values as well.

    It also mistakenly said that only drivers would have to zero the reserved
    field, that's not correct.

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

    Hans Verkuil
     
  • The ENUM_DV_TIMINGS documentation did not clearly state that the pad and reserved
    fields should be zeroed (pad only when used with a video device node).

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

    Hans Verkuil
     
  • The G/S_EDID documentation did not explicitly state that the reserved array
    should be zeroed by the application.

    Also add the missing VIDIOC_SUBDEV_G/S_EDID ioctl names to the header.

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

    Hans Verkuil
     
  • v4l2-compliance complained about this.

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

    Hans Verkuil
     
  • Fix this smatch error:

    dib0090.c:1124 dib0090_pwm_gain_reset() error: we previously assumed 'state->rf_ramp' could be null (see line 1086)

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

    Hans Verkuil
     
  • These are false positives, but still easy to fix.

    pvrusb2-hdw.c:3676 pvr2_send_request_ex() error: we previously assumed 'write_data' could be null (see line 3648)
    pvrusb2-hdw.c:3829 pvr2_send_request_ex() error: we previously assumed 'read_data' could be null (see line 3649)

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

    Hans Verkuil
     
  • The smatch utility got really confused about the grp % 22 code. Rewrote
    it so it now understands that there really isn't a buffer overwrite.

    vivid-rds-gen.c:82 vivid_rds_generate() error: buffer overflow 'rds->psname' 9
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Set vb2_queue.gfp_flags to GFP_DMA32. Otherwise it will start to
    create bounce buffers which is something you want to avoid since
    those are in limited supply.

    Without this patch, DMA scatter-gather may not work because
    machines can ran out of buffers easily.

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

    Ezequiel Garcia
     
  • Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

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

    Hans Verkuil
     
  • The mainline tw686x driver also supports audio, that's missing here
    as well.

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

    Hans Verkuil
     
  • Set vb2_queue.gfp_flags to GFP_DMA32. Otherwise it will start to
    create bounce buffers which is something you want to avoid since
    those are in limited supply.

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

    Hans Verkuil
     
  • the dma_requests field is cached, but cache is not used:

    drivers/staging/media/tw686x-kh/tw686x-kh-video.c: In function 'tw686x_video_irq':
    drivers/staging/media/tw686x-kh/tw686x-kh-video.c:622:6: warning: variable 'requests' set but not used [-Wunused-but-set-variable]
    u32 requests;
    ^

    Use the cache instead, as it seems reading it needs to be done
    with spin lock taken.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • This commit introduces the support for the Techwell TW686x video
    capture IC. This hardware supports a few DMA modes, including
    scatter-gather and frame (contiguous).

    This commit makes little use of the DMA engine and instead has
    a memcpy based implementation. DMA frame and scatter-gather modes
    support may be added in the future.

    Currently supported chips:
    - TW6864 (4 video channels),
    - TW6865 (4 video channels, not tested, second generation chip),
    - TW6868 (8 video channels but only 4 first channels using
    built-in video decoder are supported, not tested),
    - TW6869 (8 video channels, second generation chip).

    [mchehab@osg.samsung.com: make checkpatch happy by using "unsigned int"
    instead of just "unsigned"]
    Cc: Krzysztof Halasa
    Signed-off-by: Ezequiel Garcia
    Signed-off-by: Hans Verkuil
    Tested-by: Hans Verkuil

    Signed-off-by: Mauro Carvalho Chehab

    Ezequiel Garcia
     
  • A driver for Intersil/Techwell TW686x-based PCIe frame grabbers.

    [hans.verkuil@cisco.com: renamed staging tw686x to tw686x-kh to prevent naming conflicts]
    [hans.verkuil@cisco.com: don't build tw686x-kh if tw686x is already selected to prevent conflicts]
    [mchehab@osg.samsung.com: use "unsigned int" instead of just "unsigned" and add some whitespaces to make checkpatch happier]
    Signed-off-by: Krzysztof Halasa
    Signed-off-by: Hans Verkuil
    Tested-by: Hans Verkuil

    Signed-off-by: Mauro Carvalho Chehab

    Krzysztof Hałasa
     
  • Those callbacks are called with the media_device.graph_mutex held.

    Add a note about that, as the code called by those notifiers should
    not be touching in the mutex.

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

    Mauro Carvalho Chehab
     
  • Right now, the lock schema for media_device struct is messy,
    since sometimes, it is protected via a spin lock, while, for
    media graph traversal, it is protected by a mutex.

    Solve this conflict by always using a mutex.

    As a side effect, this prevents a bug when the media notifiers
    is called at atomic context, while running the notifier callback:

    BUG: sleeping function called from invalid context at mm/slub.c:1289
    in_atomic(): 1, irqs_disabled(): 0, pid: 3479, name: modprobe
    4 locks held by modprobe/3479:
    #0: (&dev->mutex){......}, at: [] __driver_attach+0xa3/0x160
    #1: (&dev->mutex){......}, at: [] __driver_attach+0xb1/0x160
    #2: (register_mutex#5){+.+.+.}, at: [] usb_audio_probe+0x257/0x1c90 [snd_usb_audio]
    #3: (&(&mdev->lock)->rlock){+.+.+.}, at: [] media_device_register_entity+0x1cb/0x700 [media]
    CPU: 2 PID: 3479 Comm: modprobe Not tainted 4.5.0-rc3+ #49
    Hardware name: /NUC5i7RYB, BIOS RYBDWi35.86A.0350.2015.0812.1722 08/12/2015
    0000000000000000 ffff8803b3f6f288 ffffffff81933901 ffff8803c4bae000
    ffff8803c4bae5c8 ffff8803b3f6f2b0 ffffffff811c6af5 ffff8803c4bae000
    ffffffff8285d7f6 0000000000000509 ffff8803b3f6f2f0 ffffffff811c6ce5
    Call Trace:
    [] dump_stack+0x85/0xc4
    [] ___might_sleep+0x245/0x3a0
    [] __might_sleep+0x95/0x1a0
    [] kmem_cache_alloc_trace+0x20e/0x300
    [] ? media_add_link+0x4d/0x140 [media]
    [] media_add_link+0x4d/0x140 [media]
    [] media_create_pad_link+0xa1/0x600 [media]
    [] au0828_media_graph_notify+0x173/0x360 [au0828]
    [] ? media_gobj_create+0x1ba/0x480 [media]
    [] media_device_register_entity+0x3ab/0x700 [media]

    Reviewed-by: Javier Martinez Canillas
    Acked-by: Sakari Ailus
    Acked-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

14 Apr, 2016

14 commits