[PATCH v2 1/3] media: V3s: Add support for Allwinner CSI.

2017-07-26 Thread Yong Deng
Allwinner V3s SoC have two CSI module. CSI0 is used for MIPI interface
and CSI1 is used for parallel interface. This is not documented in
datasheet but by testing and guess.

This patch implement a v4l2 framework driver for it.

Currently, the driver only support the parallel interface. MIPI-CSI2,
ISP's support are not included in this patch.

Signed-off-by: Yong Deng 
---
 drivers/media/platform/Kconfig   |   1 +
 drivers/media/platform/Makefile  |   2 +
 drivers/media/platform/sun6i-csi/Kconfig |   9 +
 drivers/media/platform/sun6i-csi/Makefile|   3 +
 drivers/media/platform/sun6i-csi/sun6i_csi.c | 545 +++
 drivers/media/platform/sun6i-csi/sun6i_csi.h | 203 ++
 drivers/media/platform/sun6i-csi/sun6i_csi_v3s.c | 827 +++
 drivers/media/platform/sun6i-csi/sun6i_csi_v3s.h | 206 ++
 drivers/media/platform/sun6i-csi/sun6i_video.c   | 663 ++
 drivers/media/platform/sun6i-csi/sun6i_video.h   |  61 ++
 10 files changed, 2520 insertions(+)
 create mode 100644 drivers/media/platform/sun6i-csi/Kconfig
 create mode 100644 drivers/media/platform/sun6i-csi/Makefile
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_csi.c
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_csi.h
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_csi_v3s.c
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_csi_v3s.h
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_video.c
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_video.h

diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 0c741d1..8371a87 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -143,6 +143,7 @@ source "drivers/media/platform/am437x/Kconfig"
 source "drivers/media/platform/xilinx/Kconfig"
 source "drivers/media/platform/rcar-vin/Kconfig"
 source "drivers/media/platform/atmel/Kconfig"
+source "drivers/media/platform/sun6i-csi/Kconfig"
 
 config VIDEO_TI_CAL
tristate "TI CAL (Camera Adaptation Layer) driver"
diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
index 9beadc7..fb2459c 100644
--- a/drivers/media/platform/Makefile
+++ b/drivers/media/platform/Makefile
@@ -86,3 +86,5 @@ obj-$(CONFIG_VIDEO_MEDIATEK_MDP)  += mtk-mdp/
 obj-$(CONFIG_VIDEO_MEDIATEK_JPEG)  += mtk-jpeg/
 
 obj-$(CONFIG_VIDEO_QCOM_VENUS) += qcom/venus/
