]> asedeno.scripts.mit.edu Git - linux.git/log
linux.git
8 years ago[media] media: Support Intersil/Techwell TW686x-based video capture cards
Ezequiel Garcia [Wed, 2 Mar 2016 14:30:16 +0000 (11:30 -0300)]
[media] media: Support Intersil/Techwell TW686x-based video capture cards

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 <khalasa@piap.pl>
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] TW686x frame grabber driver
Krzysztof Hałasa [Fri, 11 Mar 2016 12:23:16 +0000 (09:23 -0300)]
[media] TW686x frame grabber driver

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 <khalasa@piap.pl>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: Improve documentation for link_setup/link_modify
Mauro Carvalho Chehab [Wed, 6 Apr 2016 13:55:25 +0000 (10:55 -0300)]
[media] media: Improve documentation for link_setup/link_modify

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 <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media-device: get rid of the spinlock
Mauro Carvalho Chehab [Wed, 6 Apr 2016 13:55:24 +0000 (10:55 -0300)]
[media] media-device: get rid of the spinlock

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: [<ffffffff81ce8933>] __driver_attach+0xa3/0x160
 #1:  (&dev->mutex){......}, at: [<ffffffff81ce8941>] __driver_attach+0xb1/0x160
 #2:  (register_mutex#5){+.+.+.}, at: [<ffffffffa10596c7>] usb_audio_probe+0x257/0x1c90 [snd_usb_audio]
 #3:  (&(&mdev->lock)->rlock){+.+.+.}, at: [<ffffffffa0e6051b>] 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:
 [<ffffffff81933901>] dump_stack+0x85/0xc4
 [<ffffffff811c6af5>] ___might_sleep+0x245/0x3a0
 [<ffffffff811c6ce5>] __might_sleep+0x95/0x1a0
 [<ffffffff8155aade>] kmem_cache_alloc_trace+0x20e/0x300
 [<ffffffffa0e66e3d>] ? media_add_link+0x4d/0x140 [media]
 [<ffffffffa0e66e3d>] media_add_link+0x4d/0x140 [media]
 [<ffffffffa0e69931>] media_create_pad_link+0xa1/0x600 [media]
 [<ffffffffa0fe11b3>] au0828_media_graph_notify+0x173/0x360 [au0828]
 [<ffffffffa0e68a6a>] ? media_gobj_create+0x1ba/0x480 [media]
 [<ffffffffa0e606fb>] media_device_register_entity+0x3ab/0x700 [media]

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] m88ds3103: fix undefined division
Peter Rosin [Wed, 16 Mar 2016 12:14:13 +0000 (09:14 -0300)]
[media] m88ds3103: fix undefined division

s32tmp in the below code may be negative, and dev->mclk_khz is an
unsigned type.

s32tmp = 0x10000 * (tuner_frequency - c->frequency);
s32tmp = DIV_ROUND_CLOSEST(s32tmp, dev->mclk_khz);

This is undefined, as DIV_ROUND_CLOSEST is undefined for negative
dividends when the divisor is of unsigned type.

So, change mclk_khz to be signed (s32).

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: platform: rcar_jpu, vsp1: Use ARCH_RENESAS
Simon Horman [Fri, 25 Mar 2016 01:46:45 +0000 (22:46 -0300)]
[media] media: platform: rcar_jpu, vsp1: Use ARCH_RENESAS

Make use of ARCH_RENESAS in place of ARCH_SHMOBILE.

This is part of an ongoing process to migrate from ARCH_SHMOBILE to
ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.

Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Update WPF and LIF maximum sizes for Gen3
Laurent Pinchart [Fri, 25 Mar 2016 09:51:06 +0000 (06:51 -0300)]
[media] v4l: vsp1: Update WPF and LIF maximum sizes for Gen3

The maximum image size supported by the WPF is 2048x2048 on Gen2 and
8190x8190 on Gen3. Update the code accordingly, and fix the maximum LIF
size for both Gen2 and Gen3.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Fix V4L2_PIX_FMT_XRGB444 format definition
Laurent Pinchart [Fri, 25 Mar 2016 08:50:02 +0000 (05:50 -0300)]
[media] v4l: vsp1: Fix V4L2_PIX_FMT_XRGB444 format definition

The format is erroneously defined with an alpha channel. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Add global alpha support for DRM pipeline
Laurent Pinchart [Thu, 24 Mar 2016 08:15:59 +0000 (05:15 -0300)]
[media] v4l: vsp1: Add global alpha support for DRM pipeline

Make the global alpha multiplier of DRM planes configurable. All the
necessary infrastructure is there, we just need to store the alpha value
passed through the DRM API.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Add Z-order support for DRM pipeline
Laurent Pinchart [Thu, 24 Mar 2016 08:15:59 +0000 (05:15 -0300)]
[media] v4l: vsp1: Add Z-order support for DRM pipeline

Make the Z-order of planes configurable by assigning RPFs to BRU inputs
dynamically based on the Z-order position.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Add support for the RPF alpha multiplier on Gen3
Laurent Pinchart [Tue, 22 Mar 2016 14:10:27 +0000 (11:10 -0300)]
[media] v4l: vsp1: Add support for the RPF alpha multiplier on Gen3

The Gen3 RPF includes an alpha multiplier that can both multiply the
alpha channel by a fixed global alpha value, and multiply the pixel
components to convert the input to premultiplied alpha.

As alpha premultiplication is available in the BRU for both Gen2 and
Gen3 we handle it there and use the Gen3 alpha multiplier for global
alpha multiplication only. This prevents conversion to premultiplied
alpha if no BRU is present in the pipeline, that use case will be
implemented later if needed.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: lut: Use display list fragments to fill LUT
Laurent Pinchart [Thu, 3 Mar 2016 17:17:11 +0000 (14:17 -0300)]
[media] v4l: vsp1: lut: Use display list fragments to fill LUT

