OSDN Git Service

uclinux-h8/linux.git
6 years agomedia: ov13858: Correct link-frequency and pixel-rate
Chiranjeevi Rapolu [Sat, 29 Jul 2017 07:00:39 +0000 (03:00 -0400)]
media: ov13858: Correct link-frequency and pixel-rate

Previously both link-frequency and pixel-rate reported by
the sensor was incorrect, resulting in incorrect FPS.
Report link-frequency in Hz rather than link data rate in bps.
Calculate pixel-rate from link-frequency.

Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov13858: Fix initial expsoure max
Chiranjeevi Rapolu [Thu, 27 Jul 2017 07:44:19 +0000 (03:44 -0400)]
media: ov13858: Fix initial expsoure max

Previously, initial exposure max was set incorrectly to (0x7fff - 8).
Now, limit exposure max to current resolution (VTS - 8).

Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov13858: Set default fps as current fps
Chiranjeevi Rapolu [Thu, 27 Jul 2017 07:28:05 +0000 (03:28 -0400)]
media: ov13858: Set default fps as current fps

On format change, sometimes, sensor was streaming at a much higher
FPS than the default. This was resulting in various problems like
frame drops/corruption.

Upon format change, set default vblank as current vblank. This will
ensure that sensor will start streaming at default fps.

Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: cx231xx: only unregister successfully registered i2c adapters
Peter Rosin [Mon, 31 Jul 2017 13:38:52 +0000 (09:38 -0400)]
media: cx231xx: only unregister successfully registered i2c adapters

This prevents potentially scary debug messages from the i2c core.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: media: atomisp: constify video_subdev structures
Julia Lawall [Tue, 8 Aug 2017 10:58:29 +0000 (06:58 -0400)]
media: staging: media: atomisp: constify video_subdev structures

These structures are both stored in fields of v4l2_subdev_ops
structures, all of which are const, so these structures can be
const as well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: media: atomisp: remove trailing whitespace
Stephen Brennan [Tue, 25 Jul 2017 06:04:10 +0000 (02:04 -0400)]
media: staging: media: atomisp: remove trailing whitespace

Signed-off-by: Stephen Brennan <stephen@brennan.io>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: media: atomisp: i2c: gc0310: fixed brace coding style issue
Rene Hickersberger [Mon, 31 Jul 2017 11:43:15 +0000 (07:43 -0400)]
media: staging: media: atomisp: i2c: gc0310: fixed brace coding style issue

Fixed a brace coding style issue.

Signed-off-by: Rene Hickersberger <renehickersberger@gmx.net>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: media: atomisp: constify videobuf_queue_ops structures
Julia Lawall [Fri, 4 Aug 2017 12:09:45 +0000 (08:09 -0400)]
media: staging: media: atomisp: constify videobuf_queue_ops structures

These videobuf_queue_ops structures are only passed as the second
argument to videobuf_queue_vmalloc_init, which is declared as const.
Thus the videobuf_queue_ops structures themselves can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct videobuf_queue_ops i@p = { ... };

@ok1@
identifier r.i;
expression e1;
position p;
@@
videobuf_queue_vmalloc_init(e1,&i@p,...)

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct videobuf_queue_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct videobuf_queue_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: media: atomisp: use kvmalloc/kvzalloc
Geliang Tang [Mon, 7 Aug 2017 13:44:27 +0000 (09:44 -0400)]
media: staging: media: atomisp: use kvmalloc/kvzalloc

Use kvmalloc()/kvzalloc() instead of atomisp_kernel_malloc()
/atomisp_kernel_zalloc().

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: MAINTAINERS: add entry for meson ao cec driver
Hans Verkuil [Tue, 8 Aug 2017 14:18:30 +0000 (10:18 -0400)]
media: MAINTAINERS: add entry for meson ao cec driver

Add entry to the MAINTAINERS file for the meson ao cec driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: platform: Add Amlogic Meson AO CEC Controller driver
Neil Armstrong [Thu, 27 Jul 2017 15:20:29 +0000 (11:20 -0400)]
media: platform: Add Amlogic Meson AO CEC Controller driver

The Amlogic SoC embeds a standalone CEC controller, this patch adds a driver
for such controller.
The controller does not need HPD to be active, and could support up to max
5 logical addresses, but only 1 is handled since the Suspend firmware can
make use of this unique logical address to wake up the device.

The Suspend firmware configuration will be added in an other patchset.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com:s/if (ret)/if (res)/ to fix obvious typo]
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dt-bindings: media: Add Amlogic Meson AO-CEC bindings
Neil Armstrong [Thu, 27 Jul 2017 15:20:30 +0000 (11:20 -0400)]
media: dt-bindings: media: Add Amlogic Meson AO-CEC bindings

The Amlogic SoCs embeds a standalone CEC Controller, this patch adds this
device bindings.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: v4l2-compat-ioctl32: Fix timespec conversion
Daniel Mentz [Thu, 3 Aug 2017 03:42:17 +0000 (23:42 -0400)]
media: v4l2-compat-ioctl32: Fix timespec conversion

Certain syscalls like recvmmsg support 64 bit timespec values for the
X32 ABI. The helper function compat_put_timespec converts a timespec
value to a 32 bit or 64 bit value depending on what ABI is used. The
v4l2 compat layer, however, is not designed to support 64 bit timespec
values and always uses 32 bit values. Hence, compat_put_timespec must
not be used.

