cron job: media_tree daily build: WARNINGS

2017-11-13 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:   Tue Nov 14 05:00:21 CET 2017
media-tree git hash:eb0c19942288569e0ae492476534d5a485fb8ab4
media_build git hash:   097aaf3e4e4bfdeff130db9697dec1befeb3221b
v4l-utils git hash: 7b2d48ff594dcc2c9b395463441e5abb4f5e9439
gcc version:i686-linux-gcc (GCC) 7.1.0
sparse version: 0.5.1 (Debian: 0.5.1-2)
smatch version: v0.5.0-3553-g78b2ea6
host hardware:  x86_64
host os:4.13.0-164

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-multi: OK
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: WARNINGS
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: WARNINGS
linux-3.15.2-i686: WARNINGS
linux-3.16.7-i686: WARNINGS
linux-3.17.8-i686: WARNINGS
linux-3.18.7-i686: WARNINGS
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: OK
linux-4.11-i686: OK
linux-4.12.1-i686: OK
linux-4.13-i686: OK
linux-4.14-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: WARNINGS
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: WARNINGS
linux-3.15.2-x86_64: WARNINGS
linux-3.16.7-x86_64: WARNINGS
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: WARNINGS
linux-4.11-x86_64: WARNINGS
linux-4.12.1-x86_64: WARNINGS
linux-4.13-x86_64: OK
linux-4.14-x86_64: OK
apps: OK
spec-git: OK
sparse: WARNINGS

Detailed results are available here:

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

Full logs are available here:

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

The Media Infrastructure API from this daily build is here:

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


Re: [PATCH 2/3] atomisp: fix vfree of bogus data on unload

2017-11-13 Thread Alan Cox
On Tue, 14 Nov 2017 00:05:48 +0200
Sakari Ailus  wrote:

> Hi Alan,
> 
> On Mon, Nov 06, 2017 at 11:36:45PM +, Alan wrote:
> > We load the firmware once, set pointers to it and then at some point release
> > it. We should not be doing a vfree() on the pointers into the firmware.
> > 
> > Signed-off-by: Alan Cox 
> > ---
> >  .../atomisp/pci/atomisp2/css2400/sh_css_firmware.c |2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git 
> > a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c 
> > b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
> > index 8158ea40d069..f181bd8fcee2 100644
> > --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
> > +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
> > @@ -288,8 +288,6 @@ void sh_css_unload_firmware(void)
> > for (i = 0; i < sh_css_num_binaries; i++) {
> > if (fw_minibuffer[i].name)
> > kfree((void *)fw_minibuffer[i].name);
> > -   if (fw_minibuffer[i].buffer)
> > -   vfree((void *)fw_minibuffer[i].buffer);  
> 
> You shouldn't end up here if the firmware is just loaded once. If multiple
> times, then yes.

You end up there when unloading the module.

> The memory appears to have been allocated using kmalloc() in some cases.
> How about kvfree(), or changing that kmalloc() to vmalloc()

I'll take a deeper look at what is going on.

Alan


Re: [PATCH 2/3] atomisp: fix vfree of bogus data on unload

2017-11-13 Thread Sakari Ailus
Hi Alan,

On Mon, Nov 06, 2017 at 11:36:45PM +, Alan wrote:
> We load the firmware once, set pointers to it and then at some point release
> it. We should not be doing a vfree() on the pointers into the firmware.
> 
> Signed-off-by: Alan Cox 
> ---
>  .../atomisp/pci/atomisp2/css2400/sh_css_firmware.c |2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git 
> a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c 
> b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
> index 8158ea40d069..f181bd8fcee2 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
> @@ -288,8 +288,6 @@ void sh_css_unload_firmware(void)
>   for (i = 0; i < sh_css_num_binaries; i++) {
>   if (fw_minibuffer[i].name)
>   kfree((void *)fw_minibuffer[i].name);
> - if (fw_minibuffer[i].buffer)
> - vfree((void *)fw_minibuffer[i].buffer);

You shouldn't end up here if the firmware is just loaded once. If multiple
times, then yes.

The memory appears to have been allocated using kmalloc() in some cases.
How about kvfree(), or changing that kmalloc() to vmalloc()?

>   }
>   kfree(fw_minibuffer);
>   fw_minibuffer = NULL;
> 

-- 
Sakari Ailus
sakari.ai...@linux.intel.com


[no subject]

2017-11-13 Thread Friedrich Mayrhofer


This is the second time i am sending you this Email.

I, Friedrich Mayrhofer Donate $ 1,000,000.00 to You, Email Me  
personally for more details.


Regards.
Friedrich Mayrhofer






This message was sent using IMP, the Internet Messaging Program.



Re: [PATCH 08/10] video/hdmi: Reject illegal picture aspect ratios

2017-11-13 Thread Jose Abreu


On 13-11-2017 17:04, Ville Syrjala wrote:
> From: Ville Syrjälä 
>
> AVI infoframe can only carry none, 4:3, or 16:9 picture aspect
> ratios. Return an error if the user asked for something different.
>
> Cc: Shashank Sharma 
> Cc: "Lin, Jia" 
> Cc: Akashdeep Sharma 
> Cc: Jim Bride 
> Cc: Jose Abreu 
> Cc: Daniel Vetter 
> Cc: Emil Velikov 
> Cc: Thierry Reding 
> Cc: Hans Verkuil 
> Cc: linux-media@vger.kernel.org
> Signed-off-by: Ville Syrjälä 

Reviewed-by: Jose Abreu 

Best Regards,
Jose Miguel Abreu



Reply

2017-11-13 Thread JOJO AKPE
Open the attached file and read my message.


Re: et8ek8: Document support for flash and lens devices

2017-11-13 Thread Sakari Ailus
On Sun, Nov 12, 2017 at 03:25:47PM +0100, Sebastian Reichel wrote:
> Hi,
> 
> On Sun, Nov 12, 2017 at 12:27:29PM +0100, Pavel Machek wrote:
> > 
> > Document dts support of LED/focus.
> > 
> > Signed-off-by: Pavel Machek 
> 
> Reviewed-by: Sebastian Reichel 

Thanks, guys!

Applied, with "dt-bindings: " prefix added to the subject.

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi


[PATCH 08/10] video/hdmi: Reject illegal picture aspect ratios

2017-11-13 Thread Ville Syrjala
From: Ville Syrjälä 

AVI infoframe can only carry none, 4:3, or 16:9 picture aspect
ratios. Return an error if the user asked for something different.

Cc: Shashank Sharma 
Cc: "Lin, Jia" 
Cc: Akashdeep Sharma 
Cc: Jim Bride 
Cc: Jose Abreu 
Cc: Daniel Vetter 
Cc: Emil Velikov 
Cc: Thierry Reding 
Cc: Hans Verkuil 
Cc: linux-media@vger.kernel.org
Signed-off-by: Ville Syrjälä 
---
 drivers/video/hdmi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
index 111a0ab6280a..38716eb50408 100644
--- a/drivers/video/hdmi.c
+++ b/drivers/video/hdmi.c
@@ -93,6 +93,9 @@ ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infoframe 
*frame, void *buffer,
if (size < length)
return -ENOSPC;
 
+   if (frame->picture_aspect > HDMI_PICTURE_ASPECT_16_9)
+   return -EINVAL;
+
memset(buffer, 0, size);
 
ptr[0] = frame->type;
-- 
2.13.6



[PATCH 10/10] video/hdmi: Pass buffer size to infoframe unpack functions

2017-11-13 Thread Ville Syrjala
From: Ville Syrjälä 

To make sure the infoframe unpack functions don't end up examining
stack garbage or oopsing, let's pass in the size of the buffer.

Cc: Thierry Reding 
Cc: Hans Verkuil 
Cc: linux-media@vger.kernel.org
Signed-off-by: Ville Syrjälä 
---
 drivers/media/i2c/adv7511.c  |  2 +-
 drivers/media/i2c/adv7604.c  |  2 +-
 drivers/media/i2c/adv7842.c  |  2 +-
 drivers/media/i2c/tc358743.c |  2 +-
 drivers/video/hdmi.c | 51 
 include/linux/hdmi.h |  2 +-
 6 files changed, 42 insertions(+), 19 deletions(-)

diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c
index 2817bafc67bf..dec09c18ea34 100644
--- a/drivers/media/i2c/adv7511.c
+++ b/drivers/media/i2c/adv7511.c
@@ -562,7 +562,7 @@ static void log_infoframe(struct v4l2_subdev *sd, const 
struct adv7511_cfg_read_
buffer[3] = 0;
buffer[3] = hdmi_infoframe_checksum(buffer, len + 4);
 
-   if (hdmi_infoframe_unpack(, buffer) < 0) {
+   if (hdmi_infoframe_unpack(, buffer, sizeof(buffer)) < 0) {
v4l2_err(sd, "%s: unpack of %s infoframe failed\n", __func__, 
cri->desc);
return;
}
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index f289b8aca1da..8500438af0d3 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -2429,7 +2429,7 @@ static int adv76xx_read_infoframe(struct v4l2_subdev *sd, 
int index,
buffer[i + 3] = infoframe_read(sd,
   adv76xx_cri[index].payload_addr + i);
 
-   if (hdmi_infoframe_unpack(frame, buffer) < 0) {
+   if (hdmi_infoframe_unpack(frame, buffer, sizeof(buffer)) < 0) {
v4l2_err(sd, "%s: unpack of %s infoframe failed\n", __func__,
 adv76xx_cri[index].desc);
return -ENOENT;
diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c
index 65f34e7e146f..fd5d5e84dcbf 100644
--- a/drivers/media/i2c/adv7842.c
+++ b/drivers/media/i2c/adv7842.c
@@ -2576,7 +2576,7 @@ static void log_infoframe(struct v4l2_subdev *sd, struct 
adv7842_cfg_read_infofr
for (i = 0; i < len; i++)
buffer[i + 3] = infoframe_read(sd, cri->payload_addr + i);
 
-   if (hdmi_infoframe_unpack(, buffer) < 0) {
+   if (hdmi_infoframe_unpack(, buffer, sizeof(buffer)) < 0) {
v4l2_err(sd, "%s: unpack of %s infoframe failed\n", __func__, 
cri->desc);
return;
}
diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
index e6f5c363ccab..f6a5ebffd9c6 100644
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -453,7 +453,7 @@ static void print_avi_infoframe(struct v4l2_subdev *sd)
 
i2c_rd(sd, PK_AVI_0HEAD, buffer, HDMI_INFOFRAME_SIZE(AVI));
 
-   if (hdmi_infoframe_unpack(, buffer) < 0) {
+   if (hdmi_infoframe_unpack(, buffer, sizeof(buffer)) < 0) {
v4l2_err(sd, "%s: unpack of AVI infoframe failed\n", __func__);
return;
}
diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
index 65b915ea4936..b5d491014b0b 100644
--- a/drivers/video/hdmi.c
+++ b/drivers/video/hdmi.c
@@ -1005,8 +1005,9 @@ EXPORT_SYMBOL(hdmi_infoframe_log);
 
 /**
  * hdmi_avi_infoframe_unpack() - unpack binary buffer to a HDMI AVI infoframe
- * @buffer: source buffer
  * @frame: HDMI AVI infoframe
+ * @buffer: source buffer
+ * @size: size of buffer
  *
  * Unpacks the information contained in binary @buffer into a structured
  * @frame of the HDMI Auxiliary Video (AVI) information frame.
@@ -1016,11 +1017,14 @@ EXPORT_SYMBOL(hdmi_infoframe_log);
  * Returns 0 on success or a negative error code on failure.
  */
 static int hdmi_avi_infoframe_unpack(struct hdmi_avi_infoframe *frame,
-const void *buffer)
+const void *buffer, size_t size)
 {
const u8 *ptr = buffer;
int ret;
 
+   if (size < HDMI_INFOFRAME_SIZE(AVI))
+   return -EINVAL;
+
if (ptr[0] != HDMI_INFOFRAME_TYPE_AVI ||
ptr[1] != 2 ||
ptr[2] != HDMI_AVI_INFOFRAME_SIZE)
@@ -1068,8 +1072,9 @@ static int hdmi_avi_infoframe_unpack(struct 
hdmi_avi_infoframe *frame,
 
 /**
  * hdmi_spd_infoframe_unpack() - unpack binary buffer to a HDMI SPD infoframe
- * @buffer: source buffer
  * @frame: HDMI SPD infoframe
+ * @buffer: source buffer
+ * @size: size of buffer
  *
  * Unpacks the information contained in binary @buffer into a structured
  * @frame of the HDMI Source Product Description (SPD) information frame.
@@ -1079,11 +1084,14 @@ static int hdmi_avi_infoframe_unpack(struct 
hdmi_avi_infoframe *frame,
  * Returns 0 on success or a negative error code on failure.
  */
 static int hdmi_spd_infoframe_unpack(struct hdmi_spd_infoframe 

[PATCH 09/10] video/hdmi: Constify 'buffer' to the unpack functions

2017-11-13 Thread Ville Syrjala
From: Ville Syrjälä 

The unpack functions just read from the passed in buffer,
so make it const.

Cc: Thierry Reding 
Cc: Hans Verkuil 
Cc: linux-media@vger.kernel.org
Signed-off-by: Ville Syrjälä 
---
 drivers/video/hdmi.c | 23 ---
 include/linux/hdmi.h |  3 ++-
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
index 38716eb50408..65b915ea4936 100644
--- a/drivers/video/hdmi.c
+++ b/drivers/video/hdmi.c
@@ -31,7 +31,7 @@
 
 #define hdmi_log(fmt, ...) dev_printk(level, dev, fmt, ##__VA_ARGS__)
 
-static u8 hdmi_infoframe_checksum(u8 *ptr, size_t size)
+static u8 hdmi_infoframe_checksum(const u8 *ptr, size_t size)
 {
u8 csum = 0;
size_t i;
@@ -1016,9 +1016,9 @@ EXPORT_SYMBOL(hdmi_infoframe_log);
  * Returns 0 on success or a negative error code on failure.
  */
 static int hdmi_avi_infoframe_unpack(struct hdmi_avi_infoframe *frame,
-void *buffer)
+const void *buffer)
 {
-   u8 *ptr = buffer;
+   const u8 *ptr = buffer;
int ret;
 
if (ptr[0] != HDMI_INFOFRAME_TYPE_AVI ||
@@ -1079,9 +1079,9 @@ static int hdmi_avi_infoframe_unpack(struct 
hdmi_avi_infoframe *frame,
  * Returns 0 on success or a negative error code on failure.
  */
 static int hdmi_spd_infoframe_unpack(struct hdmi_spd_infoframe *frame,
-void *buffer)
+const void *buffer)
 {
-   u8 *ptr = buffer;
+   const u8 *ptr = buffer;
int ret;
 
if (ptr[0] != HDMI_INFOFRAME_TYPE_SPD ||
@@ -1117,9 +1117,9 @@ static int hdmi_spd_infoframe_unpack(struct 
hdmi_spd_infoframe *frame,
  * Returns 0 on success or a negative error code on failure.
  */
 static int hdmi_audio_infoframe_unpack(struct hdmi_audio_infoframe *frame,
-  void *buffer)
+  const void *buffer)
 {
-   u8 *ptr = buffer;
+   const u8 *ptr = buffer;
int ret;
 
if (ptr[0] != HDMI_INFOFRAME_TYPE_AUDIO ||
@@ -1163,9 +1163,9 @@ static int hdmi_audio_infoframe_unpack(struct 
hdmi_audio_infoframe *frame,
  */
 static int
 hdmi_vendor_any_infoframe_unpack(union hdmi_vendor_any_infoframe *frame,
-void *buffer)
+const void *buffer)
 {
-   u8 *ptr = buffer;
+   const u8 *ptr = buffer;
size_t length;
int ret;
u8 hdmi_video_format;
@@ -1234,10 +1234,11 @@ hdmi_vendor_any_infoframe_unpack(union 
hdmi_vendor_any_infoframe *frame,
  *
  * Returns 0 on success or a negative error code on failure.
  */
-int hdmi_infoframe_unpack(union hdmi_infoframe *frame, void *buffer)
+int hdmi_infoframe_unpack(union hdmi_infoframe *frame,
+ const void *buffer)
 {
int ret;
-   u8 *ptr = buffer;
+   const u8 *ptr = buffer;
 
switch (ptr[0]) {
case HDMI_INFOFRAME_TYPE_AVI:
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
index d271ff23984f..d3816170c062 100644
--- a/include/linux/hdmi.h
+++ b/include/linux/hdmi.h
@@ -332,7 +332,8 @@ union hdmi_infoframe {
 
 ssize_t
 hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer, size_t size);
-int hdmi_infoframe_unpack(union hdmi_infoframe *frame, void *buffer);
+int hdmi_infoframe_unpack(union hdmi_infoframe *frame,
+ const void *buffer);
 void hdmi_infoframe_log(const char *level, struct device *dev,
union hdmi_infoframe *frame);
 
-- 
2.13.6



[PATCH 01/10] video/hdmi: Allow "empty" HDMI infoframes

2017-11-13 Thread Ville Syrjala
From: Ville Syrjälä 

HDMI 2.0 Appendix F suggest that we should keep sending the infoframe
when switching from 3D to 2D mode, even if the infoframe isn't strictly
necessary (ie. not needed to transmit the VIC or stereo information).
This is a workaround against some sinks that fail to realize that they
should switch from 3D to 2D mode when the source stop transmitting
the infoframe.

v2: Handle unpack() as well
Pull the length calculation into a helper

Cc: Shashank Sharma 
Cc: Andrzej Hajda 
Cc: Thierry Reding 
Cc: Hans Verkuil 
Cc: linux-media@vger.kernel.org
Reviewed-by: Andrzej Hajda  #v1
Signed-off-by: Ville Syrjälä 
---
 drivers/video/hdmi.c | 51 +++
 1 file changed, 31 insertions(+), 20 deletions(-)

diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
index 1cf907ecded4..111a0ab6280a 100644
--- a/drivers/video/hdmi.c
+++ b/drivers/video/hdmi.c
@@ -321,6 +321,17 @@ int hdmi_vendor_infoframe_init(struct 
hdmi_vendor_infoframe *frame)
 }
 EXPORT_SYMBOL(hdmi_vendor_infoframe_init);
 
+static int hdmi_vendor_infoframe_length(const struct hdmi_vendor_infoframe 
*frame)
+{
+   /* for side by side (half) we also need to provide 3D_Ext_Data */
+   if (frame->s3d_struct >= HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF)
+   return 6;
+   else if (frame->vic != 0 || frame->s3d_struct != 
HDMI_3D_STRUCTURE_INVALID)
+   return 5;
+   else
+   return 4;
+}
+
 /**
  * hdmi_vendor_infoframe_pack() - write a HDMI vendor infoframe to binary 
buffer
  * @frame: HDMI infoframe
@@ -341,19 +352,11 @@ ssize_t hdmi_vendor_infoframe_pack(struct 
hdmi_vendor_infoframe *frame,
u8 *ptr = buffer;
size_t length;
 
-   /* empty info frame */
-   if (frame->vic == 0 && frame->s3d_struct == HDMI_3D_STRUCTURE_INVALID)
-   return -EINVAL;
-
/* only one of those can be supplied */
if (frame->vic != 0 && frame->s3d_struct != HDMI_3D_STRUCTURE_INVALID)
return -EINVAL;
 
-   /* for side by side (half) we also need to provide 3D_Ext_Data */
-   if (frame->s3d_struct >= HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF)
-   frame->length = 6;
-   else
-   frame->length = 5;
+   frame->length = hdmi_vendor_infoframe_length(frame);
 
length = HDMI_INFOFRAME_HEADER_SIZE + frame->length;
 
@@ -372,14 +375,16 @@ ssize_t hdmi_vendor_infoframe_pack(struct 
hdmi_vendor_infoframe *frame,
ptr[5] = 0x0c;
ptr[6] = 0x00;
 
-   if (frame->vic) {
-   ptr[7] = 0x1 << 5;  /* video format */
-   ptr[8] = frame->vic;
-   } else {
+   if (frame->s3d_struct != HDMI_3D_STRUCTURE_INVALID) {
ptr[7] = 0x2 << 5;  /* video format */
ptr[8] = (frame->s3d_struct & 0xf) << 4;
if (frame->s3d_struct >= HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF)
ptr[9] = (frame->s3d_ext_data & 0xf) << 4;
+   } else if (frame->vic) {
+   ptr[7] = 0x1 << 5;  /* video format */
+   ptr[8] = frame->vic;
+   } else {
+   ptr[7] = 0x0 << 5;  /* video format */
}
 
hdmi_infoframe_set_checksum(buffer, length);
@@ -1165,7 +1170,7 @@ hdmi_vendor_any_infoframe_unpack(union 
hdmi_vendor_any_infoframe *frame,
 
if (ptr[0] != HDMI_INFOFRAME_TYPE_VENDOR ||
ptr[1] != 1 ||
-   (ptr[2] != 5 && ptr[2] != 6))
+   (ptr[2] != 4 && ptr[2] != 5 && ptr[2] != 6))
return -EINVAL;
 
length = ptr[2];
@@ -1193,16 +1198,22 @@ hdmi_vendor_any_infoframe_unpack(union 
hdmi_vendor_any_infoframe *frame,
 
hvf->length = length;
 
-   if (hdmi_video_format == 0x1) {
-   hvf->vic = ptr[4];
-   } else if (hdmi_video_format == 0x2) {
+   if (hdmi_video_format == 0x2) {
+   if (length != 5 && length != 6)
+   return -EINVAL;
hvf->s3d_struct = ptr[4] >> 4;
if (hvf->s3d_struct >= HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF) {
-   if (length == 6)
-   hvf->s3d_ext_data = ptr[5] >> 4;
-   else
+   if (length != 6)
return -EINVAL;
+   hvf->s3d_ext_data = ptr[5] >> 4;
}
+   } else if (hdmi_video_format == 0x1) {
+   if (length != 5)
+   return -EINVAL;
+   hvf->vic = ptr[4];
+   } else {
+   if (length != 4)
+   return -EINVAL;
}
 
return 0;
-- 
2.13.6



[PATCH 00/10] drm/edid: Infoframe cleanups and fixes

2017-11-13 Thread Ville Syrjala
From: Ville Syrjälä 

This series tries to fix some issues with HDMI infoframes. In particular
we can currently send a bogus picture aspect ratio in the infoframe. I
included stuff to to make the infoframe unpakc more robust, evne though
we don't (yet) use it in drm. Additionally I included my earlier "empty"
HDMI infoframe support.

I have further work piled up on top which allows us to precompuet the
infoframes during the atomic check phase. But the series would have
become rather big, so I wanted to post these fixes and cleanups first.

Entire series (with the infoframe precompute) is available here:
git://github.com/vsyrjala/linux.git infoframe_precompute

Cc: Akashdeep Sharma 
Cc: Andrzej Hajda 
Cc: Daniel Vetter 
Cc: Emil Velikov 
Cc: Hans Verkuil 
Cc: Jim Bride 
Cc: Jose Abreu 
Cc: Laurent Pinchart 
Cc: "Lin, Jia" 
Cc: linux-media@vger.kernel.org
Cc: Sean Paul 
Cc: Shashank Sharma 
Cc: Thierry Reding 

Ville Syrjälä (10):
  video/hdmi: Allow "empty" HDMI infoframes
  drm/edid: Allow HDMI infoframe without VIC or S3D
  drm/modes: Introduce drm_mode_match()
  drm/edid: Use drm_mode_match_no_clocks_no_stereo() for consistentcy
  drm/edid: Fix up edid_cea_modes[] formatting
  drm/edid: Fix cea mode aspect ratio handling
  drm/edid: Don't send bogus aspect ratios in AVI infoframes
  video/hdmi: Reject illegal picture aspect ratios
  video/hdmi: Constify 'buffer' to the unpack functions
  video/hdmi: Pass buffer size to infoframe unpack functions

 drivers/gpu/drm/bridge/sil-sii8620.c  |   3 +-
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c |   4 +-
 drivers/gpu/drm/drm_edid.c| 159 +++---
 drivers/gpu/drm/drm_modes.c   | 134 +++--
 drivers/gpu/drm/exynos/exynos_hdmi.c  |   2 +-
 drivers/gpu/drm/i915/intel_hdmi.c |  14 +--
 drivers/gpu/drm/mediatek/mtk_hdmi.c   |   3 +-
 drivers/gpu/drm/nouveau/nv50_display.c|   3 +-
 drivers/gpu/drm/rockchip/inno_hdmi.c  |   1 +
 drivers/gpu/drm/sti/sti_hdmi.c|   4 +-
 drivers/gpu/drm/zte/zx_hdmi.c |   1 +
 drivers/media/i2c/adv7511.c   |   2 +-
 drivers/media/i2c/adv7604.c   |   2 +-
 drivers/media/i2c/adv7842.c   |   2 +-
 drivers/media/i2c/tc358743.c  |   2 +-
 drivers/video/hdmi.c  | 118 ++
 include/drm/drm_connector.h   |   5 +
 include/drm/drm_edid.h|   1 +
 include/drm/drm_modes.h   |   9 ++
 include/linux/hdmi.h  |   3 +-
 20 files changed, 326 insertions(+), 146 deletions(-)

-- 
2.13.6



Re: [PATCH] media: et8ek8: select V4L2_FWNODE

2017-11-13 Thread Sebastian Reichel
Hi,

On Mon, Nov 13, 2017 at 02:56:45PM +0100, Arnd Bergmann wrote:
> v4l2_async_register_subdev_sensor_common() is only provided when
> CONFIG_V4L2_FWNODE is enabled, otherwise we get a link failure:
> 
> drivers/media/i2c/et8ek8/et8ek8_driver.o: In function `et8ek8_probe':
> et8ek8_driver.c:(.text+0x884): undefined reference to 
> `v4l2_async_register_subdev_sensor_common'
> 
> This adds a Kconfig 'select' statement like all the other users of
> this interface have.
> 
> Fixes: d8932f38c10f ("media: et8ek8: Add support for flash and lens devices")
> Signed-off-by: Arnd Bergmann 
> ---

Reviewed-by: Sebastian Reichel 

-- Sebastian

>  drivers/media/i2c/et8ek8/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/i2c/et8ek8/Kconfig 
> b/drivers/media/i2c/et8ek8/Kconfig
> index 14399365ad7f..9fe409e95666 100644
> --- a/drivers/media/i2c/et8ek8/Kconfig
> +++ b/drivers/media/i2c/et8ek8/Kconfig
> @@ -1,6 +1,7 @@
>  config VIDEO_ET8EK8
>   tristate "ET8EK8 camera sensor support"
>   depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
> + select V4L2_FWNODE
>   ---help---
> This is a driver for the Toshiba ET8EK8 5 MP camera sensor.
> It is used for example in Nokia N900 (RX-51).
> -- 
> 2.9.0
> 


signature.asc
Description: PGP signature


Re:

2017-11-13 Thread Amos Kalonzo
Attn:

I am wondering why You haven't respond to my email for some days now.
reference to my client's contract balance payment of (11.7M,USD)
Kindly get back to me for more details.

Best Regards

Amos Kalonzo


[RFCv1 PATCH 2/6] v4l2-ctrls: prepare internal structs for request API

2017-11-13 Thread Hans Verkuil
From: Hans Verkuil 

Add a refcount and is_request bool to struct v4l2_ctrl_handler:
this is used to refcount a handler that represents a request.

Add a p_req field to struct v4l2_ctrl_ref that will store the
request value.

Signed-off-by: Hans Verkuil 
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 1 +
 include/media/v4l2-ctrls.h   | 4 
 2 files changed, 5 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index 2e58381444d1..1ff8fc59fff5 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -1761,6 +1761,7 @@ int v4l2_ctrl_handler_init_class(struct v4l2_ctrl_handler 
*hdl,
  sizeof(hdl->buckets[0]),
  GFP_KERNEL | __GFP_ZERO);
hdl->error = hdl->buckets ? 0 : -ENOMEM;
+   hdl->is_request = false;
return hdl->error;
 }
 EXPORT_SYMBOL(v4l2_ctrl_handler_init_class);
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index a762f3392d90..a215f25a82cf 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -18,6 +18,7 @@
 #define _V4L2_CTRLS_H
 
 #include 
+#include 
 #include 
 #include 
 
@@ -250,6 +251,7 @@ struct v4l2_ctrl_ref {
struct v4l2_ctrl_ref *next;
struct v4l2_ctrl *ctrl;
struct v4l2_ctrl_helper *helper;
+   union v4l2_ctrl_ptr p_req;
bool from_other_dev;
 };
 
@@ -285,7 +287,9 @@ struct v4l2_ctrl_handler {
v4l2_ctrl_notify_fnc notify;
void *notify_priv;
u16 nr_of_buckets;
+   bool is_request;
int error;
+   struct kref ref;
 };
 
 /**
-- 
2.14.1



[RFCv1 PATCH 5/6] v4l2-ctrls: support g/s_ext_ctrls for requests

2017-11-13 Thread Hans Verkuil
From: Hans Verkuil 

The v4l2_g/s_ext_ctrls functions now support control handlers that
represent requests.

Signed-off-by: Hans Verkuil 
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 37 
 1 file changed, 33 insertions(+), 4 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index f8de43032b78..36b00ad2d5cb 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -1528,6 +1528,13 @@ static int new_to_user(struct v4l2_ext_control *c,
return ptr_to_user(c, ctrl, ctrl->p_new);
 }
 
+/* Helper function: copy the request value back to the caller */
+static int req_to_user(struct v4l2_ext_control *c,
+  struct v4l2_ctrl_ref *ref)
+{
+   return ptr_to_user(c, ref->ctrl, ref->p_req);
+}
+
 /* Helper function: copy the initial control value back to the caller */
 static int def_to_user(struct v4l2_ext_control *c, struct v4l2_ctrl *ctrl)
 {
@@ -1647,6 +1654,14 @@ static void cur_to_new(struct v4l2_ctrl *ctrl)
ptr_to_ptr(ctrl, ctrl->p_cur, ctrl->p_new);
 }
 
+/* Copy the new value to the request value */
+static void new_to_req(struct v4l2_ctrl_ref *ref)
+{
+   if (!ref)
+   return;
+   ptr_to_ptr(ref->ctrl, ref->ctrl->p_new, ref->p_req);
+}
+
 /* Return non-zero if one or more of the controls in the cluster has a new
value that differs from the current value. */
 static int cluster_changed(struct v4l2_ctrl *master)
@@ -2975,7 +2990,8 @@ int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, 
struct v4l2_ext_controls *cs
struct v4l2_ctrl *ctrl);
struct v4l2_ctrl *master;
 
-   ctrl_to_user = def_value ? def_to_user : cur_to_user;
+   ctrl_to_user = def_value ? def_to_user :
+  (hdl->is_request ? NULL : cur_to_user);
 
if (helpers[i].mref == NULL)
continue;
@@ -3001,8 +3017,12 @@ int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, 
struct v4l2_ext_controls *cs
u32 idx = i;
 
do {
-   ret = ctrl_to_user(cs->controls + idx,
-  helpers[idx].ref->ctrl);
+   if (ctrl_to_user)
+   ret = ctrl_to_user(cs->controls + idx,
+   helpers[idx].ref->ctrl);
+   else
+   ret = req_to_user(cs->controls + idx,
+   helpers[idx].ref);
idx = helpers[idx].next;
} while (!ret && idx);
}
@@ -3275,7 +3295,16 @@ static int try_set_ext_ctrls(struct v4l2_fh *fh, struct 
v4l2_ctrl_handler *hdl,
} while (!ret && idx);
 
if (!ret)
-   ret = try_or_set_cluster(fh, master, set, 0);
+   ret = try_or_set_cluster(fh, master,
+!hdl->is_request && set, 0);
+   if (!ret && hdl->is_request && set) {
+   for (j = 0; j < master->ncontrols; j++) {
+   struct v4l2_ctrl_ref *ref =
+   find_ref(hdl, master->cluster[j]->id);
+
+   new_to_req(ref);
+   }
+   }
 
/* Copy the new values back to userspace. */
if (!ret) {
-- 
2.14.1



[RFCv1 PATCH 6/6] v4l2-ctrls: add v4l2_ctrl_request_setup

2017-11-13 Thread Hans Verkuil
From: Hans Verkuil 

Add a helper function that can set controls from a request.

Signed-off-by: Hans Verkuil 
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 71 
 include/media/v4l2-ctrls.h   |  2 +
 2 files changed, 73 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index 36b00ad2d5cb..5513061b033d 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -1662,6 +1662,14 @@ static void new_to_req(struct v4l2_ctrl_ref *ref)
ptr_to_ptr(ref->ctrl, ref->ctrl->p_new, ref->p_req);
 }
 
+/* Copy the request value to the new value */
+static void req_to_new(struct v4l2_ctrl_ref *ref)
+{
+   if (!ref)
+   return;
+   ptr_to_ptr(ref->ctrl, ref->p_req, ref->ctrl->p_new);
+}
+
 /* Return non-zero if one or more of the controls in the cluster has a new
value that differs from the current value. */
 static int cluster_changed(struct v4l2_ctrl *master)
@@ -3431,6 +3439,69 @@ int __v4l2_ctrl_s_ctrl_string(struct v4l2_ctrl *ctrl, 
const char *s)
 }
 EXPORT_SYMBOL(__v4l2_ctrl_s_ctrl_string);
 
+void v4l2_ctrl_request_setup(struct v4l2_ctrl_handler *hdl)
+{
+   struct v4l2_ctrl_ref *ref;
+
+   if (!hdl)
+   return;
+
+   mutex_lock(hdl->lock);
+
+   list_for_each_entry(ref, >ctrl_refs, node)
+   ref->done = false;
+
+   list_for_each_entry(ref, >ctrl_refs, node) {
+   struct v4l2_ctrl *ctrl = ref->ctrl;
+   struct v4l2_ctrl *master = ctrl->cluster[0];
+   int i;
+
+   /* Skip if this control was already handled by a cluster. */
+   /* Skip button controls and read-only controls. */
+   if (ref->done || ctrl->type == V4L2_CTRL_TYPE_BUTTON ||
+   (ctrl->flags & V4L2_CTRL_FLAG_READ_ONLY))
+   continue;
+
+   v4l2_ctrl_lock(master);
+   for (i = 0; i < master->ncontrols; i++) {
+   if (master->cluster[i]) {
+   struct v4l2_ctrl_ref *r =
+   find_ref(hdl, master->cluster[i]->id);
+
+   req_to_new(r);
+   master->cluster[i]->is_new = 1;
+   r->done = true;
+   }
+   }
+   /*
+* For volatile autoclusters that are currently in auto mode
+* we need to discover if it will be set to manual mode.
+* If so, then we have to copy the current volatile values
+* first since those will become the new manual values (which
+* may be overwritten by explicit new values from this set
+* of controls).
+*/
+   if (master->is_auto && master->has_volatiles &&
+   !is_cur_manual(master)) {
+   s32 new_auto_val = *master->p_new.p_s32;
+
+   /*
+* If the new value == the manual value, then copy
+* the current volatile values.
+*/
+   if (new_auto_val == master->manual_mode_value)
+   update_from_auto_cluster(master);
+   }
+
+   try_or_set_cluster(NULL, master, true, 0);
+
+   v4l2_ctrl_unlock(master);
+   }
+
+   mutex_unlock(hdl->lock);
+}
+EXPORT_SYMBOL(v4l2_ctrl_request_setup);
+
 void v4l2_ctrl_notify(struct v4l2_ctrl *ctrl, v4l2_ctrl_notify_fnc notify, 
void *priv)
 {
if (ctrl == NULL)
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index f86d680880e1..2770bff1d6bd 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -252,6 +252,7 @@ struct v4l2_ctrl_ref {
struct v4l2_ctrl *ctrl;
struct v4l2_ctrl_helper *helper;
union v4l2_ctrl_ptr p_req;
+   bool done;
bool from_other_dev;
 };
 
@@ -1049,6 +1050,7 @@ struct v4l2_ctrl_handler *v4l2_ctrl_request_alloc(void);
 int v4l2_ctrl_request_clone(struct v4l2_ctrl_handler *hdl,
const struct v4l2_ctrl_handler *from,
bool (*filter)(const struct v4l2_ctrl *ctrl));
+void v4l2_ctrl_request_setup(struct v4l2_ctrl_handler *hdl);
 void v4l2_ctrl_request_get(struct v4l2_ctrl_handler *hdl);
 void v4l2_ctrl_request_put(struct v4l2_ctrl_handler *hdl);
 
-- 
2.14.1



[RFCv1 PATCH 1/6] v4l2-ctrls: v4l2_ctrl_add_handler: add from_other_dev

2017-11-13 Thread Hans Verkuil
From: Hans Verkuil 

Add a 'bool from_other_dev' argument: set to true if the two
handlers refer to different devices (e.g. it is true when
inheriting controls from a subdev into a main v4l2 bridge
driver).

This will be used later when implementing support for the
request API since we need to skip such controls.

TODO: check drivers/staging/media/imx/imx-media-fim.c change.

Signed-off-by: Hans Verkuil 
---
 drivers/media/dvb-frontends/rtl2832_sdr.c|  5 +--
 drivers/media/pci/bt8xx/bttv-driver.c|  2 +-
 drivers/media/pci/cx23885/cx23885-417.c  |  2 +-
 drivers/media/pci/cx88/cx88-blackbird.c  |  2 +-
 drivers/media/pci/cx88/cx88-video.c  |  2 +-
 drivers/media/pci/saa7134/saa7134-empress.c  |  4 +--
 drivers/media/pci/saa7134/saa7134-video.c|  2 +-
 drivers/media/platform/exynos4-is/fimc-capture.c |  2 +-
 drivers/media/platform/rcar-vin/rcar-v4l2.c  |  3 +-
 drivers/media/platform/rcar_drif.c   |  2 +-
 drivers/media/platform/soc_camera/soc_camera.c   |  3 +-
 drivers/media/platform/vivid/vivid-ctrls.c   | 42 
 drivers/media/usb/cx231xx/cx231xx-417.c  |  2 +-
 drivers/media/usb/cx231xx/cx231xx-video.c|  4 +--
 drivers/media/usb/msi2500/msi2500.c  |  2 +-
 drivers/media/usb/tm6000/tm6000-video.c  |  2 +-
 drivers/media/v4l2-core/v4l2-ctrls.c | 11 ---
 drivers/media/v4l2-core/v4l2-device.c|  3 +-
 drivers/staging/media/imx/imx-media-dev.c|  2 +-
 drivers/staging/media/imx/imx-media-fim.c|  2 +-
 include/media/v4l2-ctrls.h   |  4 ++-
 21 files changed, 56 insertions(+), 47 deletions(-)

diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.c 
b/drivers/media/dvb-frontends/rtl2832_sdr.c
index c6e78d870ccd..6064d28224e8 100644
--- a/drivers/media/dvb-frontends/rtl2832_sdr.c
+++ b/drivers/media/dvb-frontends/rtl2832_sdr.c
@@ -1394,7 +1394,8 @@ static int rtl2832_sdr_probe(struct platform_device *pdev)
case RTL2832_SDR_TUNER_E4000:
v4l2_ctrl_handler_init(>hdl, 9);
if (subdev)
-   v4l2_ctrl_add_handler(>hdl, subdev->ctrl_handler, 
NULL);
+   v4l2_ctrl_add_handler(>hdl, subdev->ctrl_handler,
+ NULL, true);
break;
case RTL2832_SDR_TUNER_R820T:
case RTL2832_SDR_TUNER_R828D:
@@ -1423,7 +1424,7 @@ static int rtl2832_sdr_probe(struct platform_device *pdev)
v4l2_ctrl_handler_init(>hdl, 2);
if (subdev)
v4l2_ctrl_add_handler(>hdl, subdev->ctrl_handler,
- NULL);
+ NULL, true);
break;
default:
v4l2_ctrl_handler_init(>hdl, 0);
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c 
b/drivers/media/pci/bt8xx/bttv-driver.c
index b366a7e1d976..91874f775d37 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -4211,7 +4211,7 @@ static int bttv_probe(struct pci_dev *dev, const struct 
pci_device_id *pci_id)
/* register video4linux + input */
if (!bttv_tvcards[btv->c.type].no_video) {
v4l2_ctrl_add_handler(>radio_ctrl_handler, hdl,
-   v4l2_ctrl_radio_filter);
+   v4l2_ctrl_radio_filter, false);
if (btv->radio_ctrl_handler.error) {
result = btv->radio_ctrl_handler.error;
goto fail2;
diff --git a/drivers/media/pci/cx23885/cx23885-417.c 
b/drivers/media/pci/cx23885/cx23885-417.c
index a71f3c7569ce..762823871c78 100644
--- a/drivers/media/pci/cx23885/cx23885-417.c
+++ b/drivers/media/pci/cx23885/cx23885-417.c
@@ -1527,7 +1527,7 @@ int cx23885_417_register(struct cx23885_dev *dev)
dev->cxhdl.priv = dev;
dev->cxhdl.func = cx23885_api_func;
cx2341x_handler_set_50hz(>cxhdl, tsport->height == 576);
-   v4l2_ctrl_add_handler(>ctrl_handler, >cxhdl.hdl, NULL);
+   v4l2_ctrl_add_handler(>ctrl_handler, >cxhdl.hdl, NULL, false);
 
/* Allocate and initialize V4L video device */
dev->v4l_device = cx23885_video_dev_alloc(tsport,
diff --git a/drivers/media/pci/cx88/cx88-blackbird.c 
b/drivers/media/pci/cx88/cx88-blackbird.c
index e3101f04941c..8424fb0da90c 100644
--- a/drivers/media/pci/cx88/cx88-blackbird.c
+++ b/drivers/media/pci/cx88/cx88-blackbird.c
@@ -1184,7 +1184,7 @@ static int cx8802_blackbird_probe(struct cx8802_driver 
*drv)
err = cx2341x_handler_init(>cxhdl, 36);
if (err)
goto fail_core;
-   v4l2_ctrl_add_handler(>cxhdl.hdl, >video_hdl, NULL);
+   v4l2_ctrl_add_handler(>cxhdl.hdl, >video_hdl, NULL, false);
 
/* blackbird stuff */
pr_info("cx23416 based mpeg 

[RFCv1 PATCH 3/6] v4l2-ctrls: add core request API

2017-11-13 Thread Hans Verkuil
From: Hans Verkuil 

Add the four core request functions:

v4l2_ctrl_request_alloc() allocates a new (empty) request.
v4l2_ctrl_request_clone() resets a request based on another request
(or clears it if that request is NULL).
v4l2_ctrl_request_get(): increase refcount
v4l2_ctrl_request_put(): decrease refcount and delete if it reaches 0.

Signed-off-by: Hans Verkuil 
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 110 ++-
 include/media/v4l2-ctrls.h   |   7 +++
 2 files changed, 114 insertions(+), 3 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index 1ff8fc59fff5..710a75a2e19d 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -1878,6 +1878,7 @@ EXPORT_SYMBOL(v4l2_ctrl_find);
 /* Allocate a new v4l2_ctrl_ref and hook it into the handler. */
 static int handler_new_ref(struct v4l2_ctrl_handler *hdl,
   struct v4l2_ctrl *ctrl,
+  struct v4l2_ctrl_ref **ctrl_ref,
   bool from_other_dev)
 {
struct v4l2_ctrl_ref *ref;
@@ -1885,6 +1886,10 @@ static int handler_new_ref(struct v4l2_ctrl_handler *hdl,
u32 id = ctrl->id;
u32 class_ctrl = V4L2_CTRL_ID2WHICH(id) | 1;
int bucket = id % hdl->nr_of_buckets;   /* which bucket to use */
+   unsigned int sz_extra = 0;
+
+   if (ctrl_ref)
+   *ctrl_ref = NULL;
 
/*
 * Automatically add the control class if it is not yet present and
@@ -1898,11 +1903,16 @@ static int handler_new_ref(struct v4l2_ctrl_handler 
*hdl,
if (hdl->error)
return hdl->error;
 
-   new_ref = kzalloc(sizeof(*new_ref), GFP_KERNEL);
+   if (hdl->is_request)
+   sz_extra = ctrl->elems * ctrl->elem_size;
+   new_ref = kzalloc(sizeof(*new_ref) + sz_extra, GFP_KERNEL);
if (!new_ref)
return handler_set_err(hdl, -ENOMEM);
new_ref->ctrl = ctrl;
new_ref->from_other_dev = from_other_dev;
+   if (sz_extra)
+   new_ref->p_req.p = _ref[1];
+
if (ctrl->handler == hdl) {
/* By default each control starts in a cluster of its own.
   new_ref->ctrl is basically a cluster array with one
@@ -1942,6 +1952,8 @@ static int handler_new_ref(struct v4l2_ctrl_handler *hdl,
/* Insert the control node in the hash */
new_ref->next = hdl->buckets[bucket];
hdl->buckets[bucket] = new_ref;
+   if (ctrl_ref)
+   *ctrl_ref = new_ref;
 
 unlock:
mutex_unlock(hdl->lock);
@@ -2083,7 +2095,7 @@ static struct v4l2_ctrl *v4l2_ctrl_new(struct 
v4l2_ctrl_handler *hdl,
ctrl->type_ops->init(ctrl, idx, ctrl->p_new);
}
 
-   if (handler_new_ref(hdl, ctrl, false)) {
+   if (handler_new_ref(hdl, ctrl, NULL, false)) {
kvfree(ctrl);
return NULL;
}
@@ -2276,7 +2288,7 @@ int v4l2_ctrl_add_handler(struct v4l2_ctrl_handler *hdl,
/* Filter any unwanted controls */
if (filter && !filter(ctrl))
continue;
-   ret = handler_new_ref(hdl, ctrl, from_other_dev);
+   ret = handler_new_ref(hdl, ctrl, NULL, from_other_dev);
if (ret)
break;
}
@@ -2685,6 +2697,98 @@ int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct 
v4l2_querymenu *qm)
 }
 EXPORT_SYMBOL(v4l2_querymenu);
 
+struct v4l2_ctrl_handler *v4l2_ctrl_request_alloc(void)
+{
+   struct v4l2_ctrl_handler *hdl = kzalloc(sizeof(*hdl), GFP_KERNEL);
+   int err;
+
+   if (!hdl)
+   return ERR_PTR(-ENOMEM);
+   err = v4l2_ctrl_handler_init(hdl, 0);
+   if (err) {
+   kfree(hdl);
+   return ERR_PTR(err);
+   }
+   hdl->is_request = true;
+   kref_init(>ref);
+   return hdl;
+}
+EXPORT_SYMBOL(v4l2_ctrl_request_alloc);
+
+int v4l2_ctrl_request_clone(struct v4l2_ctrl_handler *hdl,
+   const struct v4l2_ctrl_handler *from,
+   bool (*filter)(const struct v4l2_ctrl *ctrl))
+{
+   struct v4l2_ctrl_ref *ref;
+   int err;
+
+   if (WARN_ON(!hdl || hdl == from))
+   return -EINVAL;
+
+   if (hdl->error)
+   return hdl->error;
+
+   WARN_ON(hdl->lock != >_lock);
+   v4l2_ctrl_handler_free(hdl);
+   err = v4l2_ctrl_handler_init(hdl, (from->nr_of_buckets - 1) * 8);
+   hdl->is_request = true;
+   if (err)
+   return err;
+   if (!from)
+   return 0;
+
+   mutex_lock(from->lock);
+   list_for_each_entry(ref, >ctrl_refs, node) {
+   struct v4l2_ctrl *ctrl = ref->ctrl;
+   struct v4l2_ctrl_ref *new_ref;
+
+   /* Skip refs inherited from other devices */
+   if 

[RFCv1 PATCH 4/6] v4l2-ctrls: use ref in helper instead of ctrl

2017-11-13 Thread Hans Verkuil
From: Hans Verkuil 

The next patch needs the reference to a control instead of the
control itself, so change struct v4l2_ctrl_helper accordingly.

Signed-off-by: Hans Verkuil 
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index 710a75a2e19d..f8de43032b78 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -37,8 +37,8 @@
 struct v4l2_ctrl_helper {
/* Pointer to the control reference of the master control */
struct v4l2_ctrl_ref *mref;
-   /* The control corresponding to the v4l2_ext_control ID field. */
-   struct v4l2_ctrl *ctrl;
+   /* The control ref corresponding to the v4l2_ext_control ID field. */
+   struct v4l2_ctrl_ref *ref;
/* v4l2_ext_control index of the next control belonging to the
   same cluster, or 0 if there isn't any. */
u32 next;
@@ -2860,6 +2860,7 @@ static int prepare_ext_ctrls(struct v4l2_ctrl_handler 
*hdl,
ref = find_ref_lock(hdl, id);
if (ref == NULL)
return -EINVAL;
+   h->ref = ref;
ctrl = ref->ctrl;
if (ctrl->flags & V4L2_CTRL_FLAG_DISABLED)
return -EINVAL;
@@ -2882,7 +2883,6 @@ static int prepare_ext_ctrls(struct v4l2_ctrl_handler 
*hdl,
}
/* Store the ref to the master control of the cluster */
h->mref = ref;
-   h->ctrl = ctrl;
/* Initially set next to 0, meaning that there is no other
   control in this helper array belonging to the same
   cluster */
@@ -2967,7 +2967,7 @@ int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, 
struct v4l2_ext_controls *cs
cs->error_idx = cs->count;
 
for (i = 0; !ret && i < cs->count; i++)
-   if (helpers[i].ctrl->flags & V4L2_CTRL_FLAG_WRITE_ONLY)
+   if (helpers[i].ref->ctrl->flags & V4L2_CTRL_FLAG_WRITE_ONLY)
ret = -EACCES;
 
for (i = 0; !ret && i < cs->count; i++) {
@@ -3002,7 +3002,7 @@ int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, 
struct v4l2_ext_controls *cs
 
do {
ret = ctrl_to_user(cs->controls + idx,
-  helpers[idx].ctrl);
+  helpers[idx].ref->ctrl);
idx = helpers[idx].next;
} while (!ret && idx);
}
@@ -3141,7 +3141,7 @@ static int validate_ctrls(struct v4l2_ext_controls *cs,
 
cs->error_idx = cs->count;
for (i = 0; i < cs->count; i++) {
-   struct v4l2_ctrl *ctrl = helpers[i].ctrl;
+   struct v4l2_ctrl *ctrl = helpers[i].ref->ctrl;
union v4l2_ctrl_ptr p_new;
 
cs->error_idx = i;
@@ -3253,7 +3253,7 @@ static int try_set_ext_ctrls(struct v4l2_fh *fh, struct 
v4l2_ctrl_handler *hdl,
do {
/* Check if the auto control is part of the
   list, and remember the new value. */
-   if (helpers[tmp_idx].ctrl == master)
+   if (helpers[tmp_idx].ref->ctrl == master)
new_auto_val = 
cs->controls[tmp_idx].value;
tmp_idx = helpers[tmp_idx].next;
} while (tmp_idx);
@@ -3266,7 +3266,7 @@ static int try_set_ext_ctrls(struct v4l2_fh *fh, struct 
v4l2_ctrl_handler *hdl,
/* Copy the new caller-supplied control values.
   user_to_new() sets 'is_new' to 1. */
do {
-   struct v4l2_ctrl *ctrl = helpers[idx].ctrl;
+   struct v4l2_ctrl *ctrl = helpers[idx].ref->ctrl;
 
ret = user_to_new(cs->controls + idx, ctrl);
if (!ret && ctrl->is_ptr)
@@ -3282,7 +3282,7 @@ static int try_set_ext_ctrls(struct v4l2_fh *fh, struct 
v4l2_ctrl_handler *hdl,
idx = i;
do {
ret = new_to_user(cs->controls + idx,
-   helpers[idx].ctrl);
+   helpers[idx].ref->ctrl);
idx = helpers[idx].next;
} while (!ret && idx);
}
-- 
2.14.1



[RFCv1 PATCH 0/6] v4l2-ctrls: implement requests

2017-11-13 Thread Hans Verkuil
From: Hans Verkuil 

Hi Alexandre,

This is a first implementation of the request API in the
control framework. It is fairly simplistic at the moment in that
it just clones all the control values (so no refcounting yet for
values as Laurent proposed, I will work on that later). But this
should not be a problem for codecs since there aren't all that many
controls involved.

The API is as follows:

struct v4l2_ctrl_handler *v4l2_ctrl_request_alloc(void);

This allocates a struct v4l2_ctrl_handler that is empty (i.e. has
no controls) but is refcounted and is marked as representing a
request.

int v4l2_ctrl_request_clone(struct v4l2_ctrl_handler *hdl,
const struct v4l2_ctrl_handler *from,
bool (*filter)(const struct v4l2_ctrl *ctrl));

Delete any existing controls in handler 'hdl', then clone the values
from an existing handler 'from' into 'hdl'. If 'from' == NULL, then
this just clears the handler. 'from' can either be another request
control handler or a regular control handler in which case the
current values are cloned. If 'filter' != NULL then you can
filter which controls you want to clone.

void v4l2_ctrl_request_get(struct v4l2_ctrl_handler *hdl);

Increase the refcount.

void v4l2_ctrl_request_put(struct v4l2_ctrl_handler *hdl);

Decrease the refcount and delete hdl if it reaches 0.

void v4l2_ctrl_request_setup(struct v4l2_ctrl_handler *hdl);

Apply the values from the handler (i.e. request object) to the
hardware.

You will have to modify v4l_g/s/try_ext_ctrls in v4l2-ioctls.c to
obtain the request v4l2_ctrl_handler pointer based on the request
field in struct v4l2_ext_controls.

The first patch in this series is necessary to avoid cloning
controls that belong to other devices (as opposed to the subdev
or bridge device for which you make a request). It can probably
be dropped for codecs, but it is needed for MC devices like
omap3isp.

This series has only been compile tested! So if it crashes as
soon as you try to use it, then that's why :-)

Note: I'm not sure if it makes sense to refcount the control
handler, you might prefer to have a refcount in a higher-level
request struct. If that's the case, then I can drop the _get
function and replace the _put function by a v4l2_ctrl_request_free()
function.

Good luck!

Hans

Hans Verkuil (6):
  v4l2-ctrls: v4l2_ctrl_add_handler: add from_other_dev
  v4l2-ctrls: prepare internal structs for request API
  v4l2-ctrls: add core request API
  v4l2-ctrls: use ref in helper instead of ctrl
  v4l2-ctrls: support g/s_ext_ctrls for requests
  v4l2-ctrls: add v4l2_ctrl_request_setup

 drivers/media/dvb-frontends/rtl2832_sdr.c|   5 +-
 drivers/media/pci/bt8xx/bttv-driver.c|   2 +-
 drivers/media/pci/cx23885/cx23885-417.c  |   2 +-
 drivers/media/pci/cx88/cx88-blackbird.c  |   2 +-
 drivers/media/pci/cx88/cx88-video.c  |   2 +-
 drivers/media/pci/saa7134/saa7134-empress.c  |   4 +-
 drivers/media/pci/saa7134/saa7134-video.c|   2 +-
 drivers/media/platform/exynos4-is/fimc-capture.c |   2 +-
 drivers/media/platform/rcar-vin/rcar-v4l2.c  |   3 +-
 drivers/media/platform/rcar_drif.c   |   2 +-
 drivers/media/platform/soc_camera/soc_camera.c   |   3 +-
 drivers/media/platform/vivid/vivid-ctrls.c   |  42 ++--
 drivers/media/usb/cx231xx/cx231xx-417.c  |   2 +-
 drivers/media/usb/cx231xx/cx231xx-video.c|   4 +-
 drivers/media/usb/msi2500/msi2500.c  |   2 +-
 drivers/media/usb/tm6000/tm6000-video.c  |   2 +-
 drivers/media/v4l2-core/v4l2-ctrls.c | 242 +--
 drivers/media/v4l2-core/v4l2-device.c|   3 +-
 drivers/staging/media/imx/imx-media-dev.c|   2 +-
 drivers/staging/media/imx/imx-media-fim.c|   2 +-
 include/media/v4l2-ctrls.h   |  17 +-
 21 files changed, 287 insertions(+), 60 deletions(-)

-- 
2.14.1



[PATCH] media: et8ek8: select V4L2_FWNODE

2017-11-13 Thread Arnd Bergmann
v4l2_async_register_subdev_sensor_common() is only provided when
CONFIG_V4L2_FWNODE is enabled, otherwise we get a link failure:

drivers/media/i2c/et8ek8/et8ek8_driver.o: In function `et8ek8_probe':
et8ek8_driver.c:(.text+0x884): undefined reference to 
`v4l2_async_register_subdev_sensor_common'

This adds a Kconfig 'select' statement like all the other users of
this interface have.

Fixes: d8932f38c10f ("media: et8ek8: Add support for flash and lens devices")
Signed-off-by: Arnd Bergmann 
---
 drivers/media/i2c/et8ek8/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/i2c/et8ek8/Kconfig b/drivers/media/i2c/et8ek8/Kconfig
index 14399365ad7f..9fe409e95666 100644
--- a/drivers/media/i2c/et8ek8/Kconfig
+++ b/drivers/media/i2c/et8ek8/Kconfig
@@ -1,6 +1,7 @@
 config VIDEO_ET8EK8
tristate "ET8EK8 camera sensor support"
depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+   select V4L2_FWNODE
---help---
  This is a driver for the Toshiba ET8EK8 5 MP camera sensor.
  It is used for example in Nokia N900 (RX-51).
-- 
2.9.0



Re: [PATCH v4 10/12] intel-ipu3: css pipeline

2017-11-13 Thread Sakari Ailus
Hi Yong,

On Fri, Nov 10, 2017 at 10:35:43PM +, Zhi, Yong wrote:
> Hi, Sakari,
> 
> Thanks for the review.
> 
> > -Original Message-
> > From: linux-media-ow...@vger.kernel.org [mailto:linux-media-
> > ow...@vger.kernel.org] On Behalf Of Sakari Ailus
> > Sent: Wednesday, November 1, 2017 11:57 AM
> > To: Zhi, Yong 
> > Cc: linux-media@vger.kernel.org; sakari.ai...@linux.intel.com; Zheng, Jian
> > Xu ; Mani, Rajmohan
> > ; Toivonen, Tuukka
> > ; Hu, Jerry W 
> > Subject: Re: [PATCH v4 10/12] intel-ipu3: css pipeline
> > 
> > Hi Yong,
> > 
> > Apologies for the late reply. Please find my (few) comments below.
> > 
> > On Tue, Oct 17, 2017 at 10:54:55PM -0500, Yong Zhi wrote:
> > > Add css pipeline and v4l code.
> > >
> > > Signed-off-by: Yong Zhi 
> > > ---
> > >  drivers/media/pci/intel/ipu3/ipu3-css.c | 1761
> > ++-
> > >  drivers/media/pci/intel/ipu3/ipu3-css.h |   89 ++
> > >  2 files changed, 1849 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/media/pci/intel/ipu3/ipu3-css.c
> > b/drivers/media/pci/intel/ipu3/ipu3-css.c
> > > index 6e615bf9378a..11f7ad3514c3 100644
> > > --- a/drivers/media/pci/intel/ipu3/ipu3-css.c
> > > +++ b/drivers/media/pci/intel/ipu3/ipu3-css.c
> > > @@ -13,9 +13,16 @@
> 
> (snip)
> 
> > > +static bool ipu3_css_queue_enabled(struct ipu3_css_queue *q)
> > > +{
> > > + return !!q->css_fmt;
> > 
> > No need for !!.
> > 
> 
> The original code "return q->css_fmt !=NULL;" is more explicit, I changed
> to the current form to silent checkpatch.pl CHECK for null comparison.

Ok. You're still basically checking whether it's non-NULL, and casting an
non-zero value to bool converts it as true. So you don't need !!.

> 
> > > +}
> > > +
> > >  /*** css hw ***/
> > >
> 
> (snip)
> 
> > > + /* Configure SP group */
> > > +
> > > + sp_group = css->xmem_sp_group_ptrs.vaddr;
> > > + memset(sp_group, 0, sizeof(*sp_group));
> > > +
> > > + sp_group->pipe[thread].num_stages = 1;
> > > + sp_group->pipe[thread].pipe_id = PIPE_ID;
> > > + sp_group->pipe[thread].thread_id = thread;
> > > + sp_group->pipe[thread].pipe_num = pipe;
> > > + sp_group->pipe[thread].num_execs = -1;
> > > + sp_group->pipe[thread].pipe_qos_config = -1;
> > > + sp_group->pipe[thread].required_bds_factor = 0;
> > > + sp_group->pipe[thread].dvs_frame_delay = IPU3_CSS_AUX_FRAMES
> > - 1;
> > > + sp_group->pipe[thread].inout_port_config =
> > > + IMGU_ABI_PORT_CONFIG_TYPE_INPUT_HOST |
> > > + IMGU_ABI_PORT_CONFIG_TYPE_OUTPUT_HOST;
> > 
> > Indentation. Most of this seems to have been fixed but some remains in this
> > patch at least. Could you address that for the next version, please?
> 
> Yes, will fix all indentation in next version.
> 
> > 
> > > + sp_group->pipe[thread].scaler_pp_lut = 0;
> > > + sp_group-
> > >pipe[thread].shading.internal_frame_origin_x_bqs_on_sctbl = 0;
> > > + sp_group-
> > >pipe[thread].shading.internal_frame_origin_y_bqs_on_sctbl = 0;
> > > + sp_group->pipe[thread].sp_stage_addr[stage] =
> > > + css->xmem_sp_stage_ptrs[pipe][stage].daddr;
> > > + sp_group->pipe[thread].pipe_config =
> > > + bi->info.isp.sp.enable.params ? (1 << thread) : 0;
> 
> (snip)
> 
> > > +int ipu3_css_set_parameters(struct ipu3_css *css,
> > > + struct ipu3_uapi_params *set_params,
> > > + struct ipu3_uapi_gdc_warp_param *set_gdc,
> > > + unsigned int gdc_bytes,
> > > + struct ipu3_uapi_obgrid_param *set_obgrid,
> > > + unsigned int obgrid_bytes)
> > > +{
> > > + static const unsigned int queue_id = IMGU_ABI_QUEUE_A_ID;
> > > + const int stage = 0, thread = 0;
> > > + const struct imgu_fw_info *bi;
> > > + int obgrid_size;
> > > + unsigned int stripes;
> > > + struct ipu3_uapi_flags *use = set_params ? _params->use : NULL;
> > > +
> > > + /* Destination buffers which are filled here */
> > > + struct imgu_abi_parameter_set_info *param_set;
> > > + struct ipu3_uapi_acc_param *acc = NULL;
> > > + struct ipu3_uapi_gdc_warp_param *gdc = NULL;
> > > + struct ipu3_uapi_obgrid_param *obgrid = NULL;
> > > + const struct ipu3_css_map *map;
> > > + void *vmem0 = NULL;
> > > + void *dmem0 = NULL;
> > > +
> > > + enum imgu_abi_memories m;
> > > + int r = -EBUSY;
> > > + int s;
> > > +
> > > + if (!css->streaming)
> > > + return -EPROTO;
> > > +
> > > + bi = >fwp->binary_header[css->current_binary];
> > > + obgrid_size = ipu3_css_fw_obgrid_size(bi);
> > > + stripes = bi->info.isp.sp.iterator.num_stripes ? : 1;
> > > +
> > > + /*
> > > +  * Check that we can get a new parameter_set_info from the pool.
> > > +  * If this succeeds, then all of the other pool_get() calls below
> > > +  * should also succeed.
> > > +  */
> > > + if (ipu3_css_pool_get(>pool.parameter_set_info, css->frame) <
> > 0)
> > > +

Hello Dear...

2017-11-13 Thread M,Shakour Rosarita
Hello Dear...

I know that this message will come to you as a surprise. I hoped that
you will not expose or betray this trust and confident that I am about
to repose on you, my name is M, Shakour Rosarita. I am 19 years old
Girl, female, from Tartu Syria, (never married) 61 kg, white in
complexion, and I am currently living in the refugee camp here in
Abidjan Ivory Coast, My late beloved father M,Shakour Hassin was a
renowned businessman and owner of Natour Petrol Station in Syria, he
was killed in a stampede riot in Tartu, Syria.
When I got the news about my parents. I fled to a nearby country
Jordan before I joined a ferry to Africa and came to Abidjan capital
city Ivory Coast West Africa find safety here.
I came in 2015 to Abidjan and I now live in refugee camps here as
refugees are allowed freely to enter here without, My late father
deposited (US$6.200.000.00m) My late father kept the money at the bank
of Africa, I want you to help me transfer the money to your hand so
that you will help me bring me into your country for my continue
education.

I sent my pictures here for you to see. Who I am seriously looking for
a good-person in my life, so I want to hear from you soon and learn
more about you.

I am an open-minded and friendly girl to share a good time with you
and have fun and enjoy on the go, bird watching, the rest of our
lives. My Hobbies, tourism books, dance, music, soccer, tennis,
swimming and cinema.
I would just think about you, including your dose and doesn’t .I
believe we will do well together, and live like one family.
Thank you and God bless you, for you in your promise to help me here,
looking forward to your reply by the grace of God and have a good day.
I hope you send me your photos as well? I await your next reply in
faith please reply through my private email at
(mshakourrosarit...@gmail.com):
Thanks.
Ms Rosarita


Re: [linux-sunxi] [PATCH v3 1/3] media: V3s: Add support for Allwinner CSI.

2017-11-13 Thread Ondřej Jirman
Hello,

Thanks for your patches. I've been working with CSI on A83T, so I have
a few notes. My review is below. :)

Yong Deng píše v Po 13. 11. 2017 v 15:30 +0800:
> 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/sunxi/sun6i-csi/Kconfig |   9 +
>  drivers/media/platform/sunxi/sun6i-csi/Makefile|   3 +
>  drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 918 
> +
>  drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h | 146 
>  .../media/platform/sunxi/sun6i-csi/sun6i_csi_reg.h | 203 +
>  .../media/platform/sunxi/sun6i-csi/sun6i_video.c   | 722 
>  .../media/platform/sunxi/sun6i-csi/sun6i_video.h   |  61 ++
>  9 files changed, 2065 insertions(+)
>  create mode 100644 drivers/media/platform/sunxi/sun6i-csi/Kconfig
>  create mode 100644 drivers/media/platform/sunxi/sun6i-csi/Makefile
>  create mode 100644 drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
>  create mode 100644 drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h
>  create mode 100644 drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_reg.h
>  create mode 100644 drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c
>  create mode 100644 drivers/media/platform/sunxi/sun6i-csi/sun6i_video.h
> 
> diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
> index fd0c998..41017e3 100644
> --- a/drivers/media/platform/Kconfig
> +++ b/drivers/media/platform/Kconfig
> @@ -150,6 +150,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/sunxi/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 012eb47..1cc806a 100644
> --- a/drivers/media/platform/Makefile
> +++ b/drivers/media/platform/Makefile
> @@ -96,3 +96,5 @@ obj-$(CONFIG_VIDEO_QCOM_CAMSS)  += 
> qcom/camss-8x16/
>  obj-$(CONFIG_VIDEO_QCOM_VENUS)   += qcom/venus/
>  
>  obj-y+= meson/
> +
> +obj-$(CONFIG_VIDEO_SUN6I_CSI)+= sunxi/sun6i-csi/
> diff --git a/drivers/media/platform/sunxi/sun6i-csi/Kconfig 
> b/drivers/media/platform/sunxi/sun6i-csi/Kconfig
> new file mode 100644
> index 000..314188a
> --- /dev/null
> +++ b/drivers/media/platform/sunxi/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/sunxi/sun6i-csi/Makefile 
> b/drivers/media/platform/sunxi/sun6i-csi/Makefile
> new file mode 100644
> index 000..213cb6b
> --- /dev/null
> +++ b/drivers/media/platform/sunxi/sun6i-csi/Makefile
> @@ -0,0 +1,3 @@
> +sun6i-csi-y += sun6i_video.o sun6i_csi.o
> +
> +obj-$(CONFIG_VIDEO_SUN6I_CSI) += sun6i-csi.o
> diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c 
> b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
> new file mode 100644
> index 000..3f4de09
> --- /dev/null
> +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
> @@ -0,0 +1,918 @@
> +/*
> + * Copyright (c) 2017 Magewell Electronics Co., Ltd. (Nanjing).
> + * All rights reserved.
> + * Author: Yong Deng 
> + *
> + * 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 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "sun6i_csi.h"
> +#include "sun6i_csi_reg.h"
> +
> +#define MODULE_NAME  "sun6i-csi"
> +
> 

Re: [PATCH 2/2] sdlcam: ignore binary

2017-11-13 Thread Rafaël Carré
Adding linux-media, thanks

On 13/11/2017 10:20, Pavel Machek wrote:
> On Mon 2017-11-13 10:19:08, Rafaël Carré wrote:
>> Signed-off-by: Rafaël Carré 
> 
> Acked-by: PavelMachek 
> 
>> ---
>>  contrib/test/.gitignore | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/contrib/test/.gitignore b/contrib/test/.gitignore
>> index ad64325b..5bd81d01 100644
>> --- a/contrib/test/.gitignore
>> +++ b/contrib/test/.gitignore
>> @@ -8,3 +8,4 @@ stress-buffer
>>  v4l2gl
>>  v4l2grab
>>  mc_nextgen_test
>> +sdlcam
> 



Re: [PATCH 1/2] sdlcam: fix linking

2017-11-13 Thread Pavel Machek
On Mon 2017-11-13 10:19:07, Rafaël Carré wrote:
> Signed-off-by: Rafaël Carré 

Acked-by: Pavel Machek 

Thanks!
Pavel


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


signature.asc
Description: Digital signature


[PATCH 2/2] sdlcam: ignore binary

2017-11-13 Thread Rafaël Carré
Signed-off-by: Rafaël Carré 
---
 contrib/test/.gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/contrib/test/.gitignore b/contrib/test/.gitignore
index ad64325b..5bd81d01 100644
--- a/contrib/test/.gitignore
+++ b/contrib/test/.gitignore
@@ -8,3 +8,4 @@ stress-buffer
 v4l2gl
 v4l2grab
 mc_nextgen_test
+sdlcam
-- 
2.14.1



[PATCH 1/2] sdlcam: fix linking

2017-11-13 Thread Rafaël Carré
Signed-off-by: Rafaël Carré 
---
 contrib/test/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/test/Makefile.am b/contrib/test/Makefile.am
index 6a4303d7..0188fe21 100644
--- a/contrib/test/Makefile.am
+++ b/contrib/test/Makefile.am
@@ -37,7 +37,7 @@ v4l2gl_LDADD = ../../lib/libv4l2/libv4l2.la 
../../lib/libv4lconvert/libv4lconver
 
 sdlcam_LDFLAGS = $(JPEG_LIBS) $(SDL2_LIBS) -lm -ldl -lrt
 sdlcam_CFLAGS = -I../.. $(SDL2_CFLAGS)
-sdlcam_LDADD = ../../lib/libv4l2/.libs/libv4l2.a  
../../lib/libv4lconvert/.libs/libv4lconvert.a
+sdlcam_LDADD = ../../lib/libv4l2/libv4l2.la  
../../lib/libv4lconvert/libv4lconvert.la
 
 mc_nextgen_test_CFLAGS = $(LIBUDEV_CFLAGS)
 mc_nextgen_test_LDFLAGS = $(LIBUDEV_LIBS)
-- 
2.14.1



Re: [PATCH v7 25/25] rcar-vin: enable support for r8a7796

2017-11-13 Thread Geert Uytterhoeven
CC DT

On Sat, Nov 11, 2017 at 1:38 AM, Niklas Söderlund
 wrote:
> Add the SoC specific information for Renesas r8a7796.
>
> Signed-off-by: Niklas Söderlund 
> Reviewed-by: Hans Verkuil 
> ---
>  .../devicetree/bindings/media/rcar_vin.txt |  1 +
>  drivers/media/platform/rcar-vin/rcar-core.c| 64 
> ++
>  2 files changed, 65 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/media/rcar_vin.txt 
> b/Documentation/devicetree/bindings/media/rcar_vin.txt
> index df1abd0fb20386f8..ddf249c2276600d2 100644
> --- a/Documentation/devicetree/bindings/media/rcar_vin.txt
> +++ b/Documentation/devicetree/bindings/media/rcar_vin.txt
> @@ -10,6 +10,7 @@ Depending on the instance the VIN input is connected to 
> external SoC pins, or
>  on Gen3 to a CSI-2 receiver.
>
>   - compatible: Must be one or more of the following
> +   - "renesas,vin-r8a7796" for the R8A7796 device
> - "renesas,vin-r8a7795" for the R8A7795 device
> - "renesas,vin-r8a7794" for the R8A7794 device
> - "renesas,vin-r8a7793" for the R8A7793 device
> diff --git a/drivers/media/platform/rcar-vin/rcar-core.c 
> b/drivers/media/platform/rcar-vin/rcar-core.c
> index b22f6596700d2479..e329de4ce0172e8d 100644
> --- a/drivers/media/platform/rcar-vin/rcar-core.c
> +++ b/drivers/media/platform/rcar-vin/rcar-core.c
> @@ -1084,6 +1084,66 @@ static const struct rvin_info rcar_info_r8a7795es1 = {
> },
>  };
>
> +static const struct rvin_info rcar_info_r8a7796 = {
> +   .chip = RCAR_GEN3,
> +   .use_mc = true,
> +   .max_width = 4096,
> +   .max_height = 4096,
> +
> +   .num_chsels = 5,
> +   .chsels = {
> +   {
> +   { .csi = RVIN_CSI40, .chan = 0 },
> +   { .csi = RVIN_CSI20, .chan = 0 },
> +   { .csi = RVIN_NC, .chan = 0 },
> +   { .csi = RVIN_CSI40, .chan = 0 },
> +   { .csi = RVIN_CSI20, .chan = 0 },
> +   }, {
> +   { .csi = RVIN_CSI20, .chan = 0 },
> +   { .csi = RVIN_NC, .chan = 0 },
> +   { .csi = RVIN_CSI40, .chan = 0 },
> +   { .csi = RVIN_CSI40, .chan = 1 },
> +   { .csi = RVIN_CSI20, .chan = 1 },
> +   }, {
> +   { .csi = RVIN_NC, .chan = 0 },
> +   { .csi = RVIN_CSI40, .chan = 0 },
> +   { .csi = RVIN_CSI20, .chan = 0 },
> +   { .csi = RVIN_CSI40, .chan = 2 },
> +   { .csi = RVIN_CSI20, .chan = 2 },
> +   }, {
> +   { .csi = RVIN_CSI40, .chan = 1 },
> +   { .csi = RVIN_CSI20, .chan = 1 },
> +   { .csi = RVIN_NC, .chan = 1 },
> +   { .csi = RVIN_CSI40, .chan = 3 },
> +   { .csi = RVIN_CSI20, .chan = 3 },
> +   }, {
> +   { .csi = RVIN_CSI40, .chan = 0 },
> +   { .csi = RVIN_CSI20, .chan = 0 },
> +   { .csi = RVIN_NC, .chan = 0 },
> +   { .csi = RVIN_CSI40, .chan = 0 },
> +   { .csi = RVIN_CSI20, .chan = 0 },
> +   }, {
> +   { .csi = RVIN_CSI20, .chan = 0 },
> +   { .csi = RVIN_NC, .chan = 0 },
> +   { .csi = RVIN_CSI40, .chan = 0 },
> +   { .csi = RVIN_CSI40, .chan = 1 },
> +   { .csi = RVIN_CSI20, .chan = 1 },
> +   }, {
> +   { .csi = RVIN_NC, .chan = 0 },
> +   { .csi = RVIN_CSI40, .chan = 0 },
> +   { .csi = RVIN_CSI20, .chan = 0 },
> +   { .csi = RVIN_CSI40, .chan = 2 },
> +   { .csi = RVIN_CSI20, .chan = 2 },
> +   }, {
> +   { .csi = RVIN_CSI40, .chan = 1 },
> +   { .csi = RVIN_CSI20, .chan = 1 },
> +   { .csi = RVIN_NC, .chan = 1 },
> +   { .csi = RVIN_CSI40, .chan = 3 },
> +   { .csi = RVIN_CSI20, .chan = 3 },
> +   },
> +   },
> +};
> +
>  static const struct of_device_id rvin_of_id_table[] = {
> {
> .compatible = "renesas,vin-r8a7778",
> @@ -1117,6 +1177,10 @@ static const struct of_device_id rvin_of_id_table[] = {
> .compatible = "renesas,vin-r8a7795",
> .data = _info_r8a7795,
> },
> +   {
> +   .compatible = "renesas,vin-r8a7796",
> +   .data = _info_r8a7796,
> +   },
> { },
>  };
>  MODULE_DEVICE_TABLE(of, rvin_of_id_table);
> --
> 2.15.0


Re: [linux-sunxi] [PATCH v3 3/3] media: MAINTAINERS: add entries for Allwinner V3s CSI

2017-11-13 Thread Yong
On Mon, 13 Nov 2017 15:37:11 +0800
Yong Deng  wrote:

> Signed-off-by: Yong Deng 
> ---
>  MAINTAINERS | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index adbf693..1ba7782 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -3744,6 +3744,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/

Sorry, the path has been changed to drivers/media/platform/sunxi/sun6i-csi/.
I will fix it.

> +F:   Documentation/devicetree/bindings/media/sun6i-csi.txt
> +
>  CW1200 WLAN driver
>  M:   Solomon Peachy 
>  S:   Maintained
> -- 
> 1.8.3.1
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


Thanks,
Yong


Re: [PATCH v4 3/5] staging: Introduce NVIDIA Tegra video decoder driver

2017-11-13 Thread Dan Carpenter
On Sat, Nov 11, 2017 at 04:06:52PM +0200, Vladimir Zapolskiy wrote:
> > +   if (!wait_dma)
> > +   return 0;
> > +
> > +   err = readl_relaxed_poll_timeout(vde->bsev + INTR_STATUS, value,
> > +!(value & BSE_DMA_BUSY), 1, 100);
> > +   if (err) {
> > +   dev_err(dev, "BSEV DMA timeout\n");
> > +   return err;
> > +   }
> > +
> > +   return 0;
> 
>   if (err)
>   dev_err(dev, "BSEV DMA timeout\n");
> 
>   return err;
> 
> is two lines shorter.
> 

This is fine, but just watch out because getting clever with a last if
statement is a common anti-pattern.  For example, you often see it where
people do success handling instead of failure handling.  And it leads
to static checker bugs, and makes the code slightly more subtle.

> > +   err = tegra_vde_attach_dmabuf(dev, source->aux_fd,
> > + source->aux_offset, csize,
> > + >aux_dmabuf_attachment,
> > + >aux_addr,
> > + >aux_sgt,
> > + NULL, dma_dir);
> > +   if (err)
> > +   goto err_release_cr;
> > +   }
> > +
> > +   return 0;
> 
>   if (!err)
>   return 0;
> 
> and then remove a check above.
> 

Argh  Success handling.  Always do failure handling, never success
handling.

The rest of your comments I agree with, though.

regards,
dan carpenter