Synchronize the userspace LUT setup with the pipeline operation by using
a display list fragment to store LUT data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: dl: Add support for multi-body display lists
Laurent Pinchart [Thu, 3 Mar 2016 16:36:34 +0000 (13:36 -0300)]
[media] v4l: vsp1: dl: Add support for multi-body display lists

Display lists support up to 8 bodies but we currently use a single one.
To support preparing display lists for large look-up tables, add support
for multi-body display lists.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: dl: Fix race conditions
Laurent Pinchart [Thu, 3 Mar 2016 12:26:47 +0000 (09:26 -0300)]
[media] v4l: vsp1: dl: Fix race conditions

The vsp1_dl_list_put() function expects to be called with the display
list manager lock held. This assumption is correct for calls from within
the vsp1_dl.c file, but not for the external calls. Fix it by taking the
lock inside the function and providing an unlocked version for the
internal callers.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: dl: Make reg_count field unsigned
Laurent Pinchart [Thu, 3 Mar 2016 12:25:47 +0000 (09:25 -0300)]
[media] v4l: vsp1: dl: Make reg_count field unsigned

The field takes positive values only, make it unsigned.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Fix LUT format setting
Laurent Pinchart [Mon, 16 Nov 2015 04:07:58 +0000 (02:07 -0200)]
[media] v4l: vsp1: Fix LUT format setting

The LUT set format handler overrides the requested format by mistake.
Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Factorize frame size enumeration code
Laurent Pinchart [Wed, 24 Feb 2016 23:25:42 +0000 (20:25 -0300)]
[media] v4l: vsp1: Factorize frame size enumeration code

Most of the entities can't perform scaling and implement the same frame
size enumeration function. Factorize the code into a single
implementation.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years agoRevert "[media] v4l2-ioctl: simplify code"
Mauro Carvalho Chehab [Wed, 13 Apr 2016 22:08:55 +0000 (19:08 -0300)]
Revert "[media] v4l2-ioctl: simplify code"

There are some issues rised on this patch during patch review.
I ended by merging this one by mistake. So, let's revert it.

This reverts commit 54ace1cfd4358fd11112f17cc711eea234d5ab9e.

Cc: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Factorize media bus codes enumeration code
Laurent Pinchart [Wed, 24 Feb 2016 23:25:42 +0000 (20:25 -0300)]
[media] v4l: vsp1: Factorize media bus codes enumeration code

Most of the entities can't perform format conversion and implement the
same media bus enumeration function. Factorize the code into a single
implementation.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Factorize get pad format code
Laurent Pinchart [Thu, 25 Feb 2016 00:10:13 +0000 (21:10 -0300)]
[media] v4l: vsp1: Factorize get pad format code

All entities implement the same get pad format handler, factorize it
into a common function.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: RPF entities can't be target nodes
Laurent Pinchart [Wed, 24 Feb 2016 21:40:12 +0000 (18:40 -0300)]
[media] v4l: vsp1: RPF entities can't be target nodes

The RPF entities are located at the very beginning of pipelines, they
can't be target nodes in the Data Path Router matrix. Remove their input
ID from the routing table.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Allocate pipelines on demand
Laurent Pinchart [Sun, 17 Jan 2016 21:53:56 +0000 (19:53 -0200)]
[media] v4l: vsp1: Allocate pipelines on demand

Instead of embedding pipelines in the vsp1_video objects allocate them
on demand when they are needed. This fixes the streamon race condition
where pipelines objects from different video nodes could be used for the
same pipeline.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: video: Reorder functions
Laurent Pinchart [Sun, 17 Jan 2016 21:55:18 +0000 (19:55 -0200)]
[media] v4l: vsp1: video: Reorder functions

Move the pipeline initialization and cleanup functions to prepare for
the next commit. No functional code change is performed here.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Store pipeline pointer in rwpf
Laurent Pinchart [Tue, 19 Jan 2016 21:16:36 +0000 (19:16 -0200)]
[media] v4l: vsp1: Store pipeline pointer in rwpf

This prepares for dynamic pipeline allocation by providing a field that
can be used to store the pipeline pointer atomically under driver
control.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Pass pipe pointer to entity configure functions
Laurent Pinchart [Thu, 14 Jan 2016 16:17:32 +0000 (14:17 -0200)]
[media] v4l: vsp1: Pass pipe pointer to entity configure functions

Pass the pipe explicitly instead of retrieving it through media
entities. This decouples device state stored in the pipeline from the
active state stored in entities, preparing for dynamic pipeline
creation.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Rename pipeline validate functions to pipeline build
Laurent Pinchart [Tue, 19 Jan 2016 21:42:56 +0000 (19:42 -0200)]
[media] v4l: vsp1: Rename pipeline validate functions to pipeline build

The primary purpose of those functions is to build the pipeline, rename
them to make this clearer.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Pass display list explicitly to configure functions
Laurent Pinchart [Sun, 22 Nov 2015 22:29:25 +0000 (20:29 -0200)]
[media] v4l: vsp1: Pass display list explicitly to configure functions

Modules write register values to the active display list pointed to by
the pipeline. In order to support preparing display lists ahead of time,
pass them explicitly to all configuration functions.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Use __vsp1_video_try_format to initialize format at init time
Laurent Pinchart [Sun, 22 Nov 2015 16:08:18 +0000 (14:08 -0200)]
[media] v4l: vsp1: Use __vsp1_video_try_format to initialize format at init time

Reuse the runtime logic to initialize the default format instead of
open-coding it. This ensures coherency between intialization and
runtime.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Merge RPF and WPF pad ops structures
Laurent Pinchart [Sun, 22 Nov 2015 15:37:45 +0000 (13:37 -0200)]
[media] v4l: vsp1: Merge RPF and WPF pad ops structures

The two structures are identical, merge them and move the result to
vsp1_rwpf.c. All rwpf pad operations can now be declared static.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Create a new configure operation to setup modules
Laurent Pinchart [Tue, 17 Nov 2015 15:10:26 +0000 (13:10 -0200)]
[media] v4l: vsp1: Create a new configure operation to setup modules