+
+obj-$(CONFIG_VIDEO_SUN6I_CSI)  += sun6i-csi/
diff --git a/drivers/media/platform/sun6i-csi/Kconfig 
b/drivers/media/platform/sun6i-csi/Kconfig
new file mode 100644
index 000..314188a
--- /dev/null
+++ b/drivers/media/platform/sun6i-csi/Kconfig
@@ -0,0 +1,9 @@
+config VIDEO_SUN6I_CSI
+   tristate "Allwinner V3s Camera Sensor Interface driver"
+   depends on VIDEO_V4L2 && COMMON_CLK && VIDEO_V4L2_SUBDEV_API && HAS_DMA
+   depends on ARCH_SUNXI || COMPILE_TEST
+   select VIDEOBUF2_DMA_CONTIG
+   select REGMAP_MMIO
+   select V4L2_FWNODE
+   ---help---
+  Support for the Allwinner Camera Sensor Interface Controller on V3s.
diff --git a/drivers/media/platform/sun6i-csi/Makefile 
b/drivers/media/platform/sun6i-csi/Makefile
new file mode 100644
index 000..a9b527b
--- /dev/null
+++ b/drivers/media/platform/sun6i-csi/Makefile
@@ -0,0 +1,3 @@
+sun6i-csi-y += sun6i_csi.o sun6i_video.o sun6i_csi_v3s.o
+
+obj-$(CONFIG_VIDEO_SUN6I_CSI) += sun6i-csi.o
diff --git a/drivers/media/platform/sun6i-csi/sun6i_csi.c 
b/drivers/media/platform/sun6i-csi/sun6i_csi.c
new file mode 100644
index 000..7a4bf53
--- /dev/null
+++ b/drivers/media/platform/sun6i-csi/sun6i_csi.c
@@ -0,0 +1,545 @@
+/*
+ * Copyright (c) 2017 Magewell Electronics Co., Ltd. (Nanjing),
+ * All rights reserved.
+ * Author: Yong Deng 
+ *
+ * Based on drivers/media/platform/xilinx/xilinx-vipp.c
+ * Copyright (C) 2013-2015 Ideas on Board
+ * Copyright (C) 2013-2015 Xilinx, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "sun6i_csi.h"
+
+/*
+ * struct sun6i_graph_entity - Entity in the video graph
+ * @list: list entry in a graph entities list
+ * @node: the entity's DT node
+ * @entity: media entity, from the corresponding V4L2 subdev
+ * @asd: subdev asynchronous registration information
+ * @subdev: V4L2 subdev
+ */
+struct sun6i_graph_entity {
+   struct list_headlist;
+   struct device_node  *node;
+   struct media_entity  

[PATCH v2 2/3] dt-bindings: media: Add Allwinner V3s Camera Sensor Interface (CSI)

2017-07-26 Thread Yong Deng
Add binding documentation for Allwinner V3s CSI.

Signed-off-by: Yong Deng 
---
 .../devicetree/bindings/media/sun6i-csi.txt| 49 ++
 1 file changed, 49 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/sun6i-csi.txt

diff --git a/Documentation/devicetree/bindings/media/sun6i-csi.txt 
b/Documentation/devicetree/bindings/media/sun6i-csi.txt
new file mode 100644
index 000..f8d83f6
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/sun6i-csi.txt
@@ -0,0 +1,49 @@
+Allwinner V3s Camera Sensor Interface
+--
+
+Required properties:
+  - compatible: value must be "allwinner,sun8i-v3s-csi"
+  - reg: base address and size of the memory-mapped region.
+  - interrupts: interrupt associated to this IP
+  - clocks: phandles to the clocks feeding the CSI
+* ahb: the CSI interface clock
+* mod: the CSI module clock
+* ram: the CSI DRAM clock
+  - clock-names: the clock names mentioned above
+  - resets: phandles to the reset line driving the CSI
+
+- ports: A ports node with endpoint definitions as defined in
+  Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+Example:
+
+   csi1: csi@01cb4000 {
+   compatible = "allwinner,sun8i-v3s-csi";
+   reg = <0x01cb4000 0x1000>;
+   interrupts = ;
+   clocks = < CLK_BUS_CSI>,
+< CLK_CSI1_SCLK>,
+< CLK_DRAM_CSI>;
+   clock-names = "ahb", "mod", "ram";
+   resets = < RST_BUS_CSI>;
+
+   port {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   /* Parallel bus endpoint */
+   csi1_ep: endpoint {
+   remote-endpoint = <_ep>;
+   bus-width = <16>;
+   data-shift = <0>;
+
+   /* If hsync-active/vsync-active are missing,
+  embedded BT.656 sync is used */
+   hsync-active = <0>; /* Active low */
+   vsync-active = <0>; /* Active low */
+   data-active = <1>;  /* Active high */
+   pclk-sample = <1>;  /* Rising */
+   };
+   };
+   };
+
-- 
1.8.3.1



[PATCH v2 3/3] media: MAINTAINERS: add entries for Allwinner V3s CSI

2017-07-26 Thread Yong Deng
Signed-off-by: Yong Deng 
---
 MAINTAINERS | 8 
 1 file changed, 8 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 9826a91..b91fa27 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3686,6 +3686,14 @@ M:   Jaya Kumar 
 S: Maintained
 F: sound/pci/cs5535audio/
 
+CSI DRIVERS FOR ALLWINNER V3s
+M: Yong Deng 
+L: linux-media@vger.kernel.org
+T: git git://linuxtv.org/media_tree.git
+S: Maintained
+F: drivers/media/platform/sun6i-csi/
+F: Documentation/devicetree/bindings/media/sun6i-csi.txt
+
 CW1200 WLAN driver
 M: Solomon Peachy 
 S: Maintained
-- 
1.8.3.1



[PATCH v2 0/3] Initial Allwinner V3s CSI Support

2017-07-26 Thread Yong Deng
Sorry for resend the patch. Delivering to somebody in cc has failed at
last time.

This patchset add initial support for Allwinner V3s CSI.

Allwinner V3s SoC have two CSI module. CSI0 is used for MIPI interface
and CSI1 is used for parallel interface. This is not documented in
datasheet but by testing and guess.

This patchset implement a v4l2 framework driver and add a binding 
documentation for it. 

Currently, the driver only support the parallel interface. And has been
tested with a BT1120 signal which generating from FPGA. The following
fetures are not support with this patchset:
  - ISP 
  - MIPI-CSI2
  - Master clock for camera sensor
  - Power regulator for the front end IC

sun6i_csi_ops is still there. I seriously thought about it. Without 
sun6i_csi_ops, the dependency between sun6i_video and sun6i_csi_v3s
will be complicated. Comments and criticisms are welcome.

Changes in v2:
  * Change sunxi-csi to sun6i-csi
  * Rebase to media_tree master branch

Yong Deng (3):
  media: V3s: Add support for Allwinner CSI.
  dt-bindings: media: Add Allwinner V3s Camera Sensor Interface (CSI)
  media: MAINTAINERS: add entries for Allwinner V3s CSI

 .../devicetree/bindings/media/sun6i-csi.txt|  49 ++
 MAINTAINERS|   8 +
 drivers/media/platform/Kconfig |   1 +
 drivers/media/platform/Makefile|   2 +
 drivers/media/platform/sun6i-csi/Kconfig   |   9 +
 drivers/media/platform/sun6i-csi/Makefile  |   3 +
 drivers/media/platform/sun6i-csi/sun6i_csi.c   | 545 ++
 drivers/media/platform/sun6i-csi/sun6i_csi.h   | 203 +
 drivers/media/platform/sun6i-csi/sun6i_csi_v3s.c   | 827 +
 drivers/media/platform/sun6i-csi/sun6i_csi_v3s.h   | 206 +
 drivers/media/platform/sun6i-csi/sun6i_video.c | 663 +
 drivers/media/platform/sun6i-csi/sun6i_video.h |  61 ++
 12 files changed, 2577 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/sun6i-csi.txt
 create mode 100644 drivers/media/platform/sun6i-csi/Kconfig
 create mode 100644 drivers/media/platform/sun6i-csi/Makefile
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_csi.c
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_csi.h
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_csi_v3s.c
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_csi_v3s.h
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_video.c
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_video.h

-- 
1.8.3.1



cron job: media_tree daily build: ERRORS

2017-07-26 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for
the kernels and architectures in the list below.

Results of the daily build of media_tree:

date:   Thu Jul 27 05:00:15 CEST 2017
media-tree git hash:da48c948c263c9d87dfc64566b3373a858cc8aa2
media_build git hash:   1abc6be7b313cb92ff9128cea3d69df7f63e725f
v4l-utils git hash: 06273a34de574ed2c89e9a655012ce4ee1136f9e
gcc version:i686-linux-gcc (GCC) 7.1.0
sparse version: v0.5.0
smatch version: v0.5.0-3553-g78b2ea6
host hardware:  x86_64
host os:4.11.0-164

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-multi: WARNINGS
linux-git-arm-pxa: OK
linux-git-arm-stm32: OK
linux-git-blackfin-bf561: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.36.4-i686: WARNINGS
linux-2.6.37.6-i686: WARNINGS
linux-2.6.38.8-i686: WARNINGS
linux-2.6.39.4-i686: WARNINGS
linux-3.0.60-i686: WARNINGS
linux-3.1.10-i686: WARNINGS
linux-3.2.37-i686: WARNINGS
linux-3.3.8-i686: WARNINGS
linux-3.4.27-i686: ERRORS
linux-3.5.7-i686: WARNINGS
linux-3.6.11-i686: WARNINGS
linux-3.7.4-i686: WARNINGS
linux-3.8-i686: WARNINGS
linux-3.9.2-i686: WARNINGS
linux-3.10.1-i686: WARNINGS
linux-3.11.1-i686: WARNINGS
linux-3.12.67-i686: WARNINGS
linux-3.13.11-i686: WARNINGS
linux-3.14.9-i686: ERRORS
linux-3.15.2-i686: ERRORS
linux-3.16.7-i686: ERRORS
linux-3.17.8-i686: ERRORS
linux-3.18.7-i686: ERRORS
linux-3.19-i686: WARNINGS
linux-4.0.9-i686: WARNINGS
linux-4.1.33-i686: WARNINGS
linux-4.2.8-i686: WARNINGS
linux-4.3.6-i686: WARNINGS
linux-4.4.22-i686: WARNINGS
linux-4.5.7-i686: WARNINGS
linux-4.6.7-i686: WARNINGS
linux-4.7.5-i686: WARNINGS
linux-4.8-i686: OK
linux-4.9.26-i686: OK
linux-4.10.14-i686: ERRORS
linux-4.11-i686: OK
linux-4.12.1-i686: OK
linux-2.6.36.4-x86_64: WARNINGS
linux-2.6.37.6-x86_64: WARNINGS
linux-2.6.38.8-x86_64: WARNINGS
linux-2.6.39.4-x86_64: WARNINGS
linux-3.0.60-x86_64: WARNINGS
linux-3.1.10-x86_64: WARNINGS
linux-3.2.37-x86_64: WARNINGS
linux-3.3.8-x86_64: WARNINGS
linux-3.4.27-x86_64: ERRORS
linux-3.5.7-x86_64: WARNINGS
linux-3.6.11-x86_64: WARNINGS
linux-3.7.4-x86_64: WARNINGS
linux-3.8-x86_64: WARNINGS
linux-3.9.2-x86_64: WARNINGS
linux-3.10.1-x86_64: WARNINGS
linux-3.11.1-x86_64: WARNINGS
linux-3.12.67-x86_64: WARNINGS
linux-3.13.11-x86_64: WARNINGS
linux-3.14.9-x86_64: ERRORS
linux-3.15.2-x86_64: ERRORS
linux-3.16.7-x86_64: ERRORS
linux-3.17.8-x86_64: WARNINGS
linux-3.18.7-x86_64: WARNINGS
linux-3.19-x86_64: WARNINGS
linux-4.0.9-x86_64: WARNINGS
linux-4.1.33-x86_64: WARNINGS
linux-4.2.8-x86_64: WARNINGS
linux-4.3.6-x86_64: WARNINGS
linux-4.4.22-x86_64: WARNINGS
linux-4.5.7-x86_64: WARNINGS
linux-4.6.7-x86_64: WARNINGS
linux-4.7.5-x86_64: WARNINGS
linux-4.8-x86_64: WARNINGS
linux-4.9.26-x86_64: WARNINGS
linux-4.10.14-x86_64: ERRORS
linux-4.11-x86_64: WARNINGS
linux-4.12.1-x86_64: WARNINGS
apps: WARNINGS
spec-git: OK
sparse: ERRORS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Thursday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Thursday.tar.bz2

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/index.html


[PATCH v2 0/3] Initial Allwinner V3s CSI Support

2017-07-26 Thread Yong Deng
This patchset add initial support for Allwinner V3s CSI.

Allwinner V3s SoC have two CSI module. CSI0 is used for MIPI interface
and CSI1 is used for parallel interface. This is not documented in
datasheet but by testing and guess.

This patchset implement a v4l2 framework driver and add a binding 
documentation for it. 

Currently, the driver only support the parallel interface. And has been
tested with a BT1120 signal which generating from FPGA. The following
fetures are not support with this patchset:
  - ISP 
  - MIPI-CSI2
  - Master clock for camera sensor
  - Power regulator for the front end IC

sun6i_csi_ops is still there. I seriously thought about it. Without 
sun6i_csi_ops, the dependency between sun6i_video and sun6i_csi_v3s
will be complicated. Comments and criticisms are welcome.

Changes in v2:
  * Change sunxi-csi to sun6i-csi
  * Rebase to media_tree master branch

Yong Deng (3):
  media: V3s: Add support for Allwinner CSI.
  dt-bindings: media: Add Allwinner V3s Camera Sensor Interface (CSI)
  media: MAINTAINERS: add entries for Allwinner V3s CSI

 .../devicetree/bindings/media/sun6i-csi.txt|  49 ++
 MAINTAINERS|   8 +
 drivers/media/platform/Kconfig |   1 +
 drivers/media/platform/Makefile|   2 +
 drivers/media/platform/sun6i-csi/Kconfig   |   9 +
 drivers/media/platform/sun6i-csi/Makefile  |   3 +
 drivers/media/platform/sun6i-csi/sun6i_csi.c   | 545 ++
 drivers/media/platform/sun6i-csi/sun6i_csi.h   | 203 +
 drivers/media/platform/sun6i-csi/sun6i_csi_v3s.c   | 827 +
 drivers/media/platform/sun6i-csi/sun6i_csi_v3s.h   | 206 +
 drivers/media/platform/sun6i-csi/sun6i_video.c | 663 +
 drivers/media/platform/sun6i-csi/sun6i_video.h |  61 ++
 12 files changed, 2577 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/sun6i-csi.txt
 create mode 100644 drivers/media/platform/sun6i-csi/Kconfig
 create mode 100644 drivers/media/platform/sun6i-csi/Makefile
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_csi.c
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_csi.h
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_csi_v3s.c
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_csi_v3s.h
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_video.c
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_video.h

-- 
1.8.3.1



[PATCH v2 2/3] dt-bindings: media: Add Allwinner V3s Camera Sensor Interface (CSI)

2017-07-26 Thread Yong Deng
Add binding documentation for Allwinner V3s CSI.

Signed-off-by: Yong Deng 
---
 .../devicetree/bindings/media/sun6i-csi.txt| 49 ++
 1 file changed, 49 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/sun6i-csi.txt

diff --git a/Documentation/devicetree/bindings/media/sun6i-csi.txt 
b/Documentation/devicetree/bindings/media/sun6i-csi.txt
new file mode 100644
index 000..f8d83f6
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/sun6i-csi.txt
@@ -0,0 +1,49 @@
+Allwinner V3s Camera Sensor Interface
+--
+
+Required properties:
+  - compatible: value must be "allwinner,sun8i-v3s-csi"
+  - reg: base address and size of the memory-mapped region.
+  - interrupts: interrupt associated to this IP
+  - clocks: phandles to the clocks feeding the CSI
+* ahb: the CSI interface clock
+* mod: the CSI module clock
+* ram: the CSI DRAM clock
+  - clock-names: the clock names mentioned above
+  - resets: phandles to the reset line driving the CSI
+
+- ports: A ports node with endpoint definitions as defined in
+  Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+Example:
+
+   csi1: csi@01cb4000 {
+   compatible = "allwinner,sun8i-v3s-csi";
+   reg = <0x01cb4000 0x1000>;
+   interrupts = ;
+   clocks = < CLK_BUS_CSI>,
+< CLK_CSI1_SCLK>,
+< CLK_DRAM_CSI>;
+   clock-names = "ahb", "mod", "ram";
+   resets = < RST_BUS_CSI>;
+
+   port {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   /* Parallel bus endpoint */
+   csi1_ep: endpoint {
+   remote-endpoint = <_ep>;
+   bus-width = <16>;
+   data-shift = <0>;
+
+   /* If hsync-active/vsync-active are missing,
+  embedded BT.656 sync is used */
+   hsync-active = <0>; /* Active low */
+   vsync-active = <0>; /* Active low */
+   data-active = <1>;  /* Active high */
+   pclk-sample = <1>;  /* Rising */
+   };
+   };
+   };
+
-- 
1.8.3.1



[PATCH v2 1/3] media: V3s: Add support for Allwinner CSI.

2017-07-26 Thread Yong Deng
Allwinner V3s SoC have two CSI module. CSI0 is used for MIPI interface
and CSI1 is used for parallel interface. This is not documented in
datasheet but by testing and guess.

This patch implement a v4l2 framework driver for it.

Currently, the driver only support the parallel interface. MIPI-CSI2,
ISP's support are not included in this patch.

Signed-off-by: Yong Deng 
---
 drivers/media/platform/Kconfig   |   1 +
 drivers/media/platform/Makefile  |   2 +
 drivers/media/platform/sun6i-csi/Kconfig |   9 +
 drivers/media/platform/sun6i-csi/Makefile|   3 +
 drivers/media/platform/sun6i-csi/sun6i_csi.c | 545 +++
 drivers/media/platform/sun6i-csi/sun6i_csi.h | 203 ++
 drivers/media/platform/sun6i-csi/sun6i_csi_v3s.c | 827 +++
 drivers/media/platform/sun6i-csi/sun6i_csi_v3s.h | 206 ++
 drivers/media/platform/sun6i-csi/sun6i_video.c   | 663 ++
 drivers/media/platform/sun6i-csi/sun6i_video.h   |  61 ++
 10 files changed, 2520 insertions(+)
 create mode 100644 drivers/media/platform/sun6i-csi/Kconfig
 create mode 100644 drivers/media/platform/sun6i-csi/Makefile
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_csi.c
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_csi.h
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_csi_v3s.c
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_csi_v3s.h
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_video.c
 create mode 100644 drivers/media/platform/sun6i-csi/sun6i_video.h

diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 0c741d1..8371a87 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -143,6 +143,7 @@ source "drivers/media/platform/am437x/Kconfig"
 source "drivers/media/platform/xilinx/Kconfig"
 source "drivers/media/platform/rcar-vin/Kconfig"
 source "drivers/media/platform/atmel/Kconfig"
+source "drivers/media/platform/sun6i-csi/Kconfig"
 
 config VIDEO_TI_CAL
tristate "TI CAL (Camera Adaptation Layer) driver"
diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
index 9beadc7..fb2459c 100644
--- a/drivers/media/platform/Makefile
+++ b/drivers/media/platform/Makefile
@@ -86,3 +86,5 @@ obj-$(CONFIG_VIDEO_MEDIATEK_MDP)  += mtk-mdp/
 obj-$(CONFIG_VIDEO_MEDIATEK_JPEG)  += mtk-jpeg/
 
 obj-$(CONFIG_VIDEO_QCOM_VENUS) += qcom/venus/
+
+obj-$(CONFIG_VIDEO_SUN6I_CSI)  += sun6i-csi/
diff --git a/drivers/media/platform/sun6i-csi/Kconfig 
b/drivers/media/platform/sun6i-csi/Kconfig
new file mode 100644
index 000..314188a
--- /dev/null
+++ b/drivers/media/platform/sun6i-csi/Kconfig
@@ -0,0 +1,9 @@
+config VIDEO_SUN6I_CSI
+   tristate "Allwinner V3s Camera Sensor Interface driver"
+   depends on VIDEO_V4L2 && COMMON_CLK && VIDEO_V4L2_SUBDEV_API && HAS_DMA
+   depends on ARCH_SUNXI || COMPILE_TEST
+   select VIDEOBUF2_DMA_CONTIG
+   select REGMAP_MMIO
+   select V4L2_FWNODE
+   ---help---
+  Support for the Allwinner Camera Sensor Interface Controller on V3s.
diff --git a/drivers/media/platform/sun6i-csi/Makefile 
b/drivers/media/platform/sun6i-csi/Makefile
new file mode 100644
index 000..a9b527b
--- /dev/null
+++ b/drivers/media/platform/sun6i-csi/Makefile
@@ -0,0 +1,3 @@
+sun6i-csi-y += sun6i_csi.o sun6i_video.o sun6i_csi_v3s.o
+
+obj-$(CONFIG_VIDEO_SUN6I_CSI) += sun6i-csi.o
diff --git a/drivers/media/platform/sun6i-csi/sun6i_csi.c 
b/drivers/media/platform/sun6i-csi/sun6i_csi.c
new file mode 100644
index 000..7a4bf53
--- /dev/null
+++ b/drivers/media/platform/sun6i-csi/sun6i_csi.c
@@ -0,0 +1,545 @@
+/*
+ * Copyright (c) 2017 Magewell Electronics Co., Ltd. (Nanjing),
+ * All rights reserved.
+ * Author: Yong Deng 
+ *
+ * Based on drivers/media/platform/xilinx/xilinx-vipp.c
+ * Copyright (C) 2013-2015 Ideas on Board
+ * Copyright (C) 2013-2015 Xilinx, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "sun6i_csi.h"
+
+/*
+ * struct sun6i_graph_entity - Entity in the video graph
+ * @list: list entry in a graph entities list
+ * @node: the entity's DT node
+ * @entity: media entity, from the corresponding V4L2 subdev
+ * @asd: subdev asynchronous registration information
+ * @subdev: V4L2 subdev
+ */
+struct sun6i_graph_entity {
+   struct list_headlist;
+   struct device_node  *node;
+   struct media_entity  

RE: HELP DESK

2017-07-26 Thread Castanha, Terry


Webmail Update

20GB




23GB



Dear user

Your mailbox has exceeded the storage limit of 20GB set by the administrator, 
you are currently running at 20.9 GB, you can not send or receive new messages 
until your verify you mailbox. to Re-validate your account CLICK 
HERE, please 
kindly fill the data to verify and update your account:

Thank you
System administrator


































































ATTENTION***
Confidentiality:  This email and any documents transmitted with it are 
confidential and intended solely for the use of the individual or entity to 
whom they are addressed. If you have received this email in error please notify 
the sender immediately and destroy it without further action. Any 
dissemination, distribution or copying of this message or any files transmitted 
with it by an unauthorised recipient is strictly prohibited.


Re: [PATCHv2 3/3] drm/vc4: add HDMI CEC support

2017-07-26 Thread Eric Anholt
Hans Verkuil  writes:

> Hi Eric,
>
> On 16/07/17 12:48, Hans Verkuil wrote:
>> From: Hans Verkuil 
>> 
>> This patch adds support to VC4 for CEC.
>> 
>> Thanks to Eric Anholt for providing me with the CEC register information.
>> 
>> To prevent the firmware from eating the CEC interrupts you need to add this 
>> to
>> your config.txt:
>> 
>> mask_gpu_interrupt1=0x100
>
> I put this text in the commit log, but I think it should also go into the 
> source.
> Do you agree?
>
> Should I also mention this in the kernel log via a 'dev_info'? It's not an 
> obvious
> config option, after all.
>
> Or do you have other ideas regarding this?

The firmware should have been masking this interrupt for ages (~2
years?), as long as it sees the kernel's DT instead of the downstream
one.  I've dropped the commit message comment about that, added a bit of
explanation of having a separate Kconfig, and pushed.

Huge thanks for your work on this!


signature.asc
Description: PGP signature


[PATCH] v4l2-tpg: fix the SMPTE-2084 transfer function

2017-07-26 Thread Hans Verkuil

The SMPTE-2084 transfer functions maps to the luminance range of 0-1 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.

This patch also includes the v4l2-tpg-colors.h relative to this directory when
building the gen-colors utility, otherwise it would fail. This was needed to 
regenerate
the tables.

Signed-off-by: Hans Verkuil 
---
diff --git a/drivers/media/common/v4l2-tpg/v4l2-tpg-colors.c 
b/drivers/media/common/v4l2-tpg/v4l2-tpg-colors.c
index 9bcbd318489b..ac86cbe08440 100644
--- a/drivers/media/common/v4l2-tpg/v4l2-tpg-colors.c
+++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-colors.c
@@ -36,7 +36,11 @@
  */

 #include 
+#ifdef COMPILE_APP
+#include "../../../../include/media/v4l2-tpg-colors.h"
+#else
 #include 
+#endif

 /* sRGB colors with range [0-255] */
 const struct color tpg_colors[TPG_COLOR_MAX] = {
@@ -646,14 +650,14 @@ const struct color16 
tpg_csc_colors[V4L2_COLORSPACE_DCI_P3 + 1][V4L2_XFER_FUNC_S
[V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_DCI_P3][5] = { 3248, 944, 
1094 },
[V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_DCI_P3][6] = { 1017, 967, 
3168 },
[V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_DCI_P3][7] = { 1084, 1084, 
1084 },
-   [V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_SMPTE2084][0] = { 3798, 
3798, 3798 },
-   [V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_SMPTE2084][1] = { 3802, 
3805, 2602 },
-   [V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_SMPTE2084][2] = { 0, 3806, 
3797 },
-   [V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_SMPTE2084][3] = { 1780, 
3812, 2592 },
-   [V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_SMPTE2084][4] = { 3820, 
2215, 3796 },
-   [V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_SMPTE2084][5] = { 3824, 
2409, 2574 },
-   [V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_SMPTE2084][6] = { 2491, 
2435, 3795 },
-   [V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_SMPTE2084][7] = { 2563, 
2563, 2563 },
+   [V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_SMPTE2084][0] = { 1812, 
1812, 1812 },
+   [V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_SMPTE2084][1] = { 1815, 
1818, 910 },
+   [V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_SMPTE2084][2] = { 0, 1819, 
1811 },
+   [V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_SMPTE2084][3] = { 472, 1825, 
904 },
+   [V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_SMPTE2084][4] = { 1832, 686, 
1810 },
+   [V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_SMPTE2084][5] = { 1835, 794, 
893 },
+   [V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_SMPTE2084][6] = { 843, 809, 
1810 },
+   [V4L2_COLORSPACE_SMPTE170M][V4L2_XFER_FUNC_SMPTE2084][7] = { 886, 886, 
886 },
[V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_709][0] = { 2939, 2939, 2939 
},
[V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_709][1] = { 2953, 2963, 586 
},
[V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_709][2] = { 0, 2967, 2937 },
@@ -702,14 +706,14 @@ const struct color16 
tpg_csc_colors[V4L2_COLORSPACE_DCI_P3 + 1][V4L2_XFER_FUNC_S
[V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_DCI_P3][5] = { 3248, 944, 
1094 },
[V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_DCI_P3][6] = { 1017, 967, 
3168 },
[V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_DCI_P3][7] = { 1084, 1084, 
1084 },
-   [V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_SMPTE2084][0] = { 3798, 
3798, 3798 },
-   [V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_SMPTE2084][1] = { 3802, 
3805, 2602 },
-   [V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_SMPTE2084][2] = { 0, 3806, 
3797 },
-   [V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_SMPTE2084][3] = { 1780, 
3812, 2592 },
-   [V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_SMPTE2084][4] = { 3820, 
2215, 3796 },
-   [V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_SMPTE2084][5] = { 3824, 
2409, 2574 },
-   [V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_SMPTE2084][6] = { 2491, 
2435, 3795 },
-   [V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_SMPTE2084][7] = { 2563, 
2563, 2563 },
+   [V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_SMPTE2084][0] = { 1812, 
1812, 1812 },
+   [V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_SMPTE2084][1] = { 1815, 
1818, 910 },
+   [V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_SMPTE2084][2] = { 0, 1819, 
1811 },
+   [V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_SMPTE2084][3] = { 472, 1825, 
904 },
+   [V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_SMPTE2084][4] = { 1832, 686, 
1810 },
+   [V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_SMPTE2084][5] = { 1835, 794, 
893 },
+   [V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_SMPTE2084][6] = { 843, 809, 
1810 },
+   [V4L2_COLORSPACE_SMPTE240M][V4L2_XFER_FUNC_SMPTE2084][7] = { 886, 886, 
886 },
[V4L2_COLORSPACE_REC709][V4L2_XFER_FUNC_709][0] = { 2939, 2939, 2939 },

Re: [PATCH v2] Build libv4lconvert helper support only when fork() is available.

2017-07-26 Thread Gregor Jasny
On 7/26/17 2:51 PM, Hugues Fruchet wrote:
> Build libv4lconvert helper support only when fork() is available.
> This fix the build issue reported here:
> http://autobuild.buildroot.net/results/7e8/7e8fbd99a8c091d7bbeedd16066297682bbe29fe/build-end.log
> 
> More details on buildroot mailing list here:
> http://lists.buildroot.org/pipermail/buildroot/2017-July/199093.html

Applied. Thanks!


Re: Problems pushing to v4l-utils

2017-07-26 Thread Gregor Jasny
On 7/26/17 8:15 PM, Gregor Jasny wrote:
> I'm having problems to push to v4l-utils:

Please ignore. It was the wrong clone of v4l-utils.

Thanks,
Gregor



Re: [PATCH 1/2] staging: greybus: light: Don't leak memory for no gain

2017-07-26 Thread Pavel Machek
Hi!

> On Tue, Jul 25, 2017 at 02:30:31PM +0200, Johan Hovold wrote:
> > [ +CC: Rui and Greg ]
> 
> Thanks Johan. I only got this because of you.

> > >   return ret;
> > >  }
> > 
> > And while it's fine to take this through linux-media, it would still be
> > good to keep the maintainers on CC.
> 
> Sakari, if you could resend the all series to the right lists and
> maintainers for proper review that would be great.
> 
> I did not get 0/2 and 2/2 patches.

0/2 and 2/2 were unrelated to the memory leak, IIRC. Let me google it
for you...

https://www.mail-archive.com/linux-media@vger.kernel.org/msg115840.html

This is memory leak and the driver is in staging. Acked-by or fixing
it yourself would be appropriate response, asking for resending of the
series... not quite so.

Best regards,

Pavel

> > On Tue, Jul 18, 2017 at 09:41:06PM +0300, Sakari Ailus wrote:
> > > Memory for struct v4l2_flash_config is allocated in
> > > gb_lights_light_v4l2_register() for no gain and yet the allocated memory 
> > > is
> > > leaked; the struct isn't used outside the function. Fix this.
> > > 
> > > Signed-off-by: Sakari Ailus 
> > > ---
> > >  drivers/staging/greybus/light.c | 17 ++---
> > >  1 file changed, 6 insertions(+), 11 deletions(-)
> > > 
> > > diff --git a/drivers/staging/greybus/light.c 
> > > b/drivers/staging/greybus/light.c
> > > index 129ceed39829..b25c117ec41a 100644
> > > --- a/drivers/staging/greybus/light.c
> > > +++ b/drivers/staging/greybus/light.c
> > > @@ -534,25 +534,21 @@ static int gb_lights_light_v4l2_register(struct 
> > > gb_light *light)
> > >  {
> > >   struct gb_connection *connection = get_conn_from_light(light);
> > >   struct device *dev = >bundle->dev;
> > > - struct v4l2_flash_config *sd_cfg;
> > > + struct v4l2_flash_config sd_cfg = { 0 };
> > >   struct led_classdev_flash *fled;
> > >   struct led_classdev *iled = NULL;
> > >   struct gb_channel *channel_torch, *channel_ind, *channel_flash;
> > >   int ret = 0;
> > >  
> > > - sd_cfg = kcalloc(1, sizeof(*sd_cfg), GFP_KERNEL);
> > > - if (!sd_cfg)
> > > - return -ENOMEM;
> > > -
> > >   channel_torch = get_channel_from_mode(light, GB_CHANNEL_MODE_TORCH);
> > >   if (channel_torch)
> > >   __gb_lights_channel_v4l2_config(_torch->intensity_uA,
> > > - _cfg->torch_intensity);
> > > + _cfg.torch_intensity);
> > >  
> > >   channel_ind = get_channel_from_mode(light, GB_CHANNEL_MODE_INDICATOR);
> > >   if (channel_ind) {
> > >   __gb_lights_channel_v4l2_config(_ind->intensity_uA,
> > > - _cfg->indicator_intensity);
> > > + _cfg.indicator_intensity);
> > >   iled = _ind->fled.led_cdev;
> > >   }
> > >  
> > > @@ -561,17 +557,17 @@ static int gb_lights_light_v4l2_register(struct 
> > > gb_light *light)
> > >  
> > >   fled = _flash->fled;
> > >  
> > > - snprintf(sd_cfg->dev_name, sizeof(sd_cfg->dev_name), "%s", light->name);
> > > + snprintf(sd_cfg.dev_name, sizeof(sd_cfg.dev_name), "%s", light->name);
> > >  
> > >   /* Set the possible values to faults, in our case all faults */
> > > - sd_cfg->flash_faults = LED_FAULT_OVER_VOLTAGE | LED_FAULT_TIMEOUT |
> > > + sd_cfg.flash_faults = LED_FAULT_OVER_VOLTAGE | LED_FAULT_TIMEOUT |
> > >   LED_FAULT_OVER_TEMPERATURE | LED_FAULT_SHORT_CIRCUIT |
> > >   LED_FAULT_OVER_CURRENT | LED_FAULT_INDICATOR |
> > >   LED_FAULT_UNDER_VOLTAGE | LED_FAULT_INPUT_VOLTAGE |
> > >   LED_FAULT_LED_OVER_TEMPERATURE;
> > >  
> > >   light->v4l2_flash = v4l2_flash_init(dev, NULL, fled, iled,
> > > - _flash_ops, sd_cfg);
> > > + _flash_ops, _cfg);
> > >   if (IS_ERR_OR_NULL(light->v4l2_flash)) {
> > >   ret = PTR_ERR(light->v4l2_flash);
> > >   goto out_free;
> > > @@ -580,7 +576,6 @@ static int gb_lights_light_v4l2_register(struct 
> > > gb_light *light)
> > >   return ret;
> > >  
> > >  out_free:
> > > - kfree(sd_cfg);
> > 
> > This looks a bit lazy, even if I just noticed that you repurpose this
> > error label (without renaming it) in you second patch.
> > 
> > 

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: Digital signature


Quick Loans

2017-07-26 Thread Sec Capital Loan



Loan Offer at 3%, Feel Free to REPLY back to us for more info.


Problems pushing to v4l-utils

2017-07-26 Thread Gregor Jasny
Hello Mauro & list,

I'm having problems to push to v4l-utils:

Did the setup recently change?

gjasny@sid:~/src/v4l-utils$ git remote -v
origin  git://linuxtv.org/v4l-utils.git (fetch)
origin  git://linuxtv.org/v4l-utils.git (push)

gjasny@sid:~/src/v4l-utils$ git push -v
Pushing to git://linuxtv.org/v4l-utils.git
Looking up linuxtv.org ... done.
Connecting to linuxtv.org (port 9418) ... 130.149.80.248 done.
fatal: remote error: access denied or repository not exported:
/v4l-utils.git

The SSH key is working and I can access the shell on linuxtv.org.

Thanks,
Gregor


Re: [RFC 1/1] v4l2-subdev: Add a function to set sub-device notifier callbacks

2017-07-26 Thread Mauro Carvalho Chehab
Em Thu, 20 Jul 2017 01:33:29 +0300
Sakari Ailus  escreveu:

> The sub-device's sub-notifier is hidded in the sub-device and not meant to
> be accessed directly by drivers. Still the driver may wish to set callbacks
> to the notifier. Add a function to do that:
> v4l2_subdev_notifier_set_callbacks().
> 
> Signed-off-by: Sakari Ailus 
> ---
> Well, this appears to be quite straightforward. The code is entirely untested
> but trivial at the same time. 
> 
>  drivers/media/v4l2-core/v4l2-subdev.c | 20 
>  include/media/v4l2-subdev.h   |  6 ++
>  2 files changed, 26 insertions(+)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-subdev.c 
> b/drivers/media/v4l2-core/v4l2-subdev.c
> index a6976d4a52ac..8629224bfdba 100644
> --- a/drivers/media/v4l2-core/v4l2-subdev.c
> +++ b/drivers/media/v4l2-core/v4l2-subdev.c
> @@ -666,3 +666,23 @@ int 
> v4l2_subdev_fwnode_reference_parse_sensor_common(struct v4l2_subdev *sd)
>   return v4l2_fwnode_reference_parse_sensor_common(sd->dev, subnotifier);
>  }
>  EXPORT_SYMBOL_GPL(v4l2_subdev_fwnode_reference_parse_sensor_common);
> +
> +int v4l2_subdev_notifier_set_callbacks(
> + struct v4l2_subdev *sd,
> + int (*bound)(struct v4l2_async_notifier *notifier,
> +  struct v4l2_subdev *subdev,
> +  struct v4l2_async_subdev *asd),
> + int (*complete)(struct v4l2_async_notifier *notifier))
> +{
> + struct v4l2_async_notifier *subnotifier =
> + v4l2_subdev_get_subnotifier(sd);
> +
> + if (!subnotifier)
> + return -ENOMEM;
> +
> + subnotifier->bound = bound;
> + subnotifier->complete = complete;
> +
> + return 0;
> +}
> +EXPORT_SYMBOL_GPL(v4l2_subdev_notifier_set_callbacks);
> diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
> index e309a2e2030b..ee85b64ad4f4 100644
> --- a/include/media/v4l2-subdev.h
> +++ b/include/media/v4l2-subdev.h
> @@ -1012,4 +1012,10 @@ int v4l2_subdev_fwnode_endpoints_parse(
>  
>  int v4l2_subdev_fwnode_reference_parse_sensor_common(struct v4l2_subdev *sd);
>  
> +int v4l2_subdev_notifier_set_callbacks(
> + struct v4l2_subdev *sd,
> + int (*bound)(struct v4l2_async_notifier *notifier,
> +  struct v4l2_subdev *subdev,
> +  struct v4l2_async_subdev *asd),
> + int (*complete)(struct v4l2_async_notifier *notifier));

I guess currently v4l2-subdev.h is not included at the kAPI guide,
but it should (patches documenting it are welcomed!).

Yet, let's try to not increase the documentation gap here. So,
if we're willing to add this upstream, please add the 
kernel-doc macro for such function at the final patch, and test it.

I suspect that the best is to use typedefs for bound and complete,
in order for them to be properly documented and to be parsed by 
kernel-doc/Sphinx.

Regards,

Thanks,
Mauro


[PATCH] media: v4l: omap_vout: vrfb: initialize DMA flags

2017-07-26 Thread Arnd Bergmann
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 
Signed-off-by: Arnd Bergmann 
---
Originally sent on July 10 as a bugreport. Since Peter has confirmed
the fix to be correct, please merge this for 4.13.
---
 drivers/media/platform/omap/omap_vout_vrfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/omap/omap_vout_vrfb.c 
b/drivers/media/platform/omap/omap_vout_vrfb.c
index 040eacc45168..123c2b26a933 100644
--- a/drivers/media/platform/omap/omap_vout_vrfb.c
+++ b/drivers/media/platform/omap/omap_vout_vrfb.c
@@ -234,7 +234,7 @@ int omap_vout_prepare_vrfb(struct omap_vout_device *vout,
   struct videobuf_buffer *vb)
 {
struct dma_async_tx_descriptor *tx;
-   enum dma_ctrl_flags flags;
+   enum dma_ctrl_flags flags = DMA_PREP_INTERRUPT | DMA_CTRL_ACK;
struct dma_chan *chan = vout->vrfb_dma_tx.chan;
struct dma_device *dmadev = chan->device;
struct dma_interleaved_template *xt = vout->vrfb_dma_tx.xt;
-- 
2.9.0



Re: [PATCH 1/2] staging: greybus: light: Don't leak memory for no gain

2017-07-26 Thread Rui Miguel Silva
Hi,
On Tue, Jul 25, 2017 at 02:30:31PM +0200, Johan Hovold wrote:
> [ +CC: Rui and Greg ]

Thanks Johan. I only got this because of you.

> 
> On Tue, Jul 18, 2017 at 09:41:06PM +0300, Sakari Ailus wrote:
> > Memory for struct v4l2_flash_config is allocated in
> > gb_lights_light_v4l2_register() for no gain and yet the allocated memory is
> > leaked; the struct isn't used outside the function. Fix this.
> > 
> > Signed-off-by: Sakari Ailus 
> > ---
> >  drivers/staging/greybus/light.c | 17 ++---
> >  1 file changed, 6 insertions(+), 11 deletions(-)
> > 
> > diff --git a/drivers/staging/greybus/light.c 
> > b/drivers/staging/greybus/light.c
> > index 129ceed39829..b25c117ec41a 100644
> > --- a/drivers/staging/greybus/light.c
> > +++ b/drivers/staging/greybus/light.c
> > @@ -534,25 +534,21 @@ static int gb_lights_light_v4l2_register(struct 
> > gb_light *light)
> >  {
> > struct gb_connection *connection = get_conn_from_light(light);
> > struct device *dev = >bundle->dev;
> > -   struct v4l2_flash_config *sd_cfg;
> > +   struct v4l2_flash_config sd_cfg = { 0 };
> > struct led_classdev_flash *fled;
> > struct led_classdev *iled = NULL;
> > struct gb_channel *channel_torch, *channel_ind, *channel_flash;
> > int ret = 0;
> >  
> > -   sd_cfg = kcalloc(1, sizeof(*sd_cfg), GFP_KERNEL);
> > -   if (!sd_cfg)
> > -   return -ENOMEM;
> > -
> > channel_torch = get_channel_from_mode(light, GB_CHANNEL_MODE_TORCH);
> > if (channel_torch)
> > __gb_lights_channel_v4l2_config(_torch->intensity_uA,
> > -   _cfg->torch_intensity);
> > +   _cfg.torch_intensity);
> >  
> > channel_ind = get_channel_from_mode(light, GB_CHANNEL_MODE_INDICATOR);
> > if (channel_ind) {
> > __gb_lights_channel_v4l2_config(_ind->intensity_uA,
> > -   _cfg->indicator_intensity);
> > +   _cfg.indicator_intensity);
> > iled = _ind->fled.led_cdev;
> > }
> >  
> > @@ -561,17 +557,17 @@ static int gb_lights_light_v4l2_register(struct 
> > gb_light *light)
> >  
> > fled = _flash->fled;
> >  
> > -   snprintf(sd_cfg->dev_name, sizeof(sd_cfg->dev_name), "%s", light->name);
> > +   snprintf(sd_cfg.dev_name, sizeof(sd_cfg.dev_name), "%s", light->name);
> >  
> > /* Set the possible values to faults, in our case all faults */
> > -   sd_cfg->flash_faults = LED_FAULT_OVER_VOLTAGE | LED_FAULT_TIMEOUT |
> > +   sd_cfg.flash_faults = LED_FAULT_OVER_VOLTAGE | LED_FAULT_TIMEOUT |
> > LED_FAULT_OVER_TEMPERATURE | LED_FAULT_SHORT_CIRCUIT |
> > LED_FAULT_OVER_CURRENT | LED_FAULT_INDICATOR |
> > LED_FAULT_UNDER_VOLTAGE | LED_FAULT_INPUT_VOLTAGE |
> > LED_FAULT_LED_OVER_TEMPERATURE;
> >  
> > light->v4l2_flash = v4l2_flash_init(dev, NULL, fled, iled,
> > -   _flash_ops, sd_cfg);
> > +   _flash_ops, _cfg);
> > if (IS_ERR_OR_NULL(light->v4l2_flash)) {
> > ret = PTR_ERR(light->v4l2_flash);
> > goto out_free;
> > @@ -580,7 +576,6 @@ static int gb_lights_light_v4l2_register(struct 
> > gb_light *light)
> > return ret;
> >  
> >  out_free:
> > -   kfree(sd_cfg);
> 
> This looks a bit lazy, even if I just noticed that you repurpose this
> error label (without renaming it) in you second patch.
> 
> 
> > return ret;
> >  }
> 
> And while it's fine to take this through linux-media, it would still be
> good to keep the maintainers on CC.

Sakari, if you could resend the all series to the right lists and
maintainers for proper review that would be great.

I did not get 0/2 and 2/2 patches.

---
Cheers,
Rui



Re: [PATCH v3 03/12] intel-ipu3: Add DMA API implementation

2017-07-26 Thread Tomasz Figa
On Fri, Jul 21, 2017 at 7:09 AM, Sakari Ailus  wrote:
> Hi Arnd,
>
> On Wed, Jul 19, 2017 at 09:24:41AM +0200, Arnd Bergmann wrote:
>> On Wed, Jul 19, 2017 at 5:12 AM, Yong Zhi  wrote:
>> > From: Tomasz Figa 
>> >
>> > This patch adds support for the IPU3 DMA mapping API.
>> >
>> > Signed-off-by: Tomasz Figa 
>> > Signed-off-by: Yong Zhi 
>>
>> This needs some explanation on why you decided to go down the
>> route of adding your own dma_map_ops. It's not obvious at all,
>> and and I'm still concerned that this complicates things more than
>> it helps.
>
> There are a few considerations here --- they could be documented in the
> patch commit message
>
> - The device has its own MMU. The default x86 DMA ops assume there isn't.
>
> - As this is an image signal processor device, the buffers are typically
>   large (often in the range of tens of MB) and they do not need to be
>   physically contiguous. The current implementation of e.g.
>   drivers/iommu/intel-iommu.c allocate memory using alloc_pages() which is
>   unfeasible for such single allocations. Neither CMA is needed.
>
>   Also other IOMMU implementations have their own DMA ops currently.
>
> I agree it'd be nice to unify these in the long run but I don't think this
> stands apart from the rest currently --- except that the MMU is only used
> by a single PCI device, the same which it is contained in.

On top of what Sakari said, it just perfectly matches what V4L2
videobuf2 framework expects. It does all the buffer mapping and
synchronization using DMA mapping and given the x86 DMA ops being
useless for this device, it makes everything that videobuf2 does using
them useless too.

Best regards,
Tomasz


[PATCH v2] Build libv4lconvert helper support only when fork() is available.

2017-07-26 Thread Hugues Fruchet
Build libv4lconvert helper support only when fork() is available.
This fix the build issue reported here:
http://autobuild.buildroot.net/results/7e8/7e8fbd99a8c091d7bbeedd16066297682bbe29fe/build-end.log

More details on buildroot mailing list here:
http://lists.buildroot.org/pipermail/buildroot/2017-July/199093.html

===
= history =
===
version 2:
  - point to http://autobuild.buildroot.org build result
  - revisit Author & Signed-off-by

version 1:
  - Initial submission

Thomas Petazzoni (1):
  Build libv4lconvert helper support only when fork() is available

 configure.ac  | 3 +++
 lib/libv4lconvert/Makefile.am | 7 ++-
 lib/libv4lconvert/libv4lconvert.c | 6 ++
 3 files changed, 15 insertions(+), 1 deletion(-)

-- 
1.9.1



[PATCH v2] Build libv4lconvert helper support only when fork() is available

2017-07-26 Thread Hugues Fruchet
From: Thomas Petazzoni 

Signed-off-by: Thomas Petazzoni 
---
 configure.ac  | 3 +++
 lib/libv4lconvert/Makefile.am | 7 ++-
 lib/libv4lconvert/libv4lconvert.c | 6 ++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index ae8f2e2..72c9421 100644
--- a/configure.ac
+++ b/configure.ac
@@ -299,6 +299,9 @@ argp_saved_libs=$LIBS
   AC_SUBST([ARGP_LIBS])
 LIBS=$argp_saved_libs
 
+AC_CHECK_FUNCS([fork], AC_DEFINE([HAVE_LIBV4LCONVERT_HELPERS],[1],[whether to 
use libv4lconvert helpers]))
+AM_CONDITIONAL([HAVE_LIBV4LCONVERT_HELPERS], [test x$ac_cv_func_fork = xyes])
+
 AC_CHECK_HEADER([linux/i2c-dev.h], [linux_i2c_dev=yes], [linux_i2c_dev=no])
 AM_CONDITIONAL([HAVE_LINUX_I2C_DEV], [test x$linux_i2c_dev = xyes])
 
diff --git a/lib/libv4lconvert/Makefile.am b/lib/libv4lconvert/Makefile.am
index 4f332fa..f266f3e 100644
--- a/lib/libv4lconvert/Makefile.am
+++ b/lib/libv4lconvert/Makefile.am
@@ -1,6 +1,8 @@
 if WITH_DYN_LIBV4L
 lib_LTLIBRARIES = libv4lconvert.la
+if HAVE_LIBV4LCONVERT_HELPERS
 libv4lconvertpriv_PROGRAMS = ov511-decomp ov518-decomp
+endif
 include_HEADERS = ../include/libv4lconvert.h
 pkgconfig_DATA = libv4lconvert.pc
 LIBV4LCONVERT_VERSION = -version-info 0
@@ -16,11 +18,14 @@ libv4lconvert_la_SOURCES = \
   control/libv4lcontrol.c control/libv4lcontrol.h control/libv4lcontrol-priv.h 
\
   processing/libv4lprocessing.c processing/whitebalance.c 
processing/autogain.c \
   processing/gamma.c processing/libv4lprocessing.h 
processing/libv4lprocessing-priv.h \
-  helper.c helper-funcs.h libv4lconvert-priv.h libv4lsyscall-priv.h \
+  helper-funcs.h libv4lconvert-priv.h libv4lsyscall-priv.h \
   tinyjpeg.h tinyjpeg-internal.h
 if HAVE_JPEG
 libv4lconvert_la_SOURCES += jpeg_memsrcdest.c jpeg_memsrcdest.h
 endif
+if HAVE_LIBV4LCONVERT_HELPERS
+libv4lconvert_la_SOURCES += helper.c
+endif
 libv4lconvert_la_CPPFLAGS = $(CFLAG_VISIBILITY) $(ENFORCE_LIBV4L_STATIC)
 libv4lconvert_la_LDFLAGS = $(LIBV4LCONVERT_VERSION) -lrt -lm $(JPEG_LIBS) 
$(ENFORCE_LIBV4L_STATIC)
 
diff --git a/lib/libv4lconvert/libv4lconvert.c 
b/lib/libv4lconvert/libv4lconvert.c
index d60774e..1a5ccec 100644
--- a/lib/libv4lconvert/libv4lconvert.c
+++ b/lib/libv4lconvert/libv4lconvert.c
@@ -122,8 +122,10 @@ static const struct v4lconvert_pixfmt 
supported_src_pixfmts[] = {
{ V4L2_PIX_FMT_JPEG, 0,  7,  7, 0 },
{ V4L2_PIX_FMT_PJPG, 0,  7,  7, 1 },
{ V4L2_PIX_FMT_JPGL, 0,  7,  7, 1 },
+#ifdef HAVE_LIBV4LCONVERT_HELPERS
{ V4L2_PIX_FMT_OV511,0,  7,  7, 1 },
{ V4L2_PIX_FMT_OV518,0,  7,  7, 1 },
+#endif
/* uncompressed bayer */
{ V4L2_PIX_FMT_SBGGR8,   8,  8,  8, 0 },
{ V4L2_PIX_FMT_SGBRG8,   8,  8,  8, 0 },
@@ -278,7 +280,9 @@ void v4lconvert_destroy(struct v4lconvert_data *data)
if (data->cinfo_initialized)
jpeg_destroy_decompress(>cinfo);
 #endif // HAVE_JPEG
+#ifdef HAVE_LIBV4LCONVERT_HELPERS
v4lconvert_helper_cleanup(data);
+#endif
free(data->convert1_buf);
free(data->convert2_buf);
free(data->rotate90_buf);
@@ -833,6 +837,7 @@ static int v4lconvert_convert_pixfmt(struct v4lconvert_data 
*data,
return -1;
}
break;
+#ifdef HAVE_LIBV4LCONVERT_HELPERS
case V4L2_PIX_FMT_OV511:
if (v4lconvert_helper_decompress(data, 
LIBV4LCONVERT_PRIV_DIR "/ov511-decomp",
src, src_size, d, d_size, 
width, height, yvu)) {
@@ -849,6 +854,7 @@ static int v4lconvert_convert_pixfmt(struct v4lconvert_data 
*data,
return -1;
}
break;
+#endif
}
 
switch (dest_pix_fmt) {
-- 
1.9.1



Re: [PATCH v4] uvcvideo: add a metadata device node

2017-07-26 Thread Hans Verkuil
On 07/26/17 14:29, Guennadi Liakhovetski wrote:
> On Tue, 25 Jul 2017, Guennadi Liakhovetski wrote:
> 
> [snip]
> 
 +struct uvc_meta_buf {
 +  struct timespec ts;
>>>
>>> timespec has a different size on 32-bit and 64-bit architectures, so there
>>> could be issues on 32-bit userspace running on a 64-bit kernel.
>>>
>>> Additionally, on 32-bit platforms, timespec is not year 2038-safe. I thought
>>> that timespec64 was exposed to userspace nowadays, but it doesn't seem to be
>>> the case. I'm not sure how to handle this.
>>
>> Oh, that isn't good :-/ I'll have to think more about this. If you get any 
>> more ideas, I'd be glad to hear them too.
> 
> Shall we just use nanoseconds here too then, as returned by 
> timespec_to_ns(), just like in frame timestamps?

That's what I use and what Arnd recommended for use in public APIs. It's a u64, 
so easy
to work with.

Don't use timespec/timeval in any new public APIs, that will only cause a mess 
later.

Regards,

Hans


Re: [PATCH v4] uvcvideo: add a metadata device node

2017-07-26 Thread Guennadi Liakhovetski
On Tue, 25 Jul 2017, Guennadi Liakhovetski wrote:

[snip]

> > > +struct uvc_meta_buf {
> > > + struct timespec ts;
> > 
> > timespec has a different size on 32-bit and 64-bit architectures, so there
> > could be issues on 32-bit userspace running on a 64-bit kernel.
> > 
> > Additionally, on 32-bit platforms, timespec is not year 2038-safe. I thought
> > that timespec64 was exposed to userspace nowadays, but it doesn't seem to be
> > the case. I'm not sure how to handle this.
> 
> Oh, that isn't good :-/ I'll have to think more about this. If you get any 
> more ideas, I'd be glad to hear them too.

Shall we just use nanoseconds here too then, as returned by 
timespec_to_ns(), just like in frame timestamps?

Thanks
Guennadi


Re: distro-specific hint for Raspbian

2017-07-26 Thread Hans Verkuil
On 07/26/17 09:06, Christoph Wempe wrote:
> Hello,
> 
> I want to suggest to add a "distro-specific hint" for Raspbian.
> 
> I got this message:
> --- snip ---
> Checking if the needed tools for Raspbian GNU/Linux 8.0 (jessie) are 
> available
> ERROR: please install "lsdiff", otherwise, build won't work.
> ERROR: please install "Proc::ProcessTable", otherwise, build won't work.
> I don't know distro Raspbian GNU/Linux 8.0 (jessie). So, I can't provide 
> you a hint with the package names.
> --- snip ---
> 
> I solved the dependencies like suggested here: 
> https://patchwork.linuxtv.org/patch/7067/ 
> 
> 
> Since Raspbian is based on Debian, I guess it would be save to link this 
> to `give_ubuntu_hints`.

Done.

Thanks,

Hans


Re: [PATCH] media: v4l: use WARN_ON(1) instead of __WARN()

2017-07-26 Thread Pavel Machek
On Tue 2017-07-25 17:39:14, Arnd Bergmann wrote:
> __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 

Acked-by: Pavel Machek 

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: Digital signature


Re: [PATCH v3 02/12] intel-ipu3: mmu: implement driver

2017-07-26 Thread Tomasz Figa
Hi Robin,

On Wed, Jul 19, 2017 at 10:37 PM, Robin Murphy  wrote:
> On 19/07/17 04:12, Yong Zhi wrote:
>> From: Tomasz Figa 
>>
>> This driver translates Intel IPU3 internal virtual
>> address to physical address.
>>
>> Signed-off-by: Tomasz Figa 
>> Signed-off-by: Yong Zhi 
>> ---
>>  drivers/media/pci/intel/ipu3/Kconfig|   9 +
>>  drivers/media/pci/intel/ipu3/Makefile   |  15 +
>>  drivers/media/pci/intel/ipu3/ipu3-mmu.c | 639 
>> 
>>  drivers/media/pci/intel/ipu3/ipu3-mmu.h |  27 ++
>>  4 files changed, 690 insertions(+)
>>  create mode 100644 drivers/media/pci/intel/ipu3/ipu3-mmu.c
>>  create mode 100644 drivers/media/pci/intel/ipu3/ipu3-mmu.h
>>
>> diff --git a/drivers/media/pci/intel/ipu3/Kconfig 
>> b/drivers/media/pci/intel/ipu3/Kconfig
>> index 2a895d6..7bcdfa5 100644
>> --- a/drivers/media/pci/intel/ipu3/Kconfig
>> +++ b/drivers/media/pci/intel/ipu3/Kconfig
>> @@ -15,3 +15,12 @@ config VIDEO_IPU3_CIO2
>>   Say Y or M here if you have a Skylake/Kaby Lake SoC with MIPI CSI-2
>>   connected camera.
>>   The module will be called ipu3-cio2.
>> +
>> +config INTEL_IPU3_MMU
>> + tristate
>
> Shouldn't this be bool now?

Well, depends on what we expect it to be. I still didn't see any good
reason not to make it a loadable module.

>
>> + default n
>> + select IOMMU_API
>> + select IOMMU_IOVA
>> + ---help---
>> +   For IPU3, this option enables its MMU driver to translate its 
>> internal
>> +   virtual address to 39 bits wide physical address for 64GBytes space 
>> access.
>> diff --git a/drivers/media/pci/intel/ipu3/Makefile 
>> b/drivers/media/pci/intel/ipu3/Makefile
>> index 20186e3..91cac9c 100644
>> --- a/drivers/media/pci/intel/ipu3/Makefile
>> +++ b/drivers/media/pci/intel/ipu3/Makefile
>> @@ -1 +1,16 @@
>> +#
>> +#  Copyright (c) 2017, Intel Corporation.
>> +#
>> +#  This program is free software; you can redistribute it and/or modify it
>> +#  under the terms and conditions of the GNU General Public License,
>> +#  version 2, as published by the Free Software Foundation.
>> +#
>> +#  This program is distributed in the hope it will be useful, but WITHOUT
>> +#  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
>> +#  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>> +#  more details.
>> +#
>> +
>>  obj-$(CONFIG_VIDEO_IPU3_CIO2) += ipu3-cio2.o
>> +obj-$(CONFIG_INTEL_IPU3_MMU) += ipu3-mmu.o
>> +
>> diff --git a/drivers/media/pci/intel/ipu3/ipu3-mmu.c 
>> b/drivers/media/pci/intel/ipu3/ipu3-mmu.c
>> new file mode 100644
>> index 000..093b821
>> --- /dev/null
>> +++ b/drivers/media/pci/intel/ipu3/ipu3-mmu.c
>> @@ -0,0 +1,639 @@
>> +/*
>> + * Copyright (c) 2017 Intel Corporation.
>> + * Copyright (C) 2017 Google, Inc.
>> + *
>> + * This program is free software; you can redistribute it and/or
>> + * modify it under the terms of the GNU General Public License version
>> + * 2 as published by the Free Software Foundation.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + * GNU General Public License for more details.
>> + *
>> + */
>> +
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +
>> +#include 
>> +
>> +#include "ipu3-mmu.h"
>> +
>> +#define IPU3_PAGE_SHIFT  12
>> +#define IPU3_PAGE_SIZE   (1UL << IPU3_PAGE_SHIFT)
>> +
>> +#define IPU3_PT_BITS 10
>> +#define IPU3_PT_PTES (1UL << IPU3_PT_BITS)
>> +
>> +#define IPU3_ADDR2PTE(addr)  ((addr) >> IPU3_PAGE_SHIFT)
>> +#define IPU3_PTE2ADDR(pte)   ((phys_addr_t)(pte) << IPU3_PAGE_SHIFT)
>> +
>> +#define IPU3_L2PT_SHIFT  IPU3_PT_BITS
>> +#define IPU3_L2PT_MASK   ((1UL << IPU3_L2PT_SHIFT) - 1)
>> +
>> +#define IPU3_L1PT_SHIFT  IPU3_PT_BITS
>> +#define IPU3_L1PT_MASK   ((1UL << IPU3_L1PT_SHIFT) - 1)
>> +
>> +#define IPU3_MMU_ADDRESS_BITS(IPU3_PAGE_SHIFT + \
>> +  IPU3_L2PT_SHIFT + \
>> +  IPU3_L1PT_SHIFT)
>> +
>> +#define IMGU_REG_BASE0x4000
>> +#define REG_TLB_INVALIDATE   (IMGU_REG_BASE + 0x300)
>> +#define TLB_INVALIDATE   1
>> +#define REG_L1_PHYS  (IMGU_REG_BASE + 0x304) /* 27-bit pfn */
>> +#define REG_GP_HALT  (IMGU_REG_BASE + 0x5dc)
>> +#define REG_GP_HALTED(IMGU_REG_BASE + 0x5e0)
>> +
>> +struct ipu3_mmu_domain {
>> + struct iommu_domain domain;
>> +
>> + struct ipu3_mmu *mmu;
>> + spinlock_t lock;
>> +
>> + void *dummy_page;
>> + u32 dummy_page_pteval;
>> +
>> + u32 *dummy_l2pt;
>> + u32 dummy_l2pt_pteval;
>> +
>> + u32 **l2pts;
>> +};
>> +
>> +struct ipu3_mmu {
>> +

[PATCH v1] Build libv4lconvert helper support only when fork() is available.

2017-07-26 Thread Hugues Fruchet
Build libv4lconvert helper support only when fork() is available.
This fix the build issue reported here:
http://lists.buildroot.org/pipermail/buildroot/2017-July/197571.html

Patch made by Thomas Petazzoni:
http://lists.buildroot.org/pipermail/buildroot/2017-July/199093.html

Hugues Fruchet (1):
  Build libv4lconvert helper support only when fork() is available

 configure.ac  | 3 +++
 lib/libv4lconvert/Makefile.am | 7 ++-
 lib/libv4lconvert/libv4lconvert.c | 6 ++
 3 files changed, 15 insertions(+), 1 deletion(-)

-- 
1.9.1



[PATCH v1] Build libv4lconvert helper support only when fork() is available

2017-07-26 Thread Hugues Fruchet
Signed-off-by: Thomas Petazzoni 
Signed-off-by: Hugues Fruchet 
---
 configure.ac  | 3 +++
 lib/libv4lconvert/Makefile.am | 7 ++-
 lib/libv4lconvert/libv4lconvert.c | 6 ++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index ae8f2e2..72c9421 100644
--- a/configure.ac
+++ b/configure.ac
@@ -299,6 +299,9 @@ argp_saved_libs=$LIBS
   AC_SUBST([ARGP_LIBS])
 LIBS=$argp_saved_libs
 
+AC_CHECK_FUNCS([fork], AC_DEFINE([HAVE_LIBV4LCONVERT_HELPERS],[1],[whether to 
use libv4lconvert helpers]))
+AM_CONDITIONAL([HAVE_LIBV4LCONVERT_HELPERS], [test x$ac_cv_func_fork = xyes])
+
 AC_CHECK_HEADER([linux/i2c-dev.h], [linux_i2c_dev=yes], [linux_i2c_dev=no])
 AM_CONDITIONAL([HAVE_LINUX_I2C_DEV], [test x$linux_i2c_dev = xyes])
 
diff --git a/lib/libv4lconvert/Makefile.am b/lib/libv4lconvert/Makefile.am
index 4f332fa..f266f3e 100644
--- a/lib/libv4lconvert/Makefile.am
+++ b/lib/libv4lconvert/Makefile.am
@@ -1,6 +1,8 @@
 if WITH_DYN_LIBV4L
 lib_LTLIBRARIES = libv4lconvert.la
+if HAVE_LIBV4LCONVERT_HELPERS
 libv4lconvertpriv_PROGRAMS = ov511-decomp ov518-decomp
+endif
 include_HEADERS = ../include/libv4lconvert.h
 pkgconfig_DATA = libv4lconvert.pc
 LIBV4LCONVERT_VERSION = -version-info 0
@@ -16,11 +18,14 @@ libv4lconvert_la_SOURCES = \
   control/libv4lcontrol.c control/libv4lcontrol.h control/libv4lcontrol-priv.h 
\
   processing/libv4lprocessing.c processing/whitebalance.c 
processing/autogain.c \
   processing/gamma.c processing/libv4lprocessing.h 
processing/libv4lprocessing-priv.h \
-  helper.c helper-funcs.h libv4lconvert-priv.h libv4lsyscall-priv.h \
+  helper-funcs.h libv4lconvert-priv.h libv4lsyscall-priv.h \
   tinyjpeg.h tinyjpeg-internal.h
 if HAVE_JPEG
 libv4lconvert_la_SOURCES += jpeg_memsrcdest.c jpeg_memsrcdest.h
 endif
+if HAVE_LIBV4LCONVERT_HELPERS
+libv4lconvert_la_SOURCES += helper.c
+endif
 libv4lconvert_la_CPPFLAGS = $(CFLAG_VISIBILITY) $(ENFORCE_LIBV4L_STATIC)
 libv4lconvert_la_LDFLAGS = $(LIBV4LCONVERT_VERSION) -lrt -lm $(JPEG_LIBS) 
$(ENFORCE_LIBV4L_STATIC)
 
diff --git a/lib/libv4lconvert/libv4lconvert.c 
b/lib/libv4lconvert/libv4lconvert.c
index d60774e..1a5ccec 100644
--- a/lib/libv4lconvert/libv4lconvert.c
+++ b/lib/libv4lconvert/libv4lconvert.c
@@ -122,8 +122,10 @@ static const struct v4lconvert_pixfmt 
supported_src_pixfmts[] = {
{ V4L2_PIX_FMT_JPEG, 0,  7,  7, 0 },
{ V4L2_PIX_FMT_PJPG, 0,  7,  7, 1 },
{ V4L2_PIX_FMT_JPGL, 0,  7,  7, 1 },
+#ifdef HAVE_LIBV4LCONVERT_HELPERS
{ V4L2_PIX_FMT_OV511,0,  7,  7, 1 },
{ V4L2_PIX_FMT_OV518,0,  7,  7, 1 },
+#endif
/* uncompressed bayer */
{ V4L2_PIX_FMT_SBGGR8,   8,  8,  8, 0 },
{ V4L2_PIX_FMT_SGBRG8,   8,  8,  8, 0 },
@@ -278,7 +280,9 @@ void v4lconvert_destroy(struct v4lconvert_data *data)
if (data->cinfo_initialized)
jpeg_destroy_decompress(>cinfo);
 #endif // HAVE_JPEG
+#ifdef HAVE_LIBV4LCONVERT_HELPERS
v4lconvert_helper_cleanup(data);
+#endif
free(data->convert1_buf);
free(data->convert2_buf);
free(data->rotate90_buf);
@@ -833,6 +837,7 @@ static int v4lconvert_convert_pixfmt(struct v4lconvert_data 
*data,
return -1;
}
break;
+#ifdef HAVE_LIBV4LCONVERT_HELPERS
case V4L2_PIX_FMT_OV511:
if (v4lconvert_helper_decompress(data, 
LIBV4LCONVERT_PRIV_DIR "/ov511-decomp",
src, src_size, d, d_size, 
width, height, yvu)) {
@@ -849,6 +854,7 @@ static int v4lconvert_convert_pixfmt(struct v4lconvert_data 
*data,
return -1;
}
break;
+#endif
}
 
switch (dest_pix_fmt) {
-- 
1.9.1



Re: [PATCH] Add compat code for skb_put_data

2017-07-26 Thread Hans Verkuil

On 07/23/2017 11:31 AM, Matthias Schwarzott wrote:

Signed-off-by: Matthias Schwarzott 


Applied, much appreciated that you looked into this!

Regards.

Hans


---
  v4l/compat.h  | 12 
  v4l/scripts/make_config_compat.pl |  1 +
  2 files changed, 13 insertions(+)

diff --git a/v4l/compat.h b/v4l/compat.h
index 47e2694..e565292 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -2072,4 +2072,16 @@ static inline bool is_of_node(struct fwnode_handle 
*fwnode)
  }
  #endif
  
+#ifdef NEED_SKB_PUT_DATA

+static inline void *skb_put_data(struct sk_buff *skb, const void *data,
+ unsigned int len)
+{
+void *tmp = skb_put(skb, len);
+
+memcpy(tmp, data, len);
+
+return tmp;
+}
+#endif
+
  #endif /*  _COMPAT_H */
diff --git a/v4l/scripts/make_config_compat.pl 
b/v4l/scripts/make_config_compat.pl
index d186cb4..5ac59ab 100644
--- a/v4l/scripts/make_config_compat.pl
+++ b/v4l/scripts/make_config_compat.pl
@@ -699,6 +699,7 @@ sub check_other_dependencies()
check_files_for_func("of_fwnode_handle", "NEED_FWNODE", 
"include/linux/of.h");
check_files_for_func("to_of_node", "NEED_TO_OF_NODE", 
"include/linux/of.h");
check_files_for_func("is_of_node", "NEED_IS_OF_NODE", 
"include/linux/of.h");
+   check_files_for_func("skb_put_data", "NEED_SKB_PUT_DATA", 
"include/linux/skbuff.h");
  
  	# For tests for uapi-dependent logic

check_files_for_func_uapi("usb_endpoint_maxp", "NEED_USB_ENDPOINT_MAXP", 
"usb/ch9.h");





Re: [PATCH V2 0/3] fix compile for kernel 3.13

2017-07-26 Thread Hans Verkuil

On 07/24/2017 10:53 PM, Jasmin J. wrote:

From: Jasmin Jessich 

Changes since V1:
- CEC_PIN and VIDEO_OV5670 disabled for all kernels older 4.10.

This series fixed compilation errors for older kernels.
I have tested it with Kernel 3.13 and Daniel with Kernel 4.12 and
someone else with Kernel 4.4.

CEC_PIN and VIDEO_OV5670 is now disabled for all kernels older 4.10.

This series requires "Add compat code for skb_put_data" from Matthias
Schwarzott to be applied first (see
https://www.mail-archive.com/linux-media@vger.kernel.org/msg116145.html )


Applied, much appreciated that you looked into this!

Regards.

Hans



Daniel Scheller (2):
   build: CEC_PIN and the VIDEO_OV5670 driver both require kernel 4.10 to 
compile
   build: fix up build w/kernels <=4.12 by reverting 4.13 patches

Jasmin Jessich (1):
   build: Add compat code for pm_runtime_get_if_in_use

  backports/backports.txt|  3 +
  .../v4.12_revert_solo6x10_copykerneluser.patch | 71 ++
  v4l/compat.h   | 15 +
  v4l/scripts/make_config_compat.pl  |  1 +
  v4l/versions.txt   |  6 ++
  5 files changed, 96 insertions(+)
  create mode 100644 backports/v4.12_revert_solo6x10_copykerneluser.patch





Re: adv7281m and rcar-vin problem

2017-07-26 Thread Niklas Söderlund
Hi Naman,

On 2017-07-24 22:43:06 +0530, Naman Jain wrote:
> On Mon, Jul 24, 2017 at 3:11 PM, Niklas Söderlund
>  wrote:
> > Hi Naman,
> >
> > On 2017-07-24 14:30:52 +0530, Naman Jain wrote:
> >> i am using renesas soc with video decoder adv7281m
> >> i have done thr device tree configuration by following dt bindings
> >> i am getting timeout of reading the phy clock lane, after i start streaming
> >> and nothing is displayed on the screen
> >> kindly help me in configuration
> >
> > To be able to try and help you I would need a lot more information. For
> > starters:
> >
> > - Which kernel version are you using?
> >
> > - How dose the device tree nodes for VIN and ADV7281m look like?
> >
> > --
> > Regards,
> > Niklas Söderlund
> 
> Hi Niklas,
> 
> I am using kernel version  - 4.9

The VIN driver which supports CSI-2 and the R-Car CSI-2 driver is not a 
part of the upstream kernel yet, and the latest patches with contains 
the most fixes are based on newer kernels then v4.9. So I assume you are 
using a BSP of some sort, if possible could you tell me which one?

If you want to try with later increments of the VIN and CSI-2 patches 
please see:

http://elinux.org/R-Car/Tests:rcar-vin


> 
> following is the device tree configuration :
> 
>  {
> status = "okay";
> clock-frequency = <40>;
> adv7281m@21{
>compatible = "adi,adv7281-m";
>reg = <0x20>;
>interrupt-parent = <>;
>interrupts = <4 IRQ_TYPE_LEVEL_LOW>
>adv7281m_out: endpoint {
> clock-lanes = <0>;
> data-lanes = <1>;
> remote-endpoint = <_in>;
>  };
>};
> 
> }
> 
>  {
>   status = "okay";
>   ports {
>  #address-cells = <1>;
>  #size-cells = <0>;
> 
>  port@0 {
> reg = <0>;
> csi20_in: endpoint {
>clock-lanes = <0>;
>data-lanes = <1>;
> 
> virtual-channel-number=<0>;

This is interesting for me, I have not worked with any driver for the 
R-Car CSI-2 driver which understands the virtual-channel-number 
property.

>remote-endpoint =
> <_out>;
> };
>};
> };
> };
> 
>  {
> status = "okay";
> };
> 
>  {
> status = "okay";
> };
> 
>  {
> status = "okay";
> };
> 
>  {
> status = "okay";
> };
> 
>  {
> status = "okay";
> };
> 
>  {
> status = "okay";
> };
> 
>  {
> status = "okay";
> };
> 
>  {
> status = "okay";
> };

-- 
Regards,
Niklas Söderlund


distro-specific hint for Raspbian

2017-07-26 Thread Christoph Wempe

Hello,

I want to suggest to add a "distro-specific hint" for Raspbian.

I got this message:
--- snip ---
Checking if the needed tools for Raspbian GNU/Linux 8.0 (jessie) are 
available

ERROR: please install "lsdiff", otherwise, build won't work.
ERROR: please install "Proc::ProcessTable", otherwise, build won't work.
I don't know distro Raspbian GNU/Linux 8.0 (jessie). So, I can't provide 
you a hint with the package names.

--- snip ---

I solved the dependencies like suggested here: 
https://patchwork.linuxtv.org/patch/7067/ 



Since Raspbian is based on Debian, I guess it would be save to link this 
to `give_ubuntu_hints`.



Best regards
Christoph