Without this patch, user space will be provided with bad timestamp
values from the VIDIOC_DQEVENT ioctl. Also, fields of the struct
v4l2_event32 that come immediately after timestamp get overwritten,
namely the field named id.

Fixes: 81993e81a994 ("compat: Get rid of (get|put)_compat_time(val|spec)")

Cc: stable@vger.kernel.org
Cc: H. Peter Anvin <hpa@linux.intel.com>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Cc: Tiffany Lin <tiffany.lin@mediatek.com>
Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Daniel Mentz <danielmentz@google.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: v4l2-compat-ioctl32: Copy v4l2_window->global_alpha
Daniel Mentz [Thu, 3 Aug 2017 22:03:10 +0000 (18:03 -0400)]
media: v4l2-compat-ioctl32: Copy v4l2_window->global_alpha

Commit b2787845fb91 ("V4L/DVB (5289): Add support for video output
overlays.") added the field global_alpha to struct v4l2_window but did
not update the compat layer accordingly. This change adds global_alpha
to struct v4l2_window32 and copies the value for global_alpha back and
forth.

Signed-off-by: Daniel Mentz <danielmentz@google.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: adv7604: Prevent out of bounds access
Dan Carpenter [Fri, 4 Aug 2017 08:07:51 +0000 (04:07 -0400)]
media: adv7604: Prevent out of bounds access

These can only be accessed with CAP_SYS_ADMIN so it's not a critical
security issue.  The problem is that "page" is controlled by the user in
the ioctl().  The test to see if the bit is set in state->info->page_mask
is not sufficient because "page" can be very high and shift wrap around
to a bit which is set.

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@s-opensource.com>
6 years agomedia: DaVinci-VPBE: constify vpbe_dev_ops
Julia Lawall [Wed, 2 Aug 2017 14:54:13 +0000 (10:54 -0400)]
media: DaVinci-VPBE: constify vpbe_dev_ops

vpbe_dev_ops is only copied into the ops field at the end of a vpbe_device
structure, so it can be const.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: solo6x10: export hardware GPIO pins 8:31 to gpiolib interface
Anton Sviridenko [Wed, 2 Aug 2017 14:17:02 +0000 (10:17 -0400)]
media: solo6x10: export hardware GPIO pins 8:31 to gpiolib interface

24 GPIO pins from 32 available on solo6x10 chips are exported
to gpiolib. First 8 GPIOs are reserved for internal use on capture card
boards, GPIOs in range 8:15 are configured as outputs to control relays,
remaining 16:31 are configured as inputs to read sensor states.
Now with this patch userspace DVR software can switch relays and read
sensor states when GPIO extension cards are attached to Softlogic solo6x10
based video capture cards.

Signed-off-by: Anton Sviridenko <anton@corp.bluecherry.net>
Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: cx231xx: drop return value of cx231xx_i2c_unregister
Peter Rosin [Mon, 31 Jul 2017 13:38:51 +0000 (09:38 -0400)]
media: cx231xx: drop return value of cx231xx_i2c_unregister

No one cares anyway.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: cx231xx: fail probe if i2c_add_adapter fails
Peter Rosin [Mon, 31 Jul 2017 13:38:50 +0000 (09:38 -0400)]
media: cx231xx: fail probe if i2c_add_adapter fails

While at it, change the type of the previously always-zero i2c_rc
member to int, matching the returned type from i2c_add_adapter.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: saa7146: hexium_gemini: constify pci_device_id
Arvind Yadav [Wed, 2 Aug 2017 17:14:57 +0000 (13:14 -0400)]
media: saa7146: hexium_gemini: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <media/drv-intf/saa7146.h>
and <linux/pci.h> work with const pci_device_id. So mark the non-const
structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: saa7146: hexium_orion: constify pci_device_id
Arvind Yadav [Wed, 2 Aug 2017 17:14:56 +0000 (13:14 -0400)]
media: saa7146: hexium_orion: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <media/drv-intf/saa7146.h>
and <linux/pci.h> work with const pci_device_id. So mark the non-const
structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: saa7146: mxb: constify pci_device_id
Arvind Yadav [Wed, 2 Aug 2017 17:14:55 +0000 (13:14 -0400)]
media: saa7146: mxb: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <media/drv-intf/saa7146.h>
and <linux/pci.h> work with const pci_device_id. So mark the non-const
structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ttpci: av7110: constify pci_device_id
Arvind Yadav [Wed, 2 Aug 2017 17:14:54 +0000 (13:14 -0400)]
media: ttpci: av7110: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <media/drv-intf/saa7146.h>
and <linux/pci.h> work with const pci_device_id. So mark the non-const
structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ttpci: budget-av: constify pci_device_id
Arvind Yadav [Wed, 2 Aug 2017 17:14:53 +0000 (13:14 -0400)]
media: ttpci: budget-av: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <media/drv-intf/saa7146.h>
and <linux/pci.h> work with const pci_device_id. So mark the non-const
structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ttpci: budget-ci: constify pci_device_id
Arvind Yadav [Wed, 2 Aug 2017 17:14:52 +0000 (13:14 -0400)]
media: ttpci: budget-ci: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <media/drv-intf/saa7146.h>
and <linux/pci.h> work with const pci_device_id. So mark the non-const
structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ttpci: budget-patch: constify pci_device_id
Arvind Yadav [Wed, 2 Aug 2017 17:14:51 +0000 (13:14 -0400)]
media: ttpci: budget-patch: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <media/drv-intf/saa7146.h>
and <linux/pci.h> work with const pci_device_id. So mark the non-const
structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ttpci: budget: constify pci_device_id
Arvind Yadav [Wed, 2 Aug 2017 17:14:50 +0000 (13:14 -0400)]
media: ttpci: budget: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <media/drv-intf/saa7146.h>
and <linux/pci.h> work with const pci_device_id. So mark the non-const
structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: drv-intf: saa7146: constify pci_device_id
Arvind Yadav [Wed, 2 Aug 2017 17:14:49 +0000 (13:14 -0400)]
media: drv-intf: saa7146: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.
So making 'pci_tbl' as const member of 'struct saa7146_extension'.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: radio: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:34 +0000 (13:56 -0400)]
media: radio: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: cx18: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:33 +0000 (13:56 -0400)]
media: cx18: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: mantis: hopper_cards: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:32 +0000 (13:56 -0400)]
media: mantis: hopper_cards: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: mantis: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:31 +0000 (13:56 -0400)]
media: mantis: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: pt1: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:30 +0000 (13:56 -0400)]
media: pt1: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: saa7164: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:29 +0000 (13:56 -0400)]
media: saa7164: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: b2c2: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:28 +0000 (13:56 -0400)]
media: b2c2: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: cobalt: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:27 +0000 (13:56 -0400)]
media: cobalt: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ivtv: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:26 +0000 (13:56 -0400)]
media: ivtv: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: bt8xx: bttv: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:25 +0000 (13:56 -0400)]
media: bt8xx: bttv: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: bt8xx: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:24 +0000 (13:56 -0400)]
media: bt8xx: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: zoran: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:23 +0000 (13:56 -0400)]
media: zoran: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dm1105: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:22 +0000 (13:56 -0400)]
media: dm1105: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: pluto2: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:21 +0000 (13:56 -0400)]
media: pluto2: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: meye: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:20 +0000 (13:56 -0400)]
media: meye: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: cx23885: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:19 +0000 (13:56 -0400)]
media: cx23885: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: netup_unidvb: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:18 +0000 (13:56 -0400)]
media: netup_unidvb: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: marvell-ccic: constify pci_device_id
Arvind Yadav [Tue, 1 Aug 2017 17:56:17 +0000 (13:56 -0400)]
media: marvell-ccic: constify pci_device_id

pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: cec-api: log the reason for the -EINVAL in cec_s_mode
Hans Verkuil [Sun, 6 Aug 2017 11:04:05 +0000 (07:04 -0400)]
media: cec-api: log the reason for the -EINVAL in cec_s_mode

If cec_debug >= 1 then log why the requested mode returned -EINVAL.

It can be hard to debug this since -EINVAL can be returned for many
reasons. So this should help.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: cec-ioc-g-mode.rst: improve description of message, processing
Hans Verkuil [Sat, 5 Aug 2017 10:28:50 +0000 (06:28 -0400)]
media: cec-ioc-g-mode.rst: improve description of message, processing

The description of how messages are processed by the core was not
always very clear. Reword it to improve this.

In particular for the USER_CONTROL_* messages a critical bit was
missing in that the core also checks for the CEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU
flag. This was confusing.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: cec-ioc-adap-g-log-addrs.rst: fix wrong quotes
Hans Verkuil [Sat, 5 Aug 2017 10:28:25 +0000 (06:28 -0400)]
media: cec-ioc-adap-g-log-addrs.rst: fix wrong quotes

`CEC_LOG_ADDRS_FL_CDC_ONLY` should be ``CEC_LOG_ADDRS_FL_CDC_ONLY``.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: adv*/vivid/pulse8/rainshadow: cec: use CEC_CAP_DEFAULTS
Hans Verkuil [Fri, 4 Aug 2017 10:41:52 +0000 (06:41 -0400)]
media: adv*/vivid/pulse8/rainshadow: cec: use CEC_CAP_DEFAULTS

Use the new CEC_CAP_DEFAULTS define in the adv, vivid, pulse8 and
rainshadow CEC drivers.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: media/cec.h: add CEC_CAP_DEFAULTS
Hans Verkuil [Fri, 4 Aug 2017 10:41:51 +0000 (06:41 -0400)]
media: media/cec.h: add CEC_CAP_DEFAULTS

The CEC_CAP_LOG_ADDRS, CEC_CAP_TRANSMIT, CEC_CAP_PASSTHROUGH and
CEC_CAP_RC capabilities are normally always present.

Add a CEC_CAP_DEFAULTS define that ORs these four caps to simplify
drivers.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: cec-funcs.h: cec_ops_report_features: set *dev_features to NULL
Hans Verkuil [Tue, 1 Aug 2017 11:53:30 +0000 (07:53 -0400)]
media: cec-funcs.h: cec_ops_report_features: set *dev_features to NULL