The subdev s_stream operation is abused as a generic way to setup
modules at every frame. Move the code out to a new VSP1 entity configure
operation.

Most modules now have an empty s_stream operation that can be removed.
The only exception is the WPF module that needs to perform hardware
configuration when stopping the stream. The code can be simplified
accordingly as we know that that operation never fails.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Store active selection rectangles in a pad config structure
Laurent Pinchart [Sun, 15 Nov 2015 21:14:22 +0000 (19:14 -0200)]
[media] v4l: vsp1: Store active selection rectangles in a pad config structure

Use the pad config structure part of the vsp1_entity to store all active
pad selection rectangles. This generalizes the code to operate on pad
config structures.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Store active formats in a pad config structure
Laurent Pinchart [Sun, 15 Nov 2015 21:14:22 +0000 (19:14 -0200)]
[media] v4l: vsp1: Store active formats in a pad config structure

Add a pad config structure field to the vsp1_entity structure and use it
to store all active pad formats. This generalizes the code to operate on
pad config structures.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Implement and use the subdev pad::init_cfg configuration
Laurent Pinchart [Sun, 15 Nov 2015 22:09:08 +0000 (20:09 -0200)]
[media] v4l: vsp1: Implement and use the subdev pad::init_cfg configuration

Turn the custom formats initialization function into a standard
pad::init_cfg handler and use it in subdevs instead of initializing
formats in the subdev open handler.

This makes the subdev open handler empty, so remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Add race condition FIXME comment
Laurent Pinchart [Thu, 5 Nov 2015 12:28:56 +0000 (10:28 -0200)]
[media] v4l: vsp1: Add race condition FIXME comment

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Fix BRU try compose rectangle storage
Laurent Pinchart [Sun, 15 Nov 2015 23:51:01 +0000 (21:51 -0200)]
[media] v4l: vsp1: Fix BRU try compose rectangle storage

Fix a typo that stored the try compose rectangle in the crop rectangle.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Consolidate entity ops in a struct vsp1_entity_operations
Laurent Pinchart [Tue, 17 Nov 2015 14:23:23 +0000 (12:23 -0200)]
[media] v4l: vsp1: Consolidate entity ops in a struct vsp1_entity_operations

Entities have two operations, a destroy operation stored directly in
vsp1_entity and a set_memory operation stored in a vsp1_rwpf_operations
structure. Move the two to a more generic vsp1_entity_operations
structure that will serve to implement additional operations.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Move subdev initialization code to vsp1_entity_init()
Laurent Pinchart [Sun, 15 Nov 2015 21:42:01 +0000 (19:42 -0200)]
[media] v4l: vsp1: Move subdev initialization code to vsp1_entity_init()

Don't duplicate the code in every module driver, centralize it in a
single place.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Use display lists with the userspace API
Laurent Pinchart [Sun, 1 Nov 2015 17:18:56 +0000 (15:18 -0200)]
[media] v4l: vsp1: Use display lists with the userspace API

Don't restrict display list usage to the DRM pipeline, use them
unconditionally. This prepares the driver to support the request API.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Add header display list support
Laurent Pinchart [Sun, 15 Nov 2015 00:48:27 +0000 (22:48 -0200)]
[media] v4l: vsp1: Add header display list support

Display lists can operate in header or headerless mode. The headerless
mode is only available on WPF0, to be used with the display engine. All
other WPF instances can only use display lists in header mode.

Implement support for header mode to prepare for display list usage on
WPFs other than 0.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Fix 80 characters per line violations
Laurent Pinchart [Sun, 1 Nov 2015 17:18:32 +0000 (15:18 -0200)]
[media] v4l: vsp1: Fix 80 characters per line violations

Commit f7234138f14c ("v4l2-subdev: replace v4l2_subdev_fh by
v4l2_subdev_pad_config") introduced lots of 80 characters per line
violations. Fix them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Document calling context of vsp1_pipeline_propagate_alpha()
Laurent Pinchart [Sun, 1 Nov 2015 16:01:51 +0000 (14:01 -0200)]
[media] v4l: vsp1: Document calling context of vsp1_pipeline_propagate_alpha()

The function can only be called from a s_stream handler as it requires a
valid display list context (due to calling vsp1_uds_set_alpha() which
writes to module registers). Document the requirement.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Remove unneeded entity streaming flag
Laurent Pinchart [Sun, 1 Nov 2015 15:54:34 +0000 (13:54 -0200)]
[media] v4l: vsp1: Remove unneeded entity streaming flag

The flag is set but never read, remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Don't configure RPF memory buffers before calculating offsets
Laurent Pinchart [Sun, 1 Nov 2015 15:48:11 +0000 (13:48 -0200)]
[media] v4l: vsp1: Don't configure RPF memory buffers before calculating offsets

The RPF source memory pointers need to be offset to take the crop
rectangle into account. Offsets are computed in the RPF stream start,
which can happen (when using the DRM pipeline) after calling the RPF
.set_memory() operation that programs the buffer addresses.

The .set_memory() operation tries to guard against the problem by
skipping programming of the registers when the module isn't streaming.
This will however only protect the first use of an RPF in a DRM
pipeline, as in all subsequent uses the module streaming flag will be
set and the .set_memory() operation will use potentially incorrect
offsets.

Fix this by allowing the caller to decide whether to program the
hardware immediately or just cache the addresses. While at it refactor
the memory set code and create a new vsp1_rwpf_set_memory() that cache
addresses and calls the .set_memory() operation to apply them to the
hardware.

As a side effect the driver now writes all three DMA address registers
regardless of the number of planes, and initializes unused addresses to
zero.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Enable display list support for the HS[IT], LUT, SRU and UDS
Laurent Pinchart [Sun, 1 Nov 2015 14:26:14 +0000 (12:26 -0200)]
[media] v4l: vsp1: Enable display list support for the HS[IT], LUT, SRU and UDS

Those modules were left out of display list integration as they're not
used by the DRM pipeline. To prepare for display list support in non-DRM
pipelines use the module write API to set registers.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Don't setup control handler when starting streaming
Laurent Pinchart [Sun, 1 Nov 2015 14:58:29 +0000 (12:58 -0200)]
[media] v4l: vsp1: Don't setup control handler when starting streaming

The control handler set operations don't program the hardware anymore,
there's thus no need to call them when starting the stream.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: sru: Don't program intensity in control set handler
Laurent Pinchart [Sun, 1 Nov 2015 14:19:42 +0000 (12:19 -0200)]
[media] v4l: vsp1: sru: Don't program intensity in control set handler

The datasheet clearly states that all but a few registers can't be
modified when the device is running. Programming the intensity
parameters in the control set handler is thus prohibited. Program it
when starting the module instead.

This requires storing the intensity value internally as the module can
be started from the frame completion interrupt handler, and accessing
control values requires taking a mutex.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: rwpf: Don't program alpha value in control set handler
Laurent Pinchart [Sun, 1 Nov 2015 14:19:42 +0000 (12:19 -0200)]
[media] v4l: vsp1: rwpf: Don't program alpha value in control set handler

The datasheet clearly states that all but a few registers can't be
modified when the device is running. Programming the alpha value in
the control set handler is thus prohibited. Program it when starting the
module instead.

This requires storing the alpha value internally as the module can be
started from the frame completion interrupt handler, and accessing
control values requires taking a mutex.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] vsp1: make vsp1_drm_frame_end static
Mauro Carvalho Chehab [Wed, 13 Apr 2016 20:40:48 +0000 (17:40 -0300)]
[media] vsp1: make vsp1_drm_frame_end static

As reported by smatch:
drivers/media/platform/vsp1/vsp1_drm.c:39:6: warning: no previous prototype for 'vsp1_drm_frame_end' [-Wmissing-prototypes]
 void vsp1_drm_frame_end(struct vsp1_pipeline *pipe)

Fixes: ef9621bcd664 ("[media] v4l: vsp1: Store the display list manager in the WPF")
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: bru: Don't program background color in control set handler
Laurent Pinchart [Sun, 1 Nov 2015 14:19:42 +0000 (12:19 -0200)]
[media] v4l: vsp1: bru: Don't program background color in control set handler

The datasheet clearly states that all but a few registers can't be
modified when the device is running. Programming the background color
in the control set handler is thus prohibited. Program it when starting
the module instead.

This requires storing the background color value internally as the
module can be started from the frame completion interrupt handler, and
accessing control values requires taking a mutex.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Store the display list manager in the WPF
Laurent Pinchart [Sun, 15 Nov 2015 00:27:52 +0000 (22:27 -0200)]
[media] v4l: vsp1: Store the display list manager in the WPF

Each WPF can process display lists independently, move the manager to
the WPF to reflect that and prepare for display list support for non-DRM
pipelines.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Split display list manager from display list
Laurent Pinchart [Sun, 8 Nov 2015 22:06:57 +0000 (20:06 -0200)]
[media] v4l: vsp1: Split display list manager from display list

This clarifies the API and prepares display list support for being used
to implement the request API.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Simplify frame end processing
Laurent Pinchart [Sat, 14 Nov 2015 18:33:40 +0000 (16:33 -0200)]
[media] v4l: vsp1: Simplify frame end processing

The DRM pipeline, as it runs in automatic restart mode, never sees the
pipeline state set to VSP1_PIPELINE_STOPPING or VSP1_PIPELINE_STOPPED
when running the frame end interrupt handler. We can thus skip the
checks various checks in the handler and return immediately.

Similarly the DRM frame end handler calls vsp1_pipeline_run()
unnecessarily, as the state there is never VSP1_PIPELINE_STOPPED. Remove
the function call and the frame end handler is it's now empty.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Always setup the display list
Laurent Pinchart [Sun, 1 Nov 2015 12:53:22 +0000 (10:53 -0200)]
[media] v4l: vsp1: Always setup the display list

Make sure display list usage is correctly disabled by always setting up
the corresponding registers, including when the display list feature
isn't used.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Use pipeline display list to decide how to write to modules
Laurent Pinchart [Sun, 1 Nov 2015 12:46:25 +0000 (10:46 -0200)]
[media] v4l: vsp1: Use pipeline display list to decide how to write to modules

This allows getting rid of the vsp1_device::use_dl field.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: VSPD instances have no LUT on Gen3
Laurent Pinchart [Thu, 11 Feb 2016 21:32:00 +0000 (19:32 -0200)]
[media] v4l: vsp1: VSPD instances have no LUT on Gen3

Remove the HAS_LUT flag in the corresponding device information entry.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: video: Fix coding style
Laurent Pinchart [Mon, 29 Feb 2016 02:28:38 +0000 (23:28 -0300)]
[media] v4l: vsp1: video: Fix coding style