gcc can get confused by this code and it thinks dev_features can be
returned uninitialized. So initialize to NULL at the beginning to shut up
the warning.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: v4l2-tpg: fix the SMPTE-2084 transfer function
Hans Verkuil [Tue, 8 Aug 2017 10:56:29 +0000 (06:56 -0400)]
media: v4l2-tpg: fix the SMPTE-2084 transfer function

The SMPTE-2084 transfer functions maps to the luminance range of
0-10000 cd/m^2. Other transfer functions use the traditional range of
0-100 cd/m^2.

I didn't take this into account so the luminance was off by a factor of
100.

Since qv4l2 made the same mistake in reverse I never noticed this until
I tested with actual SMPTE-2084 video.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: coda: reduce iram size to leave space for suspend to ram
Jan Luebbe [Fri, 28 Jul 2017 13:26:47 +0000 (09:26 -0400)]
media: coda: reduce iram size to leave space for suspend to ram

The on-chip SRAM of i.MX6S is only 128 KiB. 4 KiB of that are allocated
for suspend to RAM since commit df595746fa69 ("ARM: imx: add suspend in
ocram support for i.mx6q"). Reduce the requested IRAM size to 124 KiB to
avoid an allocation failure that causes the coda driver to not use the
SRAM at all.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: coda: fix decoder sequence init escape flag
Philipp Zabel [Fri, 28 Jul 2017 13:26:25 +0000 (09:26 -0400)]
media: coda: fix decoder sequence init escape flag

coda_command_sync calls coda_command_async, which writes the
bit_stream_param context variable into the BIT_STREAM_PARAM register,
overwriting the previously set value during coda_start_decoding. Instead
of writing to the register, set bit_stream_param to ensure that the
decoder sequence init command is executed with the escape flag set.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging/imx: remove confusing IS_ERR_OR_NULL usage
Arnd Bergmann [Tue, 11 Jul 2017 13:18:35 +0000 (09:18 -0400)]
media: staging/imx: remove confusing IS_ERR_OR_NULL usage

While looking at a compiler warning, I noticed the use of
IS_ERR_OR_NULL, which is generally a sign of a bad API design
and should be avoided.

In this driver, this is fairly easy, we can simply stop storing
error pointers in persistent structures, and change the two
functions that might return either a NULL pointer or an error
code to consistently return error pointers when failing.

of_parse_subdev() now separates the error code and the pointer
it looks up, to clarify the interface. There are two cases
where this function originally returns 'NULL', and I have
changed that to '0' for success to keep the current behavior,
though returning an error would also make sense there.

Fixes: e130291212df ("[media] media: Add i.MX media core driver")

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Tested-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: i2c: fix semicolon.cocci warnings
kbuild test robot [Wed, 14 Jun 2017 13:47:15 +0000 (09:47 -0400)]
media: i2c: fix semicolon.cocci warnings

drivers/media/i2c/ov5670.c:2033:2-3: Unneeded semicolon

 Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

CC: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: vb2: core: Lower the log level of debug outputs
Hirokazu Honda [Tue, 30 May 2017 09:49:01 +0000 (05:49 -0400)]
media: vb2: core: Lower the log level of debug outputs

Some debug output whose log level is set 1 flooded the log.
Their log level is lowered to find the important log easily.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: cec: documentation fixes
Hans Verkuil [Fri, 28 Jul 2017 10:31:50 +0000 (06:31 -0400)]
media: cec: documentation fixes

Various references to open() et al were wrong. Fix this so following
the link will get you to the correct place.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: v4l: omap_vout: vrfb: initialize DMA flags
Arnd Bergmann [Wed, 26 Jul 2017 15:23:07 +0000 (11:23 -0400)]
media: v4l: omap_vout: vrfb: initialize DMA flags

Passing uninitialized flags into device_prep_interleaved_dma is clearly
a bad idea, and we get a compiler warning for it:

drivers/media/platform/omap/omap_vout_vrfb.c: In function 'omap_vout_prepare_vrfb':
drivers/media/platform/omap/omap_vout_vrfb.c:273:5: error: 'flags' may be used uninitialized in this function [-Werror=maybe-uninitialized]

It seems that the OMAP dmaengine ignores the flags, but we should
pick the right ones anyway. This sets the flags I guessed based
on what other drivers used, and Peter confirmed that they are the
right ones.

Fixes: 6a1560ecaa8c ("media: v4l: omap_vout: vrfb: Convert to dmaengine")

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: v4l: use WARN_ON(1) instead of __WARN()
Arnd Bergmann [Tue, 25 Jul 2017 15:39:14 +0000 (11:39 -0400)]
media: v4l: use WARN_ON(1) instead of __WARN()

__WARN() cannot be used in portable code, since it is only
available on some architectures and configurations:

drivers/media/platform/pxa_camera.c: In function 'pxa_mbus_config_compatible':
drivers/media/platform/pxa_camera.c:642:3: error: implicit declaration of function '__WARN'; did you mean '__WALL'? [-Werror=implicit-function-declaration]

The common way to express an unconditional warning is WARN_ON(1),
so let's use that here.

Fixes: 97bbdf02d905 ("media: v4l: Add support for CSI-1 and CCP2 busses")

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: i2c: add KConfig dependencies
Arnd Bergmann [Tue, 25 Jul 2017 15:36:45 +0000 (11:36 -0400)]
media: i2c: add KConfig dependencies

The new ov5670 driver fails to build when VIDEO_V4L2_SUBDEV_API
or MEDIA_CONTROLLER are disabled:

drivers/media/i2c/ov5670.c: In function 'ov5670_open':
drivers/media/i2c/ov5670.c:1917:5: error: implicit declaration of function 'v4l2_subdev_get_try_format'; did you mean 'v4l2_subdev_notify_event'? [-Werror=implicit-function-declaration]
     v4l2_subdev_get_try_format(sd, fh->pad, 0);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
     v4l2_subdev_notify_event
drivers/media/i2c/ov5670.c:1917:38: error: 'struct v4l2_subdev_fh' has no member named 'pad'
     v4l2_subdev_get_try_format(sd, fh->pad, 0);
                                      ^~
drivers/media/i2c/ov5670.c: In function 'ov5670_do_get_pad_format':
drivers/media/i2c/ov5670.c:2198:17: error: invalid type argument of unary '*' (have 'int')
   fmt->format = *v4l2_subdev_get_try_format(&ov5670->sd, cfg,
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          fmt->pad);
          ~~~~~~~~~
drivers/media/i2c/ov5670.c: At top level:
drivers/media/i2c/ov5670.c:2444:19: error: 'v4l2_subdev_link_validate' undeclared here (not in a function); did you mean 'v4l2_subdev_init'?
  .link_validate = v4l2_subdev_link_validate,
                   ^~~~~~~~~~~~~~~~~~~~~~~~~
                   v4l2_subdev_init
drivers/media/i2c/ov5670.c: In function 'ov5670_probe':
drivers/media/i2c/ov5670.c:2492:12: error: 'struct v4l2_subdev' has no member named 'entity'

This adds both to the Kconfig entry.

Fixes: 5de35c9b8dcd ("media: i2c: Add Omnivision OV5670 5M sensor support")

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ti-vpe: cal: use of_graph_get_remote_endpoint()
Kuninori Morimoto [Mon, 24 Jul 2017 01:36:54 +0000 (21:36 -0400)]
media: ti-vpe: cal: use of_graph_get_remote_endpoint()

Now, we can use of_graph_get_remote_endpoint(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: imx: fix non-static declarations
JB Van Puyvelde [Sun, 23 Jul 2017 15:35:55 +0000 (11:35 -0400)]
media: staging: imx: fix non-static declarations

Add static keywords to fix this kind of sparse warnings:
warning: symbol 'imx_t_vcm_timing' was not declared. Should it be static?

Signed-off-by: JB Van Puyvelde <jbvanpuyvelde@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: imx: prpencvf: enable double write reduction
Steve Longerbeam [Sat, 22 Jul 2017 21:21:41 +0000 (17:21 -0400)]
media: imx: prpencvf: enable double write reduction

For the write channels with 4:2:0 subsampled YUV formats, avoid chroma
overdraw by only writing chroma for even lines. Reduces necessary write
memory bandwidth by at least 25% (more with rotation enabled).

Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: imx: add VIDEO_V4L2_SUBDEV_API dependency
Arnd Bergmann [Fri, 21 Jul 2017 16:21:25 +0000 (12:21 -0400)]
media: imx: add VIDEO_V4L2_SUBDEV_API dependency

Without this, I get a build error:

drivers/staging/media/imx/imx-media-vdic.c: In function '__vdic_get_fmt':
drivers/staging/media/imx/imx-media-vdic.c:554:10: error: implicit declaration of function 'v4l2_subdev_get_try_format'; did you mean 'v4l2_subdev_notify_event'? [-Werror=implicit-function-declaration]

Fixes: e130291212df ("[media] media: Add i.MX media core driver")

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: v4l: omap_vout: vrfb: include linux/slab.h
Arnd Bergmann [Fri, 21 Jul 2017 16:20:23 +0000 (12:20 -0400)]
media: v4l: omap_vout: vrfb: include linux/slab.h

Without this header, we get a build error in some configurations:

drivers/media/platform/omap/omap_vout_vrfb.c: In function 'omap_vout_setup_vrfb_bufs':
drivers/media/platform/omap/omap_vout_vrfb.c:143:26: error: implicit declaration of function 'kzalloc'; did you mean 'vzalloc'? [-Werror=implicit-function-declaration]

Fixes: 6a1560ecaa8c ("media: v4l: omap_vout: vrfb: Convert to dmaengine")

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov9655: fix missing mutex_destroy()
Hugues Fruchet [Fri, 21 Jul 2017 15:49:41 +0000 (11:49 -0400)]
media: ov9655: fix missing mutex_destroy()

Fix missing mutex_destroy() when probe fails and
when driver is removed.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov9650: fix coding style
Hugues Fruchet [Fri, 21 Jul 2017 15:49:40 +0000 (11:49 -0400)]
media: ov9650: fix coding style

Fix a bunch of coding style issues detected
by checkpatch --strict.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: stm32-dcmi: explicitly request exclusive reset control
Philipp Zabel [Wed, 19 Jul 2017 15:25:40 +0000 (11:25 -0400)]
media: stm32-dcmi: explicitly request exclusive reset control

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: mtk-vcodec: fix vp9 decode error
Tiffany Lin [Wed, 19 Jul 2017 09:22:52 +0000 (05:22 -0400)]
media: mtk-vcodec: fix vp9 decode error

Fix The camera has a blurry screen phenomenon when
we video chat with apprtc using vp9 codec

Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
Reviewed-by: Wu-Cheng Li <wuchengli@chromium.org>
Tested-by: Wu-Cheng Li <wuchengli@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov7670: Check the return value from clk_prepare_enable()
Fabio Estevam [Wed, 19 Jul 2017 03:34:19 +0000 (23:34 -0400)]
media: ov7670: Check the return value from clk_prepare_enable()

clk_prepare_enable() may fail, so we should better check its return value
and propagate it in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov7670: Return the real error code
Fabio Estevam [Wed, 19 Jul 2017 03:34:18 +0000 (23:34 -0400)]
media: ov7670: Return the real error code

When devm_clk_get() fails the real error code should be propagated,
instead of always returning -EPROBE_DEFER.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: v4l2-tpg-core.c: fix typo in bt2020_full matrix
Hans Verkuil [Thu, 27 Jul 2017 15:39:14 +0000 (11:39 -0400)]
media: v4l2-tpg-core.c: fix typo in bt2020_full matrix

My eye fell on this wrong coefficient in the bt2020_full matrix.
The bt2020 matrix (limited range) is OK.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: media/extended-controls.rst: fix wrong enum names
Hans Verkuil [Thu, 27 Jul 2017 12:47:10 +0000 (08:47 -0400)]
media: media/extended-controls.rst: fix wrong enum names

MPEG4 level and profile defines were wrong. Fix this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Nicolas Dufresne <nicolas@ndufresne.ca>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: media/doc: improve the SMPTE 2084 documentation
Hans Verkuil [Thu, 27 Jul 2017 09:22:29 +0000 (05:22 -0400)]
media: media/doc: improve the SMPTE 2084 documentation

Make note of the different luminance ranges between HDR and SDR.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: media/doc: improve bt.2020 documentation
Hans Verkuil [Thu, 27 Jul 2017 09:09:10 +0000 (05:09 -0400)]
media: media/doc: improve bt.2020 documentation

Add a note stating that bt.2020 is often used in combination with the
smpte 2084 transfer function.

Also use the right references to the documentation of that transfer
function.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: media/doc: rename and reorder pixfmt files
Hans Verkuil [Thu, 27 Jul 2017 08:58:52 +0000 (04:58 -0400)]
media: media/doc: rename and reorder pixfmt files

After the DocBook conversion a number of pixfmt description files just
had a number in the filename (pix-fmt-004, 006, etc) which was not very
descriptive.

Rename them.

Note that pixfmt-008.rst was folded into colorspaces-details.rst, so
that file is deleted. It's easier to maintain that way.

Also moved the colorspace sections to the end of the chapter. The old
order was weird: the "Standard Image Formats" section (an intro into
pixel formats) was followed by the colorspace sections instead of the
pixel format descriptions.

Moving it to the end resolved that issue.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: drop use of MEDIA_API_VERSION
Hans Verkuil [Fri, 28 Jul 2017 07:25:06 +0000 (03:25 -0400)]
media: drop use of MEDIA_API_VERSION

Set media_version to LINUX_VERSION_CODE, just as we did for
driver_version.

Nobody ever rememebers to update the version number, but
LINUX_VERSION_CODE will always be updated.

Move the MEDIA_API_VERSION define to the ifndef __KERNEL__ section of the
media.h header. That way kernelspace can't accidentally start to use
it again.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: media-device: remove driver_version
Hans Verkuil [Fri, 21 Jul 2017 08:49:44 +0000 (04:49 -0400)]
media: media-device: remove driver_version

Since the driver_version field in struct media_device is no longer
used, just remove it.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: atomisp2: don't set driver_version
Hans Verkuil [Fri, 21 Jul 2017 08:54:40 +0000 (04:54 -0400)]
media: atomisp2: don't set driver_version

This field will be removed as it is not needed anymore.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: uvc: don't set driver_version
Hans Verkuil [Fri, 21 Jul 2017 08:54:12 +0000 (04:54 -0400)]
media: uvc: don't set driver_version

This field will be removed as it is not needed anymore.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: s3c-camif: don't set driver_version
Hans Verkuil [Fri, 21 Jul 2017 08:53:30 +0000 (04:53 -0400)]
media: s3c-camif: don't set driver_version

This field will be removed as it is not needed anymore.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: media-device: set driver_version directly
Hans Verkuil [Fri, 21 Jul 2017 10:48:33 +0000 (06:48 -0400)]
media: media-device: set driver_version directly

Don't use driver_version from struct media_device, just return
LINUX_VERSION_CODE as the other media subsystems do.

The driver_version field in struct media_device will be removed
in the following patches.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agoMerge tag 'v4.13-rc4' into patchwork
Mauro Carvalho Chehab [Tue, 8 Aug 2017 09:38:41 +0000 (05:38 -0400)]
Merge tag 'v4.13-rc4' into patchwork

Linux 4.13-rc4

* tag 'v4.13-rc4': (863 commits)
  Linux 4.13-rc4
  Fix compat_sys_sigpending breakage
  ext4: fix copy paste error in ext4_swap_extents()
  ext4: fix overflow caused by missing cast in ext4_resize_fs()
  ext4, project: expand inode extra size if possible
  ext4: cleanup ext4_expand_extra_isize_ea()
  ext4: restructure ext4_expand_extra_isize
  ext4: fix forgetten xattr lock protection in ext4_expand_extra_isize
  ext4: make xattr inode reads faster
  ext4: inplace xattr block update fails to deduplicate blocks
  ext4: remove unused mode parameter
  ext4: fix warning about stack corruption
  ext4: fix dir_nlink behaviour
  ext4: silence array overflow warning
  ext4: fix SEEK_HOLE/SEEK_DATA for blocksize < pagesize
  platform/x86: intel-vbtn: match power button on press rather than release
  ext4: release discard bio after sending discard commands
  sparc64: Fix exception handling in UltraSPARC-III memcpy.
  arm64: avoid overflow in VA_START and PAGE_OFFSET
  arm64: Fix potential race with hardware DBM in ptep_set_access_flags()
  ...

6 years agoLinux 4.13-rc4 v4.13-rc4
Linus Torvalds [Mon, 7 Aug 2017 01:44:49 +0000 (18:44 -0700)]
Linux 4.13-rc4

6 years agoMerge tag 'platform-drivers-x86-v4.13-4' of git://git.infradead.org/linux-platform...
Linus Torvalds [Sun, 6 Aug 2017 23:11:34 +0000 (16:11 -0700)]
Merge tag 'platform-drivers-x86-v4.13-4' of git://git.infradead.org/linux-platform-drivers-x86

Pull x86 platform driver fix from Darren Hart:
 "Fix loop preventing some platforms from waking up via the power button
  in s2idle:

   - intel-vbtn: match power button on press rather than release"

* tag 'platform-drivers-x86-v4.13-4' of git://git.infradead.org/linux-platform-drivers-x86:
  platform/x86: intel-vbtn: match power button on press rather than release

6 years agoMerge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 6 Aug 2017 19:31:17 +0000 (12:31 -0700)]
Merge tag 'ext4_for_linus_stable' of git://git./linux/kernel/git/tytso/ext4

Pull ext4 fixes from Ted Ts'o:
 "A large number of ext4 bug fixes and cleanups for v4.13"

* tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: fix copy paste error in ext4_swap_extents()
  ext4: fix overflow caused by missing cast in ext4_resize_fs()
  ext4, project: expand inode extra size if possible
  ext4: cleanup ext4_expand_extra_isize_ea()
  ext4: restructure ext4_expand_extra_isize
  ext4: fix forgetten xattr lock protection in ext4_expand_extra_isize
  ext4: make xattr inode reads faster
  ext4: inplace xattr block update fails to deduplicate blocks
  ext4: remove unused mode parameter
  ext4: fix warning about stack corruption
  ext4: fix dir_nlink behaviour
  ext4: silence array overflow warning
  ext4: fix SEEK_HOLE/SEEK_DATA for blocksize < pagesize
  ext4: release discard bio after sending discard commands
  ext4: convert swap_inode_data() over to use swap() on most of the fields
  ext4: error should be cleared if ea_inode isn't added to the cache
  ext4: Don't clear SGID when inheriting ACLs
  ext4: preserve i_mode if __ext4_set_acl() fails
  ext4: remove unused metadata accounting variables
  ext4: correct comment references to ext4_ext_direct_IO()

6 years agoMerge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Linus Torvalds [Sun, 6 Aug 2017 18:52:01 +0000 (11:52 -0700)]
Merge branch 'upstream' of git://git.linux-mips.org/ralf/upstream-linus

Pull MIPS fixes from Ralf Baechle:
 "This fixes two build issues for ralink platforms, both due to missing
  #includes which used to be included indirectly via other headers"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
  MIPS: ralink: mt7620: Add missing header
  MIPS: ralink: Fix build error due to missing header

6 years agoFix compat_sys_sigpending breakage
Dmitry V. Levin [Sat, 5 Aug 2017 20:00:50 +0000 (23:00 +0300)]
Fix compat_sys_sigpending breakage

The latest change of compat_sys_sigpending in commit 8f13621abced
("sigpending(): move compat to native") has broken it in two ways.

First, it tries to write 4 bytes more than userspace expects:
sizeof(old_sigset_t) == sizeof(long) == 8 instead of
sizeof(compat_old_sigset_t) == sizeof(u32) == 4.

Second, on big endian architectures these bytes are being written in the
wrong order.

This bug was found by strace test suite.

Reported-by: Anatoly Pugachev <matorola@gmail.com>
Inspired-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Fixes: 8f13621abced ("sigpending(): move compat to native")
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
6 years agoext4: fix copy paste error in ext4_swap_extents()
Maninder Singh [Sun, 6 Aug 2017 05:33:07 +0000 (01:33 -0400)]
ext4: fix copy paste error in ext4_swap_extents()

This bug was found by a static code checker tool for copy paste
problems.

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Vaneet Narang <v.narang@samsung.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoext4: fix overflow caused by missing cast in ext4_resize_fs()
Jerry Lee [Sun, 6 Aug 2017 05:18:31 +0000 (01:18 -0400)]
ext4: fix overflow caused by missing cast in ext4_resize_fs()

On a 32-bit platform, the value of n_blcoks_count may be wrong during
the file system is resized to size larger than 2^32 blocks.  This may
caused the superblock being corrupted with zero blocks count.

Fixes: 1c6bd7173d66
Signed-off-by: Jerry Lee <jerrylee@qnap.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org # 3.7+
6 years agoext4, project: expand inode extra size if possible
Miao Xie [Sun, 6 Aug 2017 05:00:49 +0000 (01:00 -0400)]
ext4, project: expand inode extra size if possible

When upgrading from old format, try to set project id
to old file first time, it will return EOVERFLOW, but if
that file is dirtied(touch etc), changing project id will
be allowed, this might be confusing for users, we could
try to expand @i_extra_isize here too.

Reported-by: Zhang Yi <yi.zhang@huawei.com>
Signed-off-by: Miao Xie <miaoxie@huawei.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoext4: cleanup ext4_expand_extra_isize_ea()
Miao Xie [Sun, 6 Aug 2017 04:55:48 +0000 (00:55 -0400)]
ext4: cleanup ext4_expand_extra_isize_ea()

Clean up some goto statement, make ext4_expand_extra_isize_ea() clearer.

Signed-off-by: Miao Xie <miaoxie@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
6 years agoext4: restructure ext4_expand_extra_isize
Miao Xie [Sun, 6 Aug 2017 04:40:01 +0000 (00:40 -0400)]
ext4: restructure ext4_expand_extra_isize

Current ext4_expand_extra_isize just tries to expand extra isize, if
someone is holding xattr lock or some check fails, it will give up.
So rename its name to ext4_try_to_expand_extra_isize.

Besides that, we clean up unnecessary check and move some relative checks
into it.

Signed-off-by: Miao Xie <miaoxie@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
6 years agoext4: fix forgetten xattr lock protection in ext4_expand_extra_isize
Miao Xie [Sun, 6 Aug 2017 04:27:38 +0000 (00:27 -0400)]
ext4: fix forgetten xattr lock protection in ext4_expand_extra_isize

We should avoid the contention between the i_extra_isize update and
the inline data insertion, so move the xattr trylock in front of
i_extra_isize update.

Signed-off-by: Miao Xie <miaoxie@huawei.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
6 years agoext4: make xattr inode reads faster
Tahsin Erdogan [Sun, 6 Aug 2017 04:07:01 +0000 (00:07 -0400)]
ext4: make xattr inode reads faster

ext4_xattr_inode_read() currently reads each block sequentially while
waiting for io operation to complete before moving on to the next
block. This prevents request merging in block layer.

Add a ext4_bread_batch() function that starts reads for all blocks
then optionally waits for them to complete. A similar logic is used
in ext4_find_entry(), so update that code to use the new function.

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoext4: inplace xattr block update fails to deduplicate blocks
Tahsin Erdogan [Sun, 6 Aug 2017 02:41:42 +0000 (22:41 -0400)]
ext4: inplace xattr block update fails to deduplicate blocks

When an xattr block has a single reference, block is updated inplace
and it is reinserted to the cache. Later, a cache lookup is performed
to see whether an existing block has the same contents. This cache
lookup will most of the time return the just inserted entry so
deduplication is not achieved.

Running the following test script will produce two xattr blocks which
can be observed in "File ACL: " line of debugfs output:

  mke2fs -b 1024 -I 128 -F -O extent /dev/sdb 1G
  mount /dev/sdb /mnt/sdb

  touch /mnt/sdb/{x,y}

  setfattr -n user.1 -v aaa /mnt/sdb/x
  setfattr -n user.2 -v bbb /mnt/sdb/x

  setfattr -n user.1 -v aaa /mnt/sdb/y
  setfattr -n user.2 -v bbb /mnt/sdb/y

  debugfs -R 'stat x' /dev/sdb | cat
  debugfs -R 'stat y' /dev/sdb | cat

This patch defers the reinsertion to the cache so that we can locate
other blocks with the same contents.

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
6 years agoext4: remove unused mode parameter
Tahsin Erdogan [Sun, 6 Aug 2017 02:15:45 +0000 (22:15 -0400)]
ext4: remove unused mode parameter

ext4_alloc_file_blocks() does not use its mode parameter. Remove it.

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
6 years agoext4: fix warning about stack corruption
Arnd Bergmann [Sun, 6 Aug 2017 01:57:46 +0000 (21:57 -0400)]
ext4: fix warning about stack corruption

After commit 62d1034f53e3 ("fortify: use WARN instead of BUG for now"),
we get a warning about possible stack overflow from a memcpy that
was not strictly bounded to the size of the local variable:

    inlined from 'ext4_mb_seq_groups_show' at fs/ext4/mballoc.c:2322:2:
include/linux/string.h:309:9: error: '__builtin_memcpy': writing between 161 and 1116 bytes into a region of size 160 overflows the destination [-Werror=stringop-overflow=]

We actually had a bug here that would have been found by the warning,
but it was already fixed last year in commit 30a9d7afe70e ("ext4: fix
stack memory corruption with 64k block size").

This replaces the fixed-length structure on the stack with a variable-length
structure, using the correct upper bound that tells the compiler that
everything is really fine here. I also change the loop count to check
for the same upper bound for consistency, but the existing code is
already correct here.

Note that while clang won't allow certain kinds of variable-length arrays
in structures, this particular instance is fine, as the array is at the
end of the structure, and the size is strictly bounded.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>