Commit 54b5a749b4f3 ("[media] v4l: vsp1: Use media entity enumeration
interface") wasn't aligned with the driver coding style. Fix it by
renaming the rval variable to ret.

Furthermore shorten lines by accessing the media_device instance in a
more straightforward fashion.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: drm: Include correct header file
Laurent Pinchart [Sat, 20 Feb 2016 01:13:45 +0000 (23:13 -0200)]
[media] v4l: vsp1: drm: Include correct header file

The VSP1 DRM API is declared in <media/vsp1.h>, not <linux/vsp1.h>. Fix
it. This also reverts commit 18922936dc28 ("[media] vsp1_drm.h: add
missing prototypes") that added the same declarations in a different
header file.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: vsp1: Fix vsp1_du_atomic_(begin|flush) declarations
Laurent Pinchart [Sat, 20 Feb 2016 01:12:26 +0000 (23:12 -0200)]
[media] v4l: vsp1: Fix vsp1_du_atomic_(begin|flush) declarations

The functions are void, make the declaration match the definition.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: subdev: Add pad config allocator and init
Laurent Pinchart [Fri, 24 Apr 2015 23:06:31 +0000 (20:06 -0300)]
[media] v4l: subdev: Add pad config allocator and init

Add a new subdev operation to initialize a subdev pad config array, and
a helper function to allocate and initialize the array. This can be used
by bridge drivers to implement try format based on subdev pad
operations.

Signed-off-by: Laurent Pinchart <laurent.pinchart@linaro.org>
Acked-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: Rename is_media_entity_v4l2_io to is_media_entity_v4l2_video_device
Laurent Pinchart [Mon, 29 Feb 2016 11:45:45 +0000 (08:45 -0300)]
[media] media: Rename is_media_entity_v4l2_io to is_media_entity_v4l2_video_device

All users of is_media_entity_v4l2_io() (the exynos4-is, omap3isp,
davince_vpfe and omap4iss drivers and the v4l2-mc power management code)
use the function to check whether entities are video_device instances,
either to ensure they can cast the entity to a struct video_device, or
to count the number of video nodes users.

The purpose of the function is thus to identify whether the media entity
instance is an instance of the video_device object, not to check whether
it can perform I/O. Rename it accordingly, we will introduce a more
specific is_media_entity_v4l2_io() check when needed.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: Add obj_type field to struct media_entity
Laurent Pinchart [Mon, 29 Feb 2016 11:45:44 +0000 (08:45 -0300)]
[media] media: Add obj_type field to struct media_entity

Code that processes media entities can require knowledge of the
structure type that embeds a particular media entity instance in order
to cast the entity to the proper object type. This needs is shown by the
presence of the is_media_entity_v4l2_io and is_media_entity_v4l2_subdev
functions.

The implementation of those two functions relies on the entity function
field, which is both a wrong and an inefficient design, without even
mentioning the maintenance issue involved in updating the functions
every time a new entity function is added. Fix this by adding add an
obj_type field to the media entity structure to carry the information.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] soc_camera: rcar_vin: add device tree support for r8a7792
Simon Horman [Tue, 15 Mar 2016 00:40:27 +0000 (21:40 -0300)]
[media] soc_camera: rcar_vin: add device tree support for r8a7792

Simply document new compatibility string.
As a previous patch adds a generic R-Car Gen2 compatibility string
there appears to be no need for a driver updates.

By documenting this compat string it may be used in DTSs shipped, for
example as part of ROMs. It must be used in conjunction with the Gen2
fallback compat string. At this time there are no known differences between
the r8a7792 IP block and that implemented by the driver for the Gen2
fallback compat string. Thus there is no need to update the driver as the
use of the Gen2 fallback compat string will activate the correct code in
the current driver while leaving the option for r8a7792-specific driver
code to be activated in an updated driver should the need arise.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] soc_camera: rcar_vin: add R-Car Gen 2 and 3 fallback compatibility strings
Yoshihiro Kaneko [Tue, 15 Mar 2016 00:40:26 +0000 (21:40 -0300)]
[media] soc_camera: rcar_vin: add R-Car Gen 2 and 3 fallback compatibility strings

Add fallback compatibility string for R-Car Gen 1 and 2.

In the case of Renesas R-Car hardware we know that there are generations of
SoCs, e.g. Gen 2 and 3. But beyond that it's unclear what the relationship
between IP blocks might be. For example, I believe that r8a7790 is older
than r8a7791 but that doesn't imply that the latter is a descendant of the
former or vice versa.

We can, however, by examining the documentation and behaviour of the
hardware at run-time observe that the current driver implementation appears
to be compatible with the IP blocks on SoCs within a given generation.

For the above reasons and convenience when enabling new SoCs a
per-generation fallback compatibility string scheme being adopted for
drivers for Renesas SoCs.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] sh_mobile_ceu_camera: Remove dependency on SUPERH
Simon Horman [Tue, 8 Mar 2016 01:03:58 +0000 (22:03 -0300)]
[media] sh_mobile_ceu_camera: Remove dependency on SUPERH

A dependency on ARCH_SHMOBILE seems to be the best option for
sh_mobile_ceu_camera:

* For Super H based SoCs: sh_mobile_ceu is used on SH_AP325RXA, SH_ECOVEC,
  SH_KFR2R09, SH_MIGOR, and SH_7724_SOLUTION_ENGINE which depend on
  CPU_SUBTYPE_SH7722, CPU_SUBTYPE_SH7723, or CPU_SUBTYPE_SH7724 which all
  select ARCH_SHMOBILE.

* For ARM Based SoCs: Since the removal of legacy (non-multiplatform)
  support this driver has not been used by any Renesas ARM based SoCs.
  The Renesas ARM based SoCs currently select ARCH_SHMOBILE, however,
  it is planned that this will no longer be the case.

This is part of an ongoing process to migrate from ARCH_SHMOBILE to
ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.

Thanks to Geert Uytterhoeven for analysis and portions of the
change log text.

Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] rcar_vin: Use ARCH_RENESAS
Simon Horman [Tue, 8 Mar 2016 01:03:55 +0000 (22:03 -0300)]
[media] rcar_vin: Use ARCH_RENESAS

Make use of ARCH_RENESAS in place of ARCH_SHMOBILE.

This is part of an ongoing process to migrate from ARCH_SHMOBILE to
ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] au0828: remove unused macro
Guennadi Liakhovetski [Wed, 6 Apr 2016 03:26:56 +0000 (00:26 -0300)]
[media] au0828: remove unused macro

An V4L2_CID_PRIVATE_SHARPNESS macro is defined in the au0828 driver, but
never used. Remove it.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] m5mols: potential uninitialized variable
Dan Carpenter [Tue, 15 Mar 2016 07:07:10 +0000 (04:07 -0300)]
[media] m5mols: potential uninitialized variable

Smatch complains that there are some paths where "status" isn't
initialized.  The code does assume that m5mols_read_u8() can fail so it
seems as if Smatch is correct.

Let's initialize it to REG_ISO_AUTO which is zero.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] cx23885: uninitialized variable in cx23885_av_work_handler()
Dan Carpenter [Tue, 15 Mar 2016 07:05:20 +0000 (04:05 -0300)]
[media] cx23885: uninitialized variable in cx23885_av_work_handler()

The "handled" variable could be uninitialized if the
interrupt_service_routine() call back hasn't been implimented or if it
has been implemented but doesn't initialize "handled" to zero at the
start.  For example, adv76xx_isr() only sets "handled" to true.

Fixes: 44b153ca639f ('[media] m5mols: Add ISO sensitivity controls')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] am437x-vpfe: fix an uninitialized variable bug
Dan Carpenter [Tue, 15 Mar 2016 07:04:12 +0000 (04:04 -0300)]
[media] am437x-vpfe: fix an uninitialized variable bug

If we are doing V4L2_FIELD_NONE then "ret" is used uninitialized.

Fixes: 417d2e507edc ('[media] media: platform: add VPFE capture driver support for AM437X')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] am437x-vfpe: fix typo in vpfe_get_app_input_index
Arnd Bergmann [Mon, 14 Mar 2016 22:40:08 +0000 (19:40 -0300)]
[media] am437x-vfpe: fix typo in vpfe_get_app_input_index

gcc-6 points out an obviously silly comparison in vpfe_get_app_input_index():

drivers/media/platform/am437x/am437x-vpfe.c: In function 'vpfe_get_app_input_index':
drivers/media/platform/am437x/am437x-vpfe.c:1709:27: warning: self-comparison always evaluats to true [-Wtautological-compare]
       client->adapter->nr == client->adapter->nr) {
                           ^~

This was introduced in a slighly incorrect conversion, and it's
clear that the comparison was meant to compare the iterator
to the current subdev instead, as we do in the line above.

Fixes: d37232390fd4 ("[media] media: am437x-vpfe: match the OF node/i2c addr instead of name")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] cobalt: add MTD dependency
Arnd Bergmann [Mon, 14 Mar 2016 22:40:07 +0000 (19:40 -0300)]
[media] cobalt: add MTD dependency

The cobalt driver fails to link when it is built-in and MTD is disabled or a
loadable module:

drivers/media/built-in.o: In function `cobalt_flash_probe':
:(.text+0xb8b46): undefined reference to `mtd_device_parse_register'
:(.text+0xb8b88): undefined reference to `do_map_probe'
drivers/media/built-in.o: In function `cobalt_flash_remove':
:(.text+0xb8bb4): undefined reference to `mtd_device_unregister'
:(.text+0xb8bbe): undefined reference to `map_destroy'

This adds a Kconfig dependency to ensure we can call the API.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: v4l2-compat-ioctl32: fix missing reserved field copy in put_v4l2_create32
Tiffany Lin [Mon, 14 Mar 2016 11:16:14 +0000 (08:16 -0300)]
[media] media: v4l2-compat-ioctl32: fix missing reserved field copy in put_v4l2_create32

In v4l2-compliance utility, test VIDIOC_CREATE_BUFS will check whether reserved
filed of v4l2_create_buffers filled with zero
Reserved field is filled with zero in v4l_create_bufs.
This patch copy reserved field of v4l2_create_buffer from kernel space to user
space

Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org> # for v3.19 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] dw2102: fix unreleased firmware
Sudip Mukherjee [Mon, 7 Mar 2016 10:26:55 +0000 (07:26 -0300)]
[media] dw2102: fix unreleased firmware

On the particular case when the product id is 0x2101 we have requested
for a firmware but after processing it we missed releasing it.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] cx231xx: return proper error codes at cx231xx-417.c
Mauro Carvalho Chehab [Wed, 13 Apr 2016 20:02:20 +0000 (17:02 -0300)]
[media] cx231xx: return proper error codes at cx231xx-417.c

Instead of returning -1, return valid error codes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] cx231xx: fix memory leak
Sudip Mukherjee [Mon, 7 Mar 2016 10:22:23 +0000 (07:22 -0300)]
[media] cx231xx: fix memory leak

When we returned on error we missed freeing p_current_fw and p_buffer.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l2-ioctl: simplify code
Hans Verkuil [Mon, 29 Feb 2016 10:16:39 +0000 (07:16 -0300)]
[media] v4l2-ioctl: simplify code

Instead of a big if at the beginning, just check if g_selection == NULL
and call the cropcap op immediately and return the result.

No functional changes in this patch.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] vivid: set device_caps in video_device
Hans Verkuil [Tue, 1 Mar 2016 14:57:25 +0000 (11:57 -0300)]
[media] vivid: set device_caps in video_device

This simplifies the querycap function.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l2-pci-skeleton.c: fill in device_caps in video_device
Hans Verkuil [Tue, 1 Mar 2016 14:57:24 +0000 (11:57 -0300)]
[media] v4l2-pci-skeleton.c: fill in device_caps in video_device

With the new core support for the caps the driver no longer needs
to set device_caps and capabilities in the querycap call.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l2: add device_caps to struct video_device
Hans Verkuil [Tue, 1 Mar 2016 14:57:23 +0000 (11:57 -0300)]
[media] v4l2: add device_caps to struct video_device

Instead of letting drivers fill in device_caps at querycap time,
let them fill it in when the video device is registered.

This has the advantage that in the future the v4l2 core can access
the video device's capabilities and take decisions based on that.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] exynos-gsc: remove an always false condition
Mauro Carvalho Chehab [Wed, 13 Apr 2016 19:29:31 +0000 (16:29 -0300)]
[media] exynos-gsc: remove an always false condition

As reported by smatch:
drivers/media/platform/exynos-gsc/gsc-core.c:1073 gsc_probe() warn: impossible condition '(gsc->id < 0) => (0-65535 < 0)'
drivers/media/platform/exynos-gsc/gsc-core.c: In function 'gsc_probe':
drivers/media/platform/exynos-gsc/gsc-core.c:1073:51: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  if (gsc->id >= drv_data->num_entities || gsc->id < 0) {
                                                   ^

gsc->id is an u16, so it can never be a negative number. So,
remove the always false condition.

Fixes: c1ac057173ba "[media] exynos-gsc: remove non-device-tree init code"
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] s5p-tv: constify mxr_layer_ops structures
Julia Lawall [Sun, 15 Nov 2015 20:08:23 +0000 (18:08 -0200)]
[media] s5p-tv: constify mxr_layer_ops structures

The mxr_layer_ops structures are never modified, so declare
them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] exynos4-is: remove non-device-tree init code
Marek Szyprowski [Wed, 9 Dec 2015 14:00:16 +0000 (12:00 -0200)]
[media] exynos4-is: remove non-device-tree init code

Exynos and Samsung S5P platforms has been fully converted to device
tree, so old platform device based init data can be now removed.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] s5p-mfc: remove non-device-tree init code
Marek Szyprowski [Wed, 9 Dec 2015 14:00:15 +0000 (12:00 -0200)]
[media] s5p-mfc: remove non-device-tree init code

Exynos and Samsung S5P platforms has been fully converted to device
tree, so old platform device based init data can be now removed.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] s5p-g2d: remove non-device-tree init code
Marek Szyprowski [Wed, 9 Dec 2015 14:00:14 +0000 (12:00 -0200)]
[media] s5p-g2d: remove non-device-tree init code

Exynos and Samsung S5P platforms has been fully converted to device
tree, so old platform device based init data can be now removed.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] exynos-gsc: remove non-device-tree init code
Marek Szyprowski [Wed, 9 Dec 2015 14:00:13 +0000 (12:00 -0200)]
[media] exynos-gsc: remove non-device-tree init code

Exynos platform has been fully converted to device tree,
so old platform device based init data can be now removed.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] s5p-jpeg: Adjust buffer size for Exynos 4412
Andrzej Pietrasiewicz [Tue, 8 Dec 2015 14:39:08 +0000 (12:39 -0200)]
[media] s5p-jpeg: Adjust buffer size for Exynos 4412

Eliminate iommu fault during encoding by adjusting image size
used for buffer size computation and ensuring that the buffer
is not overrun.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] exynos4-is: Put node before s5pcsis_parse_dt() return error
Javier Martinez Canillas [Fri, 4 Mar 2016 20:20:12 +0000 (17:20 -0300)]
[media] exynos4-is: Put node before s5pcsis_parse_dt() return error

The MIPI CSIS DT parse function return an -ENXIO errno if the port #
is outside of the supported values. But it doesn't call of_node_put()
to decrement the node's reference counter, that's incremented inside
the of_graph_get_next_endpoint() function that was called before.

Instead of just returning, go to the error path that already does it.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] exynos4-is: Add missing port parent of_node_put on error paths
Krzysztof Kozlowski [Tue, 26 Jan 2016 00:41:46 +0000 (22:41 -0200)]
[media] exynos4-is: Add missing port parent of_node_put on error paths

In fimc_md_parse_port_node() remote port parent node is acquired with
of_graph_get_remote_port_parent() but it is not put on error path.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] au0828: Unregister notifiers
Mauro Carvalho Chehab [Wed, 16 Mar 2016 12:04:04 +0000 (05:04 -0700)]
[media] au0828: Unregister notifiers

If au0828 gets removed, we need to remove the notifiers.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media-devnode: add missing mutex lock in error handler
Max Kellermann [Mon, 21 Mar 2016 11:33:12 +0000 (04:33 -0700)]
[media] media-devnode: add missing mutex lock in error handler

We should protect the device unregister patch too, at the error
condition.

Signed-off-by: Max Kellermann <max@duempel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media-device: make topology_version u64
Mauro Carvalho Chehab [Wed, 16 Mar 2016 12:34:39 +0000 (05:34 -0700)]
[media] media-device: make topology_version u64

The uAPI defines it with 64 bits. Let's change the Kernel
implementation too.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media-device: Fix a comment
Mauro Carvalho Chehab [Wed, 16 Mar 2016 12:04:03 +0000 (05:04 -0700)]
[media] media-device: Fix a comment

The comment is for the wrong function. Fix it.

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years agoMerge tag 'media/v4.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Tue, 5 Apr 2016 13:47:50 +0000 (06:47 -0700)]
Merge tag 'media/v4.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:
 "Some bug fixes on au0828 and snd-usb-audio:

   - the au0828+snd-usb-audio MC patch broke several things and produced
     some race conditions.  Better to revert the patches, and re-work on
     them for a next version

   - fix a regression at tuner disable links logic

   - properly handle dev_state as a bitmask"

* tag 'media/v4.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] Revert "[media] media: au0828 change to use Managed Media Controller API"
  [media] Revert "[media] sound/usb: Use Media Controller API to share media resources"
  [media] au0828: Fix dev_state handling
  [media] au0828: fix au0828_v4l2_close() dev_state race condition
  [media] media: au0828 fix to clear enable/disable/change source handlers
  [media] v4l2-mc: cleanup a warning
  [media] au0828: disable tuner links and cache tuner/decoder

8 years agoMerge tag 'linux-kselftest-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 4 Apr 2016 23:56:49 +0000 (16:56 -0700)]
Merge tag 'linux-kselftest-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest fixes from Shuah Khan:
 "This update for Kselftest contains seccomp fixes"

* tag 'linux-kselftest-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftest/seccomp: Fix the seccomp(2) signature
  selftest/seccomp: Fix the flag name SECCOMP_FILTER_FLAG_TSYNC

8 years agoMerge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Linus Torvalds [Mon, 4 Apr 2016 23:53:26 +0000 (16:53 -0700)]
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus

Pull MIPS fixes from Ralf Baechle:
 "This is the first round of MIPS fixes for 4.6:

   - Fix spelling mistakes all over arch/mips
   - Provide __bswapsi2 so XZ kernel compression will build with older GCC
   - ATH79 clock fixes.
   - Fix clock-rated copy-paste erros in ATH79 DTS.
   - Fix gisb-arb compatible string for 7435 BMIPS
   - Enable NAND and UBIFS support in CI20.
   - Fix BUG() assertion caused by inapropriate smp_processor_id() use.
   - Fix exception handling issues for the sake of debuggers
   - Fix the last remaining instance of irq_to_gpio in the db1xxx_ss PCMCIA code
   - Fix MSA unaligned load failures
   - Panic if kernel is configured for a not TLB-supported page size
   - Bail out on unsupported relocs in modules.
   - Partial fix for Qemu breakage after recent IPI rewrite
   - Wire up the preadv2 and pwrite2 syscalls
   - Fix the ar724x clock calculation"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
  MIPS: traps.c: Verify the ISA for microMIPS RDHWR emulation
  MIPS: BMIPS: Fix gisb-arb compatible string for 7435
  MIPS: Bail on unsupported module relocs
  MIPS: dts: qca: ar9132_tl_wr1043nd_v1.dts: use "ref" for reference clock name
  MIPS: ath79: Fix the ar913x reference clock rate
  MIPS: ath79: Fix the ar724x clock calculation
  dt-bindings: clock: qca,ath79-pll: fix copy-paste typos
  MIPS: traps: Correct the SIGTRAP debug ABI in `do_watch' and `do_trap_or_bp'
  FIRMWARE: Broadcom: Fix grammar of warning messages in bcm47xx_sprom.c.
  MIPS: ci20: Enable NAND and UBIFS support in defconfig.
  MIPS: Fix misspellings in comments.
  MIPS: tlb-r4k: panic if the MMU doesn't support PAGE_SIZE
  MIPS: zboot: Remove copied source files on clean
  MIPS: zboot: Fix the build with XZ compression on older GCC versions
  MIPS: Wire up preadv2 and pwrite2 syscalls.
  MIPS: cpu_name_string: Use raw_smp_processor_id().
  pcmcia: db1xxx_ss: fix last irq_to_gpio user
  MIPS: Fix MSA ld unaligned failure cases
  MIPS: Fix broken malta qemu

8 years agoMerge tag 'for-linus-4.6-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 4 Apr 2016 23:38:36 +0000 (16:38 -0700)]
Merge tag 'for-linus-4.6-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen fixes from David Vrabel:
 "Regression and bug fixes for 4.6-rc2:

   - safely migrate event channels between CPUs
   - fix CPU hotplug
   - maintainer changes"

* tag 'for-linus-4.6-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  MAINTAINERS: xen: Konrad to step down and Juergen to pick up
  xen/events: Mask a moving irq
  Xen on ARM and ARM64: update MAINTAINERS info
  xen/x86: Call cpu_startup_entry(CPUHP_AP_ONLINE_IDLE) from xen_play_dead()
  xen/apic: Provide Xen-specific version of cpu_present_to_apicid APIC op

8 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Linus Torvalds [Mon, 4 Apr 2016 20:18:27 +0000 (13:18 -0700)]
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull quota fixes from Jan Kara:
 "Fixes for oopses when the new quotactl gets used with quotas disabled"

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  ocfs2: Fix Q_GETNEXTQUOTA for filesystem without quotas
  quota: Handle Q_GETNEXTQUOTA when quota is disabled

8 years agoMerge tag 'f2fs-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs
Linus Torvalds [Mon, 4 Apr 2016 20:00:39 +0000 (13:00 -0700)]
Merge tag 'f2fs-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs

Pull f2fs fixes from Jaegeuk Kim.

* tag 'f2fs-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs:
  f2fs: retrieve IO write stat from the right place
  f2fs crypto: fix corrupted symlink in encrypted case
  f2fs: cover large section in sanity check of super

8 years agogma500: remove annoying deprecation warning
Linus Torvalds [Mon, 4 Apr 2016 19:38:46 +0000 (12:38 -0700)]
gma500: remove annoying deprecation warning

In commit e45708976aea ("drm/dp-helper: Move the legacy helpers to
gma500") the legacy i2c helpers were moved to the only remaining user of
them, the gma500 driver.  Together with that move, i2c_dp_aux_add_bus()
was marked deprecated and started warning about its remaining use.

It's now been a year and a half of annoying warning, and apparently
nobody cares enough about gma500 to try to move it along to the more
modern models.

Get rid of the warning - if even the gma500 people don't care enough,
then they should certainly not spam other innocent developers with a
warning that might hide other, much more real issues.

Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8 years agoMerge branch 'PAGE_CACHE_SIZE-removal'
Linus Torvalds [Mon, 4 Apr 2016 17:50:24 +0000 (10:50 -0700)]
Merge branch 'PAGE_CACHE_SIZE-removal'

Merge PAGE_CACHE_SIZE removal patches from Kirill Shutemov:
 "PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
  ago with promise that one day it will be possible to implement page
  cache with bigger chunks than PAGE_SIZE.

  This promise never materialized.  And unlikely will.

  Let's stop pretending that pages in page cache are special.  They are
  not.

  The first patch with most changes has been done with coccinelle.  The
  second is manual fixups on top.

  The third patch removes macros definition"

[ I was planning to apply this just before rc2, but then I spaced out,
  so here it is right _after_ rc2 instead.

  As Kirill suggested as a possibility, I could have decided to only
  merge the first two patches, and leave the old interfaces for
  compatibility, but I'd rather get it all done and any out-of-tree
  modules and patches can trivially do the converstion while still also
  working with older kernels, so there is little reason to try to
  maintain the redundant legacy model.    - Linus ]

* PAGE_CACHE_SIZE-removal:
  mm: drop PAGE_CACHE_* and page_cache_{get,release} definition
  mm, fs: remove remaining PAGE_CACHE_* and page_cache_{get,release} usage
  mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros