Re: si2157 driver

2016-06-28 Thread Olli Salonen
Hi Oleg,

Correct, only digital TV is supported currently by the driver.

Cheers,
-olli

On 28 June 2016 at 23:22, Oleh Kravchenko  wrote:
> Hello linux media developers!
>
> I try add support for usb hybrid tuner, it based on:
> CX23102-112, Si2158, Si2168
>
> I updated cx231xx-cards.c with valid ids, but I don't have idea how to
> use Si2158.
> It is not listed in tuner-types.c
>
> Why si2157.c is absent in tuner-types.c?
> Or at the current state si2157.c don't have analog support?
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cron job: media_tree daily build: ERRORS

2016-06-28 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:   Wed Jun 29 04:00:25 CEST 2016
git branch: test
git hash:   d81295d1bed850335f9f4ccb6b1aa4f6a123d4f0
gcc version:i686-linux-gcc (GCC) 5.3.0
sparse version: v0.5.0-56-g7647c77
smatch version: v0.5.0-3428-gdfe27cf
host hardware:  x86_64
host os:4.6.0-164

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-exynos: OK
linux-git-arm-mtk: OK
linux-git-arm-mx: OK
linux-git-arm-omap: OK
linux-git-arm-pxa: 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: OK
linux-2.6.37.6-i686: OK
linux-2.6.38.8-i686: OK
linux-2.6.39.4-i686: OK
linux-3.0.60-i686: OK
linux-3.1.10-i686: OK
linux-3.2.37-i686: OK
linux-3.3.8-i686: OK
linux-3.4.27-i686: OK
linux-3.5.7-i686: OK
linux-3.6.11-i686: ERRORS
linux-3.7.4-i686: ERRORS
linux-3.8-i686: ERRORS
linux-3.9.2-i686: ERRORS
linux-3.10.1-i686: ERRORS
linux-3.11.1-i686: ERRORS
linux-3.12.23-i686: ERRORS
linux-3.13.11-i686: ERRORS
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: ERRORS
linux-4.0-i686: ERRORS
linux-4.1.1-i686: ERRORS
linux-4.2-i686: ERRORS
linux-4.3-i686: ERRORS
linux-4.4-i686: OK
linux-4.5-i686: OK
linux-4.6-i686: OK
linux-4.7-rc1-i686: OK
linux-2.6.36.4-x86_64: OK
linux-2.6.37.6-x86_64: OK
linux-2.6.38.8-x86_64: OK
linux-2.6.39.4-x86_64: OK
linux-3.0.60-x86_64: OK
linux-3.1.10-x86_64: OK
linux-3.2.37-x86_64: OK
linux-3.3.8-x86_64: OK
linux-3.4.27-x86_64: OK
linux-3.5.7-x86_64: OK
linux-3.6.11-x86_64: ERRORS
linux-3.7.4-x86_64: ERRORS
linux-3.8-x86_64: ERRORS
linux-3.9.2-x86_64: ERRORS
linux-3.10.1-x86_64: ERRORS
linux-3.11.1-x86_64: ERRORS
linux-3.12.23-x86_64: ERRORS
linux-3.13.11-x86_64: ERRORS
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: ERRORS
linux-3.18.7-x86_64: ERRORS
linux-3.19-x86_64: ERRORS
linux-4.0-x86_64: ERRORS
linux-4.1.1-x86_64: ERRORS
linux-4.2-x86_64: ERRORS
linux-4.3-x86_64: ERRORS
linux-4.4-x86_64: OK
linux-4.5-x86_64: OK
linux-4.6-x86_64: OK
linux-4.7-rc1-x86_64: OK
apps: OK
spec-git: OK
sparse: WARNINGS
smatch: WARNINGS

Detailed results are available here:

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

Full logs are available here:

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

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] tw686x: Support VIDIOC_{S,G}_PARM ioctls

2016-06-28 Thread Ezequiel Garcia
Now that the frame rate can be properly set, this commit adds support
for S_PARM and G_PARM.

Signed-off-by: Ezequiel Garcia 
---
 drivers/media/pci/tw686x/tw686x-video.c | 46 ++---
 1 file changed, 43 insertions(+), 3 deletions(-)

diff --git a/drivers/media/pci/tw686x/tw686x-video.c 
b/drivers/media/pci/tw686x/tw686x-video.c
index 3131f9305313..40b5b835d452 100644
--- a/drivers/media/pci/tw686x/tw686x-video.c
+++ b/drivers/media/pci/tw686x/tw686x-video.c
@@ -437,9 +437,6 @@ static void tw686x_set_framerate(struct 
tw686x_video_channel *vc,
 {
unsigned int i;
 
-   if (vc->fps == fps)
-   return;
-
i = tw686x_fps_idx(fps, TW686X_MAX_FPS(vc->video_standard));
reg_write(vc->dev, VIDEO_FIELD_CTRL[vc->ch], fps_map[i]);
vc->fps = tw686x_real_fps(i, TW686X_MAX_FPS(vc->video_standard));
@@ -843,6 +840,12 @@ static int tw686x_s_std(struct file *file, void *priv, 
v4l2_std_id id)
ret = tw686x_g_fmt_vid_cap(file, priv, );
if (!ret)
tw686x_s_fmt_vid_cap(file, priv, );
+
+   /*
+* Frame decimation depends on the chosen standard,
+* so reset it to the current value.
+*/
+   tw686x_set_framerate(vc, vc->fps);
return 0;
 }
 
@@ -912,6 +915,40 @@ static int tw686x_g_std(struct file *file, void *priv, 
v4l2_std_id *id)
return 0;
 }
 
+static int tw686x_g_parm(struct file *file, void *priv,
+struct v4l2_streamparm *sp)
+{
+   struct tw686x_video_channel *vc = video_drvdata(file);
+   struct v4l2_captureparm *cp = >parm.capture;
+
+   if (sp->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+   return -EINVAL;
+   sp->parm.capture.readbuffers = 3;
+
+   cp->capability = V4L2_CAP_TIMEPERFRAME;
+   cp->timeperframe.numerator = 1;
+   cp->timeperframe.denominator = vc->fps;
+   return 0;
+}
+
+static int tw686x_s_parm(struct file *file, void *priv,
+struct v4l2_streamparm *sp)
+{
+   struct tw686x_video_channel *vc = video_drvdata(file);
+   struct v4l2_captureparm *cp = >parm.capture;
+   unsigned int denominator = cp->timeperframe.denominator;
+   unsigned int numerator = cp->timeperframe.numerator;
+   unsigned int fps;
+
+   if (vb2_is_busy(>vidq))
+   return -EBUSY;
+
+   fps = (!numerator || !denominator) ? 0 : denominator / numerator;
+   if (vc->fps != fps)
+   tw686x_set_framerate(vc, fps);
+   return tw686x_g_parm(file, priv, sp);
+}
+
 static int tw686x_enum_fmt_vid_cap(struct file *file, void *priv,
   struct v4l2_fmtdesc *f)
 {
@@ -998,6 +1035,9 @@ static const struct v4l2_ioctl_ops tw686x_video_ioctl_ops 
= {
.vidioc_g_std   = tw686x_g_std,
.vidioc_s_std   = tw686x_s_std,
 
+   .vidioc_g_parm  = tw686x_g_parm,
+   .vidioc_s_parm  = tw686x_s_parm,
+
.vidioc_enum_input  = tw686x_enum_input,
.vidioc_g_input = tw686x_g_input,
.vidioc_s_input = tw686x_s_input,
-- 
2.9.0

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] tw686x: use a formula instead of two tables for div

2016-06-28 Thread Ezequiel Garcia
From: Mauro Carvalho Chehab 

Instead of using two tables to estimate the temporal decimation
factor, use a formula. This allows to get the closest fps, which
sounds better than the current tables.

Also, the current code doesn't store the real framerate.

This patch fixes the above issues.

Signed-off-by: Mauro Carvalho Chehab 
[Ezequiel:
  - introduce a TW686X_MAX_FPS macro for max_fps.
  - use hweight_long instead of open coding the set bits count.]
Signed-off-by: Ezequiel Garcia 
---
Mauro,

I'm resending your patch with a cosmetic modifications.
Let me know how it looks.

 drivers/media/pci/tw686x/tw686x-video.c | 95 +
 1 file changed, 61 insertions(+), 34 deletions(-)

diff --git a/drivers/media/pci/tw686x/tw686x-video.c 
b/drivers/media/pci/tw686x/tw686x-video.c
index 0e839f617e03..3131f9305313 100644
--- a/drivers/media/pci/tw686x/tw686x-video.c
+++ b/drivers/media/pci/tw686x/tw686x-video.c
@@ -28,6 +28,7 @@
 #define TW686X_INPUTS_PER_CH   4
 #define TW686X_VIDEO_WIDTH 720
 #define TW686X_VIDEO_HEIGHT(id)((id & V4L2_STD_525_60) ? 480 : 
576)
+#define TW686X_MAX_FPS(id) ((id & V4L2_STD_525_60) ? 30 : 25)
 
 #define TW686X_MAX_SG_ENTRY_SIZE   4096
 #define TW686X_MAX_SG_DESC_COUNT   256 /* PAL 720x576 needs 203 4-KB pages 
*/
@@ -369,53 +370,79 @@ const struct tw686x_dma_ops sg_dma_ops = {
.field  = V4L2_FIELD_SEQ_TB,
 };
 
-static unsigned int tw686x_fields_map(v4l2_std_id std, unsigned int fps)
+static const unsigned int fps_map[15] = {
+   /*
+* bit 31 enables selecting the field control register
+* bits 0-29 are a bitmask with fields that will be output.
+* For NTSC (and PAL-M, PAL-60), all 30 bits are used.
+* For other PAL standards, only the first 25 bits are used.
+*/
+   0x, /* output all fields */
+   0x8006, /* 2 fps (60Hz), 2 fps (50Hz) */
+   0x80018006, /* 4 fps (60Hz), 4 fps (50Hz) */
+   0x80618006, /* 6 fps (60Hz), 6 fps (50Hz) */
+   0x81818186, /* 8 fps (60Hz), 8 fps (50Hz) */
+   0x86186186, /* 10 fps (60Hz), 8 fps (50Hz) */
+   0x86619866, /* 12 fps (60Hz), 10 fps (50Hz) */
+   0x8666, /* 14 fps (60Hz), 12 fps (50Hz) */
+   0x999e, /* 16 fps (60Hz), 14 fps (50Hz) */
+   0x99e6799e, /* 18 fps (60Hz), 16 fps (50Hz) */
+   0x9e79e79e, /* 20 fps (60Hz), 16 fps (50Hz) */
+   0x9e7e7e7e, /* 22 fps (60Hz), 18 fps (50Hz) */
+   0x9fe7f9fe, /* 24 fps (60Hz), 20 fps (50Hz) */
+   0x9ffe7ffe, /* 26 fps (60Hz), 22 fps (50Hz) */
+   0x9ffe, /* 28 fps (60Hz), 24 fps (50Hz) */
+};
+
+static unsigned int tw686x_real_fps(unsigned int index, unsigned int max_fps)
 {
-   static const unsigned int map[15] = {
-   0x, 0x0001, 0x4001, 0x00104001, 0x00404041,
-   0x01041041, 0x01104411, 0x0111, 0x0445, 0x04511445,
-   0x05145145, 0x05151515, 0x05515455, 0x05551555, 0x0555
-   };
-
-   static const unsigned int std_625_50[26] = {
-   0, 1, 1, 2,  3,  3,  4,  4,  5,  5,  6,  7,  7,
-  8, 8, 9, 10, 10, 11, 11, 12, 13, 13, 14, 14, 0
-   };
-
-   static const unsigned int std_525_60[31] = {
-   0, 1, 1, 1, 2,  2,  3,  3,  4,  4,  5,  5,  6,  6, 7, 7,
-  8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 0, 0
-   };
+   unsigned long mask;
 
-   unsigned int i;
+   if (!index || index >= ARRAY_SIZE(fps_map))
+   return max_fps;
 
-   if (std & V4L2_STD_525_60) {
-   if (fps >= ARRAY_SIZE(std_525_60))
-   fps = 30;
-   i = std_525_60[fps];
-   } else {
-   if (fps >= ARRAY_SIZE(std_625_50))
-   fps = 25;
-   i = std_625_50[fps];
-   }
+   mask = GENMASK(max_fps - 1, 0);
+   return hweight_long(fps_map[index] & mask);
+}
+
+static unsigned int tw686x_fps_idx(unsigned int fps, unsigned int max_fps)
+{
+   unsigned int idx, real_fps;
+   int delta;
+
+   /* First guess */
+   idx = (12 + 15 * fps) / max_fps;
+
+   /* Minimal possible framerate is 2 frames per second */
+   if (!idx)
+   return 1;
+
+   /* Check if the difference is bigger than abs(1) and adjust */
+   real_fps = tw686x_real_fps(idx, max_fps);
+   delta = real_fps - fps;
+   if (delta < -1)
+   idx++;
+   else if (delta > 1)
+   idx--;
+
+   /* Max framerate */
+   if (idx >= 15)
+   return 0;
 
-   return map[i];
+   return idx;
 }
 
 static void tw686x_set_framerate(struct tw686x_video_channel *vc,
 unsigned int fps)
 {
-   unsigned int map;
+   unsigned int i;
 
if (vc->fps == fps)
return;
 
-   

Re: [PATCH v3] tw686x: use a formula instead of two tables for div

2016-06-28 Thread Ezequiel Garcia
On 27 June 2016 at 14:38, Mauro Carvalho Chehab  wrote:
> Em Mon, 27 Jun 2016 12:45:38 -0300
> Ezequiel Garcia  escreveu:
>
>> Hi Mauro,
>>
>> Thanks a lot for the patch.
>>
>> On 27 April 2016 at 12:27, Mauro Carvalho Chehab
>>  wrote:
>> > Instead of using two tables to estimate the temporal decimation
>> > factor, use a formula. This allows to get the closest fps, with
>> > sounds better than the current tables.
>> >
>> > Compile-tested only.
>> >
>> > Signed-off-by: Mauro Carvalho Chehab 
>> >
>> > [media] tw686x: cleanup the fps estimation code
>> >
>> > There are some issues with the old code:
>> > 1) it uses two static tables;
>> > 2) some values for 50Hz standards are wrong;
>> > 3) it doesn't store the real framerate.
>> >
>> > This patch fixes the above issues.
>> >
>> > Compile-tested only.
>> >
>> > Signed-off-by: Mauro Carvalho Chehab 
>> >
>> > -
>> >
>> > v3: Patch v2 were actually a diff patch against PATCH v1. Fold the two 
>> > patches in one.
>> >
>> > PS.: With this patch, it should be easy to add support for
>> > VIDIOC_G_PARM and VIDIOC_S_PARM, as vc->fps will now store the
>> > real frame rate, with should be used when returning from those
>> > functions.
>> >
>> > ---
>> >  drivers/media/pci/tw686x/tw686x-video.c | 110 
>> > +---
>> >  1 file changed, 73 insertions(+), 37 deletions(-)
>> >
>> > diff --git a/drivers/media/pci/tw686x/tw686x-video.c 
>> > b/drivers/media/pci/tw686x/tw686x-video.c
>> > index 253e10823ba3..b247a7b4ddd8 100644
>> > --- a/drivers/media/pci/tw686x/tw686x-video.c
>> > +++ b/drivers/media/pci/tw686x/tw686x-video.c
>> > @@ -43,53 +43,89 @@ static const struct tw686x_format formats[] = {
>> > }
>> >  };
>> >
>> > -static unsigned int tw686x_fields_map(v4l2_std_id std, unsigned int fps)
>> > +static const unsigned int fps_map[15] = {
>> > +   /*
>> > +* bit 31 enables selecting the field control register
>> > +* bits 0-29 are a bitmask with fields that will be output.
>> > +* For NTSC (and PAL-M, PAL-60), all 30 bits are used.
>> > +* For other PAL standards, only the first 25 bits are used.
>> > +*/
>>
>> I ran a few tests and it worked perfectly fine for 60Hz standards.
>
> Good!
>
>> For 50Hz standards, or at least for PAL-Nc, it didn't
>> work so well, and the real FPS was too different from the requested
>> one. I need to look into it some more.
>
> I would be expecting a maximum difference a little bigger than 1 Hz.
>
>> > +   0x, /* output all fields */
>> > +   0x8006, /* 2 fps (60Hz), 2 fps (50Hz) */
>> > +   0x80018006, /* 4 fps (60Hz), 4 fps (50Hz) */
>> > +   0x80618006, /* 6 fps (60Hz), 6 fps (50Hz) */
>> > +   0x81818186, /* 8 fps (60Hz), 8 fps (50Hz) */
>> > +   0x86186186, /* 10 fps (60Hz), 8 fps (50Hz) */
>> > +   0x86619866, /* 12 fps (60Hz), 10 fps (50Hz) */
>> > +   0x8666, /* 14 fps (60Hz), 12 fps (50Hz) */
>> > +   0x999e, /* 16 fps (60Hz), 14 fps (50Hz) */
>> > +   0x99e6799e, /* 18 fps (60Hz), 16 fps (50Hz) */
>> > +   0x9e79e79e, /* 20 fps (60Hz), 16 fps (50Hz) */
>> > +   0x9e7e7e7e, /* 22 fps (60Hz), 18 fps (50Hz) */
>> > +   0x9fe7f9fe, /* 24 fps (60Hz), 20 fps (50Hz) */
>> > +   0x9ffe7ffe, /* 26 fps (60Hz), 22 fps (50Hz) */
>> > +   0x9ffe, /* 28 fps (60Hz), 24 fps (50Hz) */
>>
>> Why this particular selection of fps values and bits set in each case?
>> Is it arbitrary?
>
> No. This is the same table that was already in the code:
>
> static const unsigned int map[15] = {
> 0x, 0x0001, 0x4001, 0x00104001, 0x00404041,
> 0x01041041, 0x01104411, 0x0111, 0x0445, 0x04511445,
> 0x05145145, 0x05151515, 0x05515455, 0x05551555, 0x0555
> };
>
> Except that the calculus that used to be there to set bit 31 to 1
> on everything except map[0] and the code that makes it set two
> FPS at the same time were pre-calculated, e. g. I run this code
> locally to generate the new table:
>
> map = tw686x_fields_map(vc->video_standard, fps) << 1;
> map |= map << 1;
> if (map > 0)
> map |= BIT(31);
>
> There, bit 31 = 0 disables the frame filtering. bit 31 = 1 enables it.
>
> Each bit at the 0-29 bitrange means one of the 30 frames received.
> If equal to 1, the frame is sent; if equal to 0, it is not sent.
>
> So, the first value, for example: 0x8006 has 2 consecutive
> bits set, so the mean frame rate would be 2Hz. The next value there
> is 0x0x80018006, with has 4 bits selected, so mean fps is 4Hz, and
> so on.
>
> As the original table always sets 2 consecutive frames at the same
> time, I suspect that this is a requirement to avoid interlacing
> issues.
>
> So, the code I used to generate the table always allocate 2 

Re: [PATCH v2 1/2] Add OV5647 device tree documentation

2016-06-28 Thread Rob Herring
On Tue, Jun 28, 2016 at 12:59:58PM +0100, Ramiro Oliveira wrote:
> Signed-off-by: Ramiro Oliveira 
> ---
>  .../devicetree/bindings/media/i2c/ov5647.txt  | 19 
> +++
>  1 file changed, 19 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/i2c/ov5647.txt

Acked-by: Rob Herring 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


si2157 driver

2016-06-28 Thread Oleh Kravchenko
Hello linux media developers!

I try add support for usb hybrid tuner, it based on:
CX23102-112, Si2158, Si2168

I updated cx231xx-cards.c with valid ids, but I don't have idea how to
use Si2158.
It is not listed in tuner-types.c

Why si2157.c is absent in tuner-types.c?
Or at the current state si2157.c don't have analog support?
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 00/38] i.MX5/6 Video Capture

2016-06-28 Thread Hans Verkuil
On 06/28/2016 08:54 PM, Tim Harvey wrote:
> On Tue, Jun 14, 2016 at 3:48 PM, Steve Longerbeam  
> wrote:
>> Tested on imx6q SabreAuto with ADV7180, and imx6q SabreSD with
>> mipi-csi2 OV5640. There is device-tree support also for imx6qdl
>> SabreLite, but that is not tested. Also, this driver should
>> theoretically work on i.MX5 targets, but that is also untested.
>>
>> Not run through v4l2-compliance yet, but that is in my queue.
>>
>>
> 
> Steve,
> 
> I've tested this series successfully with a Gateworks Ventana GW5300
> which has an IMX6Q and an adv7180 attached to IPU2_CSI1.
> 
> First of all, a big 'thank you' for taking the time to rebase and
> re-submit this series!
> 
> However based on the lack of feedback of the individual patches as

It's on my TODO list, but the series was a lot larger than I expected (and
touched on a lot of subsystems as well), so I postponed looking at this
until I have a bit more time.

> well as the fact they touch varied subsystems I think we are going to
> have better luck getting this functionality accepted if you broke it
> into separate series.
> 
> Here are my thoughts:
> 
>>   gpu: ipu-v3: Add Video Deinterlacer unit
>>   gpu: ipu-cpmem: Add ipu_cpmem_set_uv_offset()
>>   gpu: ipu-cpmem: Add ipu_cpmem_get_burstsize()
>>   gpu: ipu-v3: Add ipu_get_num()
>>   gpu: ipu-v3: Add IDMA channel linking support
>>   gpu: ipu-v3: Add ipu_set_vdi_src_mux()
>>   gpu: ipu-v3: Add VDI input IDMAC channels
>>   gpu: ipu-v3: Add ipu_csi_set_src()
>>   gpu: ipu-v3: Add ipu_ic_set_src()
>>   gpu: ipu-v3: set correct full sensor frame for PAL/NTSC
>>   gpu: ipu-v3: Fix CSI data format for 16-bit media bus formats
>>   gpu: ipu-v3: Fix IRT usage
>>   gpu: ipu-v3: Fix CSI0 blur in NTSC format
>>   gpu: ipu-ic: Add complete image conversion support with tiling
>>   gpu: ipu-ic: allow multiple handles to ic
>>   gpu: ipu-v3: rename CSI client device
> 
> These are all enhancements to the ipu-v3 driver shared by DRM and
> maintained by Philipp Zabel and there is no way to 'stage' them.
> Philipp, these have bee submitted previously with little to no changes
> or feedback - can we get sign-off or comment on these from you?

I'd like to know the status of this as well. If this can't go in, then
accepting the v4l2 driver in staging will likely be very difficult if not
impossible.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Tuning problem with Pinnacle PCTV 2000e

2016-06-28 Thread Guillaume Membré
Hi,

I asked this question on the mythtv mailling but without success :'(
I know that my question may not be appropriate, forgive me if I'm at
the wrong place.

I had a working mythtv 0.27.5 installation with a Pinnacle PCTV 2000e
(dual dvb-t usb card)  and I recently replaced my motherboard. I had
to upgrade the kernel due to compatibility issue with the usb-3 driver
and switch from 3.2.0 to 4.6.0.

Now, I can't record anything, recordings file are empty. I also tried
livetv : just after a fresh start of the bakend, the first channel is
working ok (tuning and playing ok) but when i try to switch to another
one, log fills up with "Ignoring PAT not containing our desired
program...".

In the example below, PID 257, 260, 261, 287, 369 belongs to the
multiplex with the frequency 68200 Hz. The recording is on the
channel M6 which is on the multiplex with the frequency 73800. The
PID displayed in log correspond to the previous tuned channel.
According to dvbtune, the reception is good (and SNR is as the same
level as 2 months ago) :
$ dvbtune -c 0 -m -tm 8 -cr AUTO -gi 8 -f 73800
Using DVB card "DiBcom 7000PC"
tuning DVB-T (in United Kingdom) to 73800 Hz
polling
Getting frontend event
FE_STATUS:
polling
Getting frontend event
FE_STATUS: FE_HAS_SIGNAL FE_HAS_LOCK FE_HAS_CARRIER FE_HAS_VITERBI FE_HAS_SYNC
Event:  Frequency: 73800
SymbolRate: 0
FEC_inner:  3
Bit error rate: 0
Signal strength: 26253
SNR: 228
FE_STATUS: FE_HAS_SIGNAL FE_HAS_LOCK FE_HAS_CARRIER FE_HAS_VITERBI FE_HAS_SYNC
Signal=26254, Verror=0, SNR=224dB, BlockErrors=0, (S|L|C|V|SY|)
Signal=26213, Verror=0, SNR=232dB, BlockErrors=0, (S|L|C|V|SY|)
Signal=26205, Verror=0, SNR=231dB, BlockErrors=0, (S|L|C|V|SY|)
Signal=26206, Verror=0, SNR=229dB, BlockErrors=0, (S|L|C|V|SY|)
Signal=26207, Verror=0, SNR=227dB, BlockErrors=0, (S|L|C|V|SY|)
Signal=26146, Verror=0, SNR=232dB, BlockErrors=0, (S|L|C|V|SY|)
Signal=26092, Verror=0, SNR=236dB, BlockErrors=0, (S|L|C|V|SY|)

If I record directly with tzap + cp, everything is good.

I tried a full rescan while deleting multiplex and channels through
mythtv-setup, I also increase tuning timeout without success.

Here is my setup :
debian jessie updated yesterday
kernel : 4.6.0-0.bpo.1-686-pae
Tuner : usb pinnacle double DVB-T PCTV 2000e, using dvb_usb_dib0700 driver
Mythtv version : 0.27.6

Have you any idea ?
Thanks a lot for your help

Here is a log of a mythtv recording starting but failling :
2016-06-25 21:02:10.909647 C  mythbackend version: fixes/0.27
[v0.27.6-26-g28b7db2-dirty] www.mythtv.org
2016-06-25 21:02:10.909678 C  Qt version: compile: 4.8.6, runtime: 4.8.6
2016-06-25 21:02:10.909687 N  Enabled verbose msgs:  general record channel
2016-06-25 21:02:10.909704 N  Setting Log Level to LOG_INFO
2016-06-25 21:02:10.911076 I  Added logging to the console
2016-06-25 21:02:10.911390 I  Setup Interrupt handler
2016-06-25 21:02:10.911411 I  Setup Terminated handler
2016-06-25 21:02:10.911434 I  Setup Segmentation fault handler
2016-06-25 21:02:10.911452 I  Setup Aborted handler
2016-06-25 21:02:10.911474 I  Setup Bus error handler
2016-06-25 21:02:10.911497 I  Setup Floating point exception handler
2016-06-25 21:02:10.911516 I  Setup Illegal instruction handler
2016-06-25 21:02:10.911541 I  Setup Real-time signal 0 handler
2016-06-25 21:02:10.911563 I  Setup Hangup handler
2016-06-25 21:02:10.911670 N  Using runtime prefix = /usr
2016-06-25 21:02:10.911699 N  Using configuration directory =
/home/mythtv/.mythtv
2016-06-25 21:02:10.911872 I  Assumed character encoding: en_US.UTF-8
2016-06-25 21:02:10.912931 N  Empty LocalHostName.
2016-06-25 21:02:10.912953 I  Using localhost value of popeye
2016-06-25 21:02:10.997799 N  Setting QT default locale to FR_US
2016-06-25 21:02:10.998391 I  Current locale FR_US
2016-06-25 21:02:10.998599 E  No locale defaults file for FR_US, skipping
2016-06-25 21:02:11.044372 I  Current MythTV Schema Version (DBSchemaVer): 1317
2016-06-25 21:02:11.050614 I  Loading fr translation for module mythfrontend
2016-06-25 21:02:11.068623 N  MythBackend: Starting up as the master server.
2016-06-25 21:02:11.114050 I  TVRec[1]:
SetRecordingStatus(Inconnu->Inconnu) on line 157
2016-06-25 21:02:11.115839 I  TVRec[1]: GetStartChannel(1, 'DVBInput')
2016-06-25 21:02:11.123796 I  TVRec[1]: Start channel: 2.
2016-06-25 21:02:11.123912 I  TVRec[1]: CreateChannel(2)
2016-06-25 21:02:11.146557 I  Added logging to mythlogserver at TCP:35327
2016-06-25 21:02:11.201562 I  DVBChan[1](/dev/dvb/adapter0/frontend0):
Opening DVB channel
2016-06-25 21:02:11.252759 I  DVBChan[1](/dev/dvb/adapter0/frontend0):
Using DVB card /dev/dvb/adapter0/frontend0, with frontend 'DiBcom
7000PC'.
2016-06-25 21:02:11.272954 I  ChannelBase[1]: Input #10: 'DVBInput'
schan(2) sourceid(1) ccid(1)
2016-06-25 21:02:11.273000 I  ChannelBase[1]: Current Input #10: 'DVBInput'
2016-06-25 21:02:11.274438 I  DTVChan[1](/dev/dvb/adapter0/frontend0):
SetChannelByString(2):
2016-06-25 

Re: [PATCH v2 0/2] Media Device Allocator API

2016-06-28 Thread Shuah Khan
On 05/24/2016 05:39 PM, Shuah Khan wrote:
> Media Device Allocator API to allows multiple drivers share a media device.
> Using this API, drivers can allocate a media device with the shared struct
> device as the key. Once the media device is allocated by a driver, other
> drivers can get a reference to it. The media device is released when all
> the references are released.
> 
> This patch series has been tested with au0828 and snd-usb-audio drivers.
> snd-us-audio patch isn't included in this series. Once this patch series
> is reviews and gets a stable state, I will send out the snd-usb-audio
> patch.
> 
> Changes since Patch v1 series: (based on Hans Virkuil's review)
> - Removed media_device_get() and media_device_allocate(). These are
>   unnecessary.
> - media_device_usb_allocate() holds media_device_lock to do allocate
>   and initialize the media device.
> - Changed media_device_put() to media_device_delete() for symmetry with
>   media_device_*_allocate().
> - Dropped media_device_unregister_put(). au0828 calls media_device_delete()
>   instead.
> 
> Shuah Khan (2):
>   media: Media Device Allocator API
>   media: change au0828 to use Media Device Allocator API
> 
>  drivers/media/Makefile |   3 +-
>  drivers/media/media-dev-allocator.c| 120 
> +
>  drivers/media/usb/au0828/au0828-core.c |  12 ++--
>  drivers/media/usb/au0828/au0828.h  |   1 +
>  include/media/media-dev-allocator.h|  85 +++
>  5 files changed, 212 insertions(+), 9 deletions(-)
>  create mode 100644 drivers/media/media-dev-allocator.c
>  create mode 100644 include/media/media-dev-allocator.h
> 


Hi Mauro,

Are you planning to get this inot 4,8-rc1? 

The first patch is now at [PATCH v3] media: Media Device Allocator API
that has been reviewed by Hans.

https://lkml.org/lkml/2016/5/27/530

thanks,
-- Shuah
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: s5p-mfc fix memory leak in s5p_mfc_remove()

2016-06-28 Thread Shuah Khan
On 06/28/2016 09:55 AM, Shuah Khan wrote:
> On 06/28/2016 07:39 AM, Shuah Khan wrote:
>> On 06/28/2016 03:57 AM, Kamil Debski wrote:
>>> HI Shuah,
>>>
>>> Which branch do you base your patches on?
>>>
>>> I have trouble applying this path
>>> (https://patchwork.linuxtv.org/patch/34577/) and 
>>> "s5p-mfc fix null pointer deference in clk_core_enable()"
>>> (https://patchwork.linuxtv.org/patch/34751/) 
>>> onto current linuxtv/master.
>>>
>>> The top commit of linuxtv/master is :
>>> "commit 0db5c79989de2c68d5abb7ba891bfdb3cd3b7e05
>>> Author: Mauro Carvalho Chehab 
>>> Date:   Thu Jun 16 08:04:40 2016 -0300
>>>
>>> [media] media-devnode.h: Fix documentation"
>>>
>>> Could you please rebase the two patches mentioned above to the
>>> linuxtv/master?
>>>
>>> Best wishes,
>>>
>>
>> I based them on linux_next. I will rebase both patches on linuxtv/master
>> and resend.
>>
> 
> Hi Kamil,
> 
> Do you need me to rebase this one:
> 
> https://patchwork.kernel.org/patch/9166119/
> 
> I will do that anyway and send three patches. I don't see the above
> in linuxtv/master
> 

Hi Kamil,

https://patchwork.kernel.org/patch/9166119/
media: s5p-mfc fix video device release double release in probe error path

and 

(https://patchwork.linuxtv.org/patch/34577/)
media: s5p-mfc fix memory leak in s5p_mfc_remove()

applied as is on top of linuxtv/master latest with top
commit

The following failed and applied with fuzz.

"s5p-mfc fix null pointer deference in clk_core_enable()"
(https://patchwork.linuxtv.org/patch/34751/) 
onto current linuxtv/master.

I generated a rebasewd patch series with the above 3 patches
and sent it.

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

thanks,
-- Shuah
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH REBASE 2/3] media: s5p-mfc fix memory leak in s5p_mfc_remove()

2016-06-28 Thread Shuah Khan
s5p_mfc_remove() fails to release encoder and decoder video devices.

Signed-off-by: Shuah Khan 
Reviewed-by: Javier Martinez Canillas 
---
 drivers/media/platform/s5p-mfc/s5p_mfc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index 274b4f1..f537b74 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -1318,6 +1318,8 @@ static int s5p_mfc_remove(struct platform_device *pdev)
 
video_unregister_device(dev->vfd_enc);
video_unregister_device(dev->vfd_dec);
+   video_device_release(dev->vfd_enc);
+   video_device_release(dev->vfd_dec);
v4l2_device_unregister(>v4l2_dev);
s5p_mfc_release_firmware(dev);
vb2_dma_contig_cleanup_ctx(dev->alloc_ctx[0]);
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 4/4] ARM64: dts: meson-gxbb: Enable the the IR decoder on supported boards

2016-06-28 Thread Martin Blumenstingl
Enable the Infrared Remote Controller on boards which have an Infrared
receiver.

Signed-off-by: Martin Blumenstingl 
---
 arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts  | 4 
 arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi | 4 
 arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 4 
 3 files changed, 12 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts 
b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
index b06bf8a..9a451ce 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
@@ -120,3 +120,7 @@
vmmc-supply = <_iv>;
voltage-ranges = <1800 3300>;
 };
+
+ {
+   status = "okay";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi 
b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
index 5dfd849..2650bb7 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
@@ -102,3 +102,7 @@
voltage-ranges = <1800 3300>;
vmmc-supply = <_iv>;
 };
+
+ {
+   status = "okay";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi 
b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
index 54bb7c7..934deb9 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
@@ -60,3 +60,7 @@
pinctrl-names = "default";
 
 };
+
+ {
+   status = "okay";
+};
-- 
2.9.0

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 0/4] Add Meson 8b / GXBB support to the IR driver

2016-06-28 Thread Martin Blumenstingl
Newer Amlogic platforms (Meson 8b and GXBB) use a slightly different
register layout for their Infrared Remoete Controller. The decoder mode
is now configured in another register. Without the changes to the
meson-ir driver we are simply getting incorrect "durations" reported
from the hardware (because the hardware is not in time measurement aka
software decode mode).

This problem was also noticed by some people trying to use this on an
ODROID-C1 and ODROID-C2 - the workaround there (probably because the
datasheets were not publicy available yet at that time) was to switch
to ir_raw_event_store_edge (which leaves it up to the kernel to measure
the duration of a pulse). See [0] and [1] for the corresponding
patches.


Changes in v3:
- based on the patches of Neil Armstrong
- depending on the platform either the old (default) or new registers
  (this has to be enabled explicitly by using "amlogic,meson8b-ir" or
  "amlogic,meson-gxbb-ir")
- the changes to arch/arm/boot/dts/meson.dtsi are not part of this
  series anymore, because the size specified there is valid for the
  Meson 6b version of the IR decoder
- Add the IR decoder to meson-gxbb.dtsi and enable it on the supported
  boards


[0] 
https://github.com/erdoukki/linux-amlogic-1/commit/969b2e2242fb14a13cb651f9a1cf771b599c958b
[1] http://forum.odroid.com/viewtopic.php?f=135=20504


Martin Blumenstingl (1):
  ARM64: dts: meson-gxbb: Enable the the IR decoder on supported boards

Neil Armstrong (3):
  dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings
  media: rc: meson-ir: Add support for newer versions of the IR decoder
  ARM64: meson-gxbb: Add Infrared Remote Controller decoder

 .../devicetree/bindings/media/meson-ir.txt |  5 +++-
 .../arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts |  4 +++
 arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi   |  4 +++
 .../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi  |  4 +++
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi|  7 ++
 drivers/media/rc/meson-ir.c| 29 ++
 6 files changed, 47 insertions(+), 6 deletions(-)

-- 
2.9.0

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 3/4] ARM64: meson-gxbb: Add Infrared Remote Controller decoder

2016-06-28 Thread Martin Blumenstingl
From: Neil Armstrong 

This adds the Infrared Remote Controller node so boards with an IR
remote can simply enable it.

Signed-off-by: Neil Armstrong 
Signed-off-by: Martin Blumenstingl 
---
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi 
b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index 6c23965..fa88f80 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -213,6 +213,13 @@
clocks = <>;
status = "disabled";
};
+
+   ir: ir@580 {
+   compatible = "amlogic,meson-gxbb-ir";
+   reg = <0x0 0x00580 0x0 0x40>;
+   interrupts = ;
+   status = "disabled";
+   };
};
 
periphs: periphs@c8834000 {
-- 
2.9.0

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 1/4] dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings

2016-06-28 Thread Martin Blumenstingl
From: Neil Armstrong 

New bindings are needed as the register layout on the newer platforms
is slightly different compared to Meson6b.

Signed-off-by: Neil Armstrong 
Signed-off-by: Martin Blumenstingl 
---
 Documentation/devicetree/bindings/media/meson-ir.txt | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/media/meson-ir.txt 
b/Documentation/devicetree/bindings/media/meson-ir.txt
index 407848e..e7e3f3c 100644
--- a/Documentation/devicetree/bindings/media/meson-ir.txt
+++ b/Documentation/devicetree/bindings/media/meson-ir.txt
@@ -1,7 +1,10 @@
 * Amlogic Meson IR remote control receiver
 
 Required properties:
- - compatible  : should be "amlogic,meson6-ir"
+ - compatible  : depending on the platform this should be one of:
+ - "amlogic,meson6-ir"
+ - "amlogic,meson8b-ir"
+ - "amlogic,meson-gxbb-ir"
  - reg : physical base address and length of the device registers
  - interrupts  : a single specifier for the interrupt from the device
 
-- 
2.9.0

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 2/4] media: rc: meson-ir: Add support for newer versions of the IR decoder

2016-06-28 Thread Martin Blumenstingl
From: Neil Armstrong 

Newer SoCs (Meson 8b and GXBB) are using REG2 (offset 0x20) instead of
REG1 to configure the decoder mode. This makes it necessary to
introduce new bindings so the driver knows which register has to be
used.

Signed-off-by: Neil Armstrong 
Signed-off-by: Martin Blumenstingl 
---
 drivers/media/rc/meson-ir.c | 29 -
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/drivers/media/rc/meson-ir.c b/drivers/media/rc/meson-ir.c
index fcc3b82..003fff0 100644
--- a/drivers/media/rc/meson-ir.c
+++ b/drivers/media/rc/meson-ir.c
@@ -24,6 +24,7 @@
 
 #define DRIVER_NAME"meson-ir"
 
+/* valid on all Meson platforms */
 #define IR_DEC_LDR_ACTIVE  0x00
 #define IR_DEC_LDR_IDLE0x04
 #define IR_DEC_LDR_REPEAT  0x08
@@ -32,12 +33,21 @@
 #define IR_DEC_FRAME   0x14
 #define IR_DEC_STATUS  0x18
 #define IR_DEC_REG10x1c
+/* only available on Meson 8b and newer */
+#define IR_DEC_REG20x20
 
 #define REG0_RATE_MASK (BIT(11) - 1)
 
-#define REG1_MODE_MASK (BIT(7) | BIT(8))
-#define REG1_MODE_NEC  (0 << 7)
-#define REG1_MODE_GENERAL  (2 << 7)
+#define DECODE_MODE_NEC0x0
+#define DECODE_MODE_RAW0x2
+
+/* Meson 6b uses REG1 to configure the mode */
+#define REG1_MODE_MASK GENMASK(8, 7)
+#define REG1_MODE_SHIFT7
+
+/* Meson 8b / GXBB use REG2 to configure the mode */
+#define REG2_MODE_MASK GENMASK(3, 0)
+#define REG2_MODE_SHIFT0
 
 #define REG1_TIME_IV_SHIFT 16
 #define REG1_TIME_IV_MASK  ((BIT(13) - 1) << REG1_TIME_IV_SHIFT)
@@ -158,8 +168,15 @@ static int meson_ir_probe(struct platform_device *pdev)
/* Reset the decoder */
meson_ir_set_mask(ir, IR_DEC_REG1, REG1_RESET, REG1_RESET);
meson_ir_set_mask(ir, IR_DEC_REG1, REG1_RESET, 0);
-   /* Set general operation mode */
-   meson_ir_set_mask(ir, IR_DEC_REG1, REG1_MODE_MASK, REG1_MODE_GENERAL);
+
+   /* Set general operation mode (= raw/software decoding) */
+   if (of_device_is_compatible(node, "amlogic,meson6-ir"))
+   meson_ir_set_mask(ir, IR_DEC_REG1, REG1_MODE_MASK,
+ DECODE_MODE_RAW << REG1_MODE_SHIFT);
+   else
+   meson_ir_set_mask(ir, IR_DEC_REG2, REG2_MODE_MASK,
+ DECODE_MODE_RAW << REG2_MODE_SHIFT);
+
/* Set rate */
meson_ir_set_mask(ir, IR_DEC_REG0, REG0_RATE_MASK, MESON_TRATE - 1);
/* IRQ on rising and falling edges */
@@ -197,6 +214,8 @@ static int meson_ir_remove(struct platform_device *pdev)
 
 static const struct of_device_id meson_ir_match[] = {
{ .compatible = "amlogic,meson6-ir" },
+   { .compatible = "amlogic,meson8b-ir" },
+   { .compatible = "amlogic,meson-gxbb-ir" },
{ },
 };
 
-- 
2.9.0

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH REBASE 1/3] media: s5p-mfc fix video device release double release in probe error path

2016-06-28 Thread Shuah Khan
Fix Decoder and encoder video device double release in probe error path.
video_device_release(dev->vfd_dec) get called twice if decoder register
fails. Also, video_device_release(dev->vfd_enc) get called twice if encoder
register fails.

Signed-off-by: Shuah Khan 
---
 drivers/media/platform/s5p-mfc/s5p_mfc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index 6ee620e..274b4f1 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -1266,7 +1266,6 @@ static int s5p_mfc_probe(struct platform_device *pdev)
ret = video_register_device(dev->vfd_dec, VFL_TYPE_GRABBER, 0);
if (ret) {
v4l2_err(>v4l2_dev, "Failed to register video device\n");
-   video_device_release(dev->vfd_dec);
goto err_dec_reg;
}
v4l2_info(>v4l2_dev,
@@ -1275,7 +1274,6 @@ static int s5p_mfc_probe(struct platform_device *pdev)
ret = video_register_device(dev->vfd_enc, VFL_TYPE_GRABBER, 0);
if (ret) {
v4l2_err(>v4l2_dev, "Failed to register video device\n");
-   video_device_release(dev->vfd_enc);
goto err_enc_reg;
}
v4l2_info(>v4l2_dev,
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH REBASE 0/3] Rebased on linuxtv/master

2016-06-28 Thread Shuah Khan
Rebased on linuxtv/master latest with the top commit:
commit 80aa26593e3eb48f16c4222aa27ff40806f57c45
Author: Ulrich Hecht 
Date: Wed May 11 11:02:53 2016 -0300

Shuah Khan (3):
  media: s5p-mfc fix video device release double release in probe error
path
  media: s5p-mfc fix memory leak in s5p_mfc_remove()
  media: s5p-mfc fix null pointer deference in clk_core_enable()

 drivers/media/platform/s5p-mfc/s5p_mfc.c|  4 ++--
 drivers/media/platform/s5p-mfc/s5p_mfc_pm.c | 12 +---
 2 files changed, 11 insertions(+), 5 deletions(-)

-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH REBASE 3/3] media: s5p-mfc fix null pointer deference in clk_core_enable()

2016-06-28 Thread Shuah Khan
Fix null pointer deference in clk_core_enable() when driver unbind is run
when there is an application has an active pipeline playing.

s5p_mfc_release() gets called after s5p_mfc_final_pm() disables and does
clk_put() and s5p_mfc_release() attempts to enable clock and runs into
null pointer deference accessing invalid pointer.

[ 4869.434709] Unable to handle kernel NULL pointer dereference at virtual addr0
[ 4869.441312] pgd = e91ac000
[ 4869.443996] [0010] *pgd=ba4f7835
[ 4869.447552] Internal error: Oops: 17 [#1] PREEMPT SMP ARM
[ 4869.452921] Modules linked in: cpufreq_userspace cpufreq_powersave cpufreq_ca
[ 4869.471728] CPU: 4 PID: 2965 Comm: lt-gst-launch-1 Not tainted 4.7.0-rc2-nex0
[ 4869.481778] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[ 4869.487844] task: e91f1e00 ti: ed65 task.ti: ed65
[ 4869.493227] PC is at clk_core_enable+0x4c/0x98
[ 4869.497637] LR is at clk_core_enable+0x40/0x98
[ 4869.502056] pc : []lr : []psr: 60060093
[ 4869.502056] sp : ed651f18  ip :   fp : 002641b4
[ 4869.513493] r10: e9088c08  r9 : 0008  r8 : ed676d68
[ 4869.518692] r7 : ee3ac000  r6 : bf16b3c0  r5 : a0060013  r4 : ee37a8c0
[ 4869.525191] r3 :   r2 : 0001  r1 : 0004  r0 : 
[ 4869.531692] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment noe
[ 4869.538883] Control: 10c5387d  Table: 691ac06a  DAC: 0051
[ 4869.544603] Process lt-gst-launch-1 (pid: 2965, stack limit = 0xed650210)
[ 4869.551361] Stack: (0xed651f18 to 0xed652000)
[ 4869.555694] 1f00:   ee373
[ 4869.563841] 1f20: bf16b3c0 c055a0e0 ee3ac004 ed676c10 bf16b3c0 bf1558e0 e9080
[ 4869.571986] 1f40:  ee98a510 ee502e40 bf047344 e9088c00 ee986938 4
[ 4869.580132] 1f60:   e91f2204  c0b4658c e91f1e00 c0100
[ 4869.588277] 1f80:  c0135c58 ed65 c0107904 ed651fb0 0006 c0104
[ 4869.596423] 1fa0: 00229500 b6581000 b6f7b544 c0107794  0002 b6f90
[ 4869.604568] 1fc0: 00229500 b6581000 b6f7b544 0006 0017b600 0002c038 00264
[ 4869.612714] 1fe0:  bee56ef0  b6d49612 00060030 0006 0
[ 4869.620865] [] (clk_core_enable) from [] (clk_enable+0x2)
[ 4869.628509] [] (clk_enable) from [] (s5p_mfc_release+0x3)
[ 4869.637111] [] (s5p_mfc_release [s5p_mfc]) from [] (v4l2)
[ 4869.646706] [] (v4l2_release [videodev]) from [] (__fput)
[ 4869.654745] [] (__fput) from [] (task_work_run+0x94/0xc8)
[ 4869.661852] [] (task_work_run) from [] (do_work_pending+)
[ 4869.669735] [] (do_work_pending) from [] (slow_work_pend)
[ 4869.677878] Code: ebef e350 18bd8070 e5943004 (e5933010)

Signed-off-by: Shuah Khan 
---
 drivers/media/platform/s5p-mfc/s5p_mfc_pm.c | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c
index 9f75221..930dc2d 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c
@@ -77,8 +77,10 @@ int s5p_mfc_init_pm(struct s5p_mfc_dev *dev)
 
 err_s_clk:
clk_put(pm->clock);
+   pm->clock = NULL;
 err_p_ip_clk:
clk_put(pm->clock_gate);
+   pm->clock_gate = NULL;
 err_g_ip_clk:
return ret;
 }
@@ -89,9 +91,11 @@ void s5p_mfc_final_pm(struct s5p_mfc_dev *dev)
pm->clock) {
clk_disable_unprepare(pm->clock);
clk_put(pm->clock);
+   pm->clock = NULL;
}
clk_unprepare(pm->clock_gate);
clk_put(pm->clock_gate);
+   pm->clock_gate = NULL;
 #ifdef CONFIG_PM
pm_runtime_disable(pm->device);
 #endif
@@ -99,12 +103,13 @@ void s5p_mfc_final_pm(struct s5p_mfc_dev *dev)
 
 int s5p_mfc_clock_on(void)
 {
-   int ret;
+   int ret = 0;
 #ifdef CLK_DEBUG
atomic_inc(_ref);
mfc_debug(3, "+ %d\n", atomic_read(_ref));
 #endif
-   ret = clk_enable(pm->clock_gate);
+   if (!IS_ERR_OR_NULL(pm->clock_gate))
+   ret = clk_enable(pm->clock_gate);
return ret;
 }
 
@@ -114,7 +119,8 @@ void s5p_mfc_clock_off(void)
atomic_dec(_ref);
mfc_debug(3, "- %d\n", atomic_read(_ref));
 #endif
-   clk_disable(pm->clock_gate);
+   if (!IS_ERR_OR_NULL(pm->clock_gate))
+   clk_disable(pm->clock_gate);
 }
 
 int s5p_mfc_power_on(void)
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 00/38] i.MX5/6 Video Capture

2016-06-28 Thread Tim Harvey
On Tue, Jun 14, 2016 at 3:48 PM, Steve Longerbeam  wrote:
> Tested on imx6q SabreAuto with ADV7180, and imx6q SabreSD with
> mipi-csi2 OV5640. There is device-tree support also for imx6qdl
> SabreLite, but that is not tested. Also, this driver should
> theoretically work on i.MX5 targets, but that is also untested.
>
> Not run through v4l2-compliance yet, but that is in my queue.
>
>

Steve,

I've tested this series successfully with a Gateworks Ventana GW5300
which has an IMX6Q and an adv7180 attached to IPU2_CSI1.

First of all, a big 'thank you' for taking the time to rebase and
re-submit this series!

However based on the lack of feedback of the individual patches as
well as the fact they touch varied subsystems I think we are going to
have better luck getting this functionality accepted if you broke it
into separate series.

Here are my thoughts:

>   gpu: ipu-v3: Add Video Deinterlacer unit
>   gpu: ipu-cpmem: Add ipu_cpmem_set_uv_offset()
>   gpu: ipu-cpmem: Add ipu_cpmem_get_burstsize()
>   gpu: ipu-v3: Add ipu_get_num()
>   gpu: ipu-v3: Add IDMA channel linking support
>   gpu: ipu-v3: Add ipu_set_vdi_src_mux()
>   gpu: ipu-v3: Add VDI input IDMAC channels
>   gpu: ipu-v3: Add ipu_csi_set_src()
>   gpu: ipu-v3: Add ipu_ic_set_src()
>   gpu: ipu-v3: set correct full sensor frame for PAL/NTSC
>   gpu: ipu-v3: Fix CSI data format for 16-bit media bus formats
>   gpu: ipu-v3: Fix IRT usage
>   gpu: ipu-v3: Fix CSI0 blur in NTSC format
>   gpu: ipu-ic: Add complete image conversion support with tiling
>   gpu: ipu-ic: allow multiple handles to ic
>   gpu: ipu-v3: rename CSI client device

These are all enhancements to the ipu-v3 driver shared by DRM and
maintained by Philipp Zabel and there is no way to 'stage' them.
Philipp, these have bee submitted previously with little to no changes
or feedback - can we get sign-off or comment on these from you?

Next I would submit the set of drivers that depend on the above into
staging as Hans has said he would accept those (assuming the deps are
accepted). Also, you should submit the drivers first in your series,
then the imx6q.dtsi/imx6qdl.dtsi patches following such as:

>   media: imx: Add MIPI CSI-2 Receiver driver
>   media: Add camera interface driver for i.MX5/6
>   media: Add i.MX5/6 mem2mem driver
>   media: imx: Add video switch
>   ARM: imx_v6_v7_defconfig: Enable staging video4linux drivers
>   ARM: dts: imx6qdl: Add mipi_ipu1/2 video muxes, mipi_csi, and their 
> connections
>   ARM: dts: imx6qdl: Flesh out MIPI CSI2 receiver node
>   ARM: dts: imx6qdl: add mem2mem device for sabre* boards

I think this last one should add the mem2mem nodes to imx6q.dtsi and
imx6dl.dtsi to be useable by all boards with IPUs right?

After this we have a platform that many imx6 boards with capture
devices can build on.

In parallel, you have a couple of other dependencies before saber*
boards have full capture support that need to through other trees:

>   gpio: pca953x: Add reset-gpios property

This should be submitted through the linux-gpio list/subsystem.

>   clocksource/drivers/imx: add input capture support

Not sure what path this one goes through but it looks to me this patch
adds a feature that only some boards may require (input-capture).

>   media: imx: Add support for MIPI CSI-2 OV5640
>   media: imx: Add support for Parallel OV5642

shouldn't these be subdev drivers? Perhaps the can make it into
staging at least in the form you have them now.

>   v4l: Add signal lock status to source change events
>   media: imx: Add support for ADV7180 Video Decoder

These should be dropped (the 1st is a dependency of the 2nd) and
instead we should be using the subdev driver. I believe you have this
working, and I have been somewhat successful with some of your patches
as well although I still have a 'rolling image' and do not appear to
be getting signal detect interrupts after the first one (which is
likely causing the rolling).

>   media: adv7180: add power pin control
>   media: adv7180: implement g_parm

These seem very reasonable and indeed go to linux-media but perhaps
should be split out from the imx6 patchset to be able to get more
attention on them?

>   ARM: dts: imx6-sabrelite: add video capture ports and connections
>   ARM: dts: imx6-sabresd: add video capture ports and connections
>   ARM: dts: imx6-sabreauto: create i2cmux for i2c3
>   ARM: dts: imx6-sabreauto: add reset-gpios property for max7310
>   ARM: dts: imx6-sabreauto: add pinctrl for gpt input capture
>   ARM: dts: imx6-sabreauto: add video capture ports and connections

These should probably be last in a series on their own as there are
several dependencies within them for things that need to take
alternate submission paths.

Regards,

Tim
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: s5p-mfc fix memory leak in s5p_mfc_remove()

2016-06-28 Thread Shuah Khan
On 06/28/2016 07:39 AM, Shuah Khan wrote:
> On 06/28/2016 03:57 AM, Kamil Debski wrote:
>> HI Shuah,
>>
>> Which branch do you base your patches on?
>>
>> I have trouble applying this path
>> (https://patchwork.linuxtv.org/patch/34577/) and 
>> "s5p-mfc fix null pointer deference in clk_core_enable()"
>> (https://patchwork.linuxtv.org/patch/34751/) 
>> onto current linuxtv/master.
>>
>> The top commit of linuxtv/master is :
>> "commit 0db5c79989de2c68d5abb7ba891bfdb3cd3b7e05
>> Author: Mauro Carvalho Chehab 
>> Date:   Thu Jun 16 08:04:40 2016 -0300
>>
>> [media] media-devnode.h: Fix documentation"
>>
>> Could you please rebase the two patches mentioned above to the
>> linuxtv/master?
>>
>> Best wishes,
>>
> 
> I based them on linux_next. I will rebase both patches on linuxtv/master
> and resend.
> 

Hi Kamil,

Do you need me to rebase this one:

https://patchwork.kernel.org/patch/9166119/

I will do that anyway and send three patches. I don't see the above
in linuxtv/master

thanks,
-- Shuah

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL FOR v4.8] Two more CEC patches

2016-06-28 Thread Hans Verkuil
This adds the missing rc-cec keymap module and a bug fix patch.

I originally thought the rc-cec module was already merged in the cec topic 
branch,
but I later discovered that it wasn't.

Regards,

Hans

The following changes since commit c7169ad5616229b87cabf886bc5f9cbd1fc35a5f:

  [media] DocBook/media: add CEC documentation (2016-06-28 11:45:24 -0300)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git cec-topic2

for you to fetch changes up to 4049cdd6d38815017c553a76c958181d11861133:

  cec-adap: on reply, restore the tx_status value from the transmit (2016-06-28 
17:05:24 +0200)


Hans Verkuil (1):
  cec-adap: on reply, restore the tx_status value from the transmit

Kamil Debski (1):
  rc-cec: Add HDMI CEC keymap module

 drivers/media/rc/keymaps/Makefile|   1 +
 drivers/media/rc/keymaps/rc-cec.c| 182 

 drivers/staging/media/cec/cec-adap.c |   1 +
 3 files changed, 184 insertions(+)
 create mode 100644 drivers/media/rc/keymaps/rc-cec.c
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL FOR v4.8] Two more CEC patches

2016-06-28 Thread Hans Verkuil
(apologies if this is a duplicate, the first attempt to mail this seemed to 
fail).

This adds the missing rc-cec keymap module and a bug fix patch.

I originally thought the rc-cec module was already merged in the cec topic 
branch,
but I later discovered that it wasn't.

Regards,

Hans

The following changes since commit c7169ad5616229b87cabf886bc5f9cbd1fc35a5f:

  [media] DocBook/media: add CEC documentation (2016-06-28 11:45:24 -0300)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git cec-topic2

for you to fetch changes up to 4049cdd6d38815017c553a76c958181d11861133:

  cec-adap: on reply, restore the tx_status value from the transmit (2016-06-28 
17:05:24 +0200)


Hans Verkuil (1):
  cec-adap: on reply, restore the tx_status value from the transmit

Kamil Debski (1):
  rc-cec: Add HDMI CEC keymap module

 drivers/media/rc/keymaps/Makefile|   1 +
 drivers/media/rc/keymaps/rc-cec.c| 182 

 drivers/staging/media/cec/cec-adap.c |   1 +
 3 files changed, 184 insertions(+)
 create mode 100644 drivers/media/rc/keymaps/rc-cec.c
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] cec-adap: on reply, restore the tx_status value from the,transmit

2016-06-28 Thread Hans Verkuil
When a reply to an earlier transmit is received, the tx_status of that
transmit needs to be restored. Otherwise the status that the transmit
was successful would be lost.

Signed-off-by: Hans Verkuil 
---
Note: this patch sits on top of the cec topic branch.
---
 drivers/staging/media/cec/cec-adap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/cec/cec-adap.c 
b/drivers/staging/media/cec/cec-adap.c
index 5ffa839..98bdcf9 100644
--- a/drivers/staging/media/cec/cec-adap.c
+++ b/drivers/staging/media/cec/cec-adap.c
@@ -801,6 +801,7 @@ void cec_received_msg(struct cec_adapter *adap, struct 
cec_msg *msg)

/* We got a reply */
msg->sequence = dst->sequence;
+   msg->tx_status = dst->tx_status;
dst_reply = dst->reply;
*dst = *msg;
dst->reply = dst_reply;
-- 
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] [media] s5p_cec: get rid of an unused var

2016-06-28 Thread Mauro Carvalho Chehab
drivers/staging/media/s5p-cec/s5p_cec.c: In function 's5p_cec_adap_enable':
drivers/staging/media/s5p-cec/s5p_cec.c:42:6: warning: variable 'ret' set but 
not used [-Wunused-but-set-variable]
  int ret;
  ^~~

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/staging/media/s5p-cec/s5p_cec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/media/s5p-cec/s5p_cec.c 
b/drivers/staging/media/s5p-cec/s5p_cec.c
index 3844f3915220..f90b7c4e48fe 100644
--- a/drivers/staging/media/s5p-cec/s5p_cec.c
+++ b/drivers/staging/media/s5p-cec/s5p_cec.c
@@ -39,10 +39,9 @@ MODULE_PARM_DESC(debug, "debug level (0-2)");
 static int s5p_cec_adap_enable(struct cec_adapter *adap, bool enable)
 {
struct s5p_cec_dev *cec = adap->priv;
-   int ret;
 
if (enable) {
-   ret = pm_runtime_get_sync(cec->dev);
+   pm_runtime_get_sync(cec->dev);
 
s5p_cec_reset(cec);
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] [media] move s5p-cec to staging

2016-06-28 Thread Mauro Carvalho Chehab
As the CEC core is currently at staging, it doesn't make any sense
to put a dependent driver outside staging. So, move it also to
staging.

Signed-off-by: Mauro Carvalho Chehab 
---
 MAINTAINERS|  2 +-
 drivers/media/platform/Kconfig | 10 --
 drivers/media/platform/Makefile|  1 -
 drivers/staging/media/Kconfig  |  2 ++
 drivers/staging/media/Makefile |  1 +
 drivers/staging/media/s5p-cec/Kconfig  |  9 +
 drivers/{media/platform => staging/media}/s5p-cec/Makefile |  0
 drivers/staging/media/s5p-cec/TODO |  3 +++
 .../platform => staging/media}/s5p-cec/exynos_hdmi_cec.h   |  0
 .../platform => staging/media}/s5p-cec/exynos_hdmi_cecctrl.c   |  0
 drivers/{media/platform => staging/media}/s5p-cec/regs-cec.h   |  0
 drivers/{media/platform => staging/media}/s5p-cec/s5p_cec.c|  0
 drivers/{media/platform => staging/media}/s5p-cec/s5p_cec.h|  0
 13 files changed, 16 insertions(+), 12 deletions(-)
 create mode 100644 drivers/staging/media/s5p-cec/Kconfig
 rename drivers/{media/platform => staging/media}/s5p-cec/Makefile (100%)
 create mode 100644 drivers/staging/media/s5p-cec/TODO
 rename drivers/{media/platform => staging/media}/s5p-cec/exynos_hdmi_cec.h 
(100%)
 rename drivers/{media/platform => staging/media}/s5p-cec/exynos_hdmi_cecctrl.c 
(100%)
 rename drivers/{media/platform => staging/media}/s5p-cec/regs-cec.h (100%)
 rename drivers/{media/platform => staging/media}/s5p-cec/s5p_cec.c (100%)
 rename drivers/{media/platform => staging/media}/s5p-cec/s5p_cec.h (100%)

diff --git a/MAINTAINERS b/MAINTAINERS
index 7f76a3bf069f..962c5b0d2a3d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1647,7 +1647,7 @@ M:Kyungmin Park 
 L: linux-arm-ker...@lists.infradead.org
 L: linux-media@vger.kernel.org
 S: Maintained
-F: drivers/media/platform/s5p-cec/
+F: drivers/staging/media/platform/s5p-cec/
 
 ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT
 M: Andrzej Pietrasiewicz 
diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 567717583246..382f3937379e 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -108,16 +108,6 @@ config VIDEO_S3C_CAMIF
 source "drivers/media/platform/soc_camera/Kconfig"
 source "drivers/media/platform/exynos4-is/Kconfig"
 source "drivers/media/platform/s5p-tv/Kconfig"
-
-config VIDEO_SAMSUNG_S5P_CEC
-   tristate "Samsung S5P CEC driver"
-   depends on VIDEO_DEV && MEDIA_CEC && (PLAT_S5P || ARCH_EXYNOS || 
COMPILE_TEST)
-   ---help---
- This is a driver for Samsung S5P HDMI CEC interface. It uses the
- generic CEC framework interface.
- CEC bus is present in the HDMI connector and enables communication
- between compatible devices.
-
 source "drivers/media/platform/am437x/Kconfig"
 source "drivers/media/platform/xilinx/Kconfig"
 source "drivers/media/platform/rcar-vin/Kconfig"
diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
index 9a2fe9513282..99cf31542f54 100644
--- a/drivers/media/platform/Makefile
+++ b/drivers/media/platform/Makefile
@@ -28,7 +28,6 @@ obj-$(CONFIG_VIDEO_MEM2MEM_DEINTERLACE)   += 
m2m-deinterlace.o
 
 obj-$(CONFIG_VIDEO_S3C_CAMIF)  += s3c-camif/
 obj-$(CONFIG_VIDEO_SAMSUNG_EXYNOS4_IS) += exynos4-is/
-obj-$(CONFIG_VIDEO_SAMSUNG_S5P_CEC)+= s5p-cec/
 obj-$(CONFIG_VIDEO_SAMSUNG_S5P_JPEG)   += s5p-jpeg/
 obj-$(CONFIG_VIDEO_SAMSUNG_S5P_MFC)+= s5p-mfc/
 obj-$(CONFIG_VIDEO_SAMSUNG_S5P_TV) += s5p-tv/
diff --git a/drivers/staging/media/Kconfig b/drivers/staging/media/Kconfig
index 7ce679eb87e1..567078986c94 100644
--- a/drivers/staging/media/Kconfig
+++ b/drivers/staging/media/Kconfig
@@ -31,6 +31,8 @@ source "drivers/staging/media/omap4iss/Kconfig"
 
 source "drivers/staging/media/tw686x-kh/Kconfig"
 
+source "drivers/staging/media/s5p-cec/Kconfig"
+
 # Keep LIRC at the end, as it has sub-menus
 source "drivers/staging/media/lirc/Kconfig"
 
diff --git a/drivers/staging/media/Makefile b/drivers/staging/media/Makefile
index 2d213dd54bc3..989c844f4996 100644
--- a/drivers/staging/media/Makefile
+++ b/drivers/staging/media/Makefile
@@ -1,5 +1,6 @@
 obj-$(CONFIG_I2C_BCM2048)  += bcm2048/
 obj-$(CONFIG_MEDIA_CEC)+= cec/
+obj-$(CONFIG_VIDEO_SAMSUNG_S5P_CEC) += s5p-cec/
 obj-$(CONFIG_DVB_CXD2099)  += cxd2099/
 obj-$(CONFIG_LIRC_STAGING) += lirc/
 obj-$(CONFIG_VIDEO_DM365_VPFE) += davinci_vpfe/
diff --git a/drivers/staging/media/s5p-cec/Kconfig 
b/drivers/staging/media/s5p-cec/Kconfig
new file mode 100644
index ..0315fd7ad0f1
--- /dev/null
+++ b/drivers/staging/media/s5p-cec/Kconfig
@@ -0,0 +1,9 @@
+config VIDEO_SAMSUNG_S5P_CEC
+ 

Re: [GIT PULL FOR v4.8 v6] Add HDMI CEC framework

2016-06-28 Thread Mauro Carvalho Chehab
Em Sat, 25 Jun 2016 15:47:41 +0200
Hans Verkuil  escreveu:

> Hi Mauro,
> 
> Here is the pull request for the HDMI CEC framework. The code of this pull
> request is identical to the v19 patch series and is against the media_tree cec
> topic branch.
> 

...

>  create mode 100644 drivers/media/platform/s5p-cec/Makefile
>  create mode 100644 drivers/media/platform/s5p-cec/exynos_hdmi_cec.h
>  create mode 100644 drivers/media/platform/s5p-cec/exynos_hdmi_cecctrl.c
>  create mode 100644 drivers/media/platform/s5p-cec/regs-cec.h
>  create mode 100644 drivers/media/platform/s5p-cec/s5p_cec.c
>  create mode 100644 drivers/media/platform/s5p-cec/s5p_cec.h

It doesn't seem right to keep those CEC drivers outside staging, while
the core is at staging. I'll move them to staging. It would be nice
to get the ack from DT maintainers before moving the s5p_cec back
to platform.

So, I'm adding a patch to the series doing that. Please don't
forget to move it back to platform by the time you submit the
patches moving cec core out of staging.

>  create mode 100644 drivers/media/platform/vivid/vivid-cec.c
>  create mode 100644 drivers/media/platform/vivid/vivid-cec.h

If vivid were a real driver, I would require the same, but as
it is just a software testing driver, I won't care.


Thanks,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] v4l2-tpg: ignore V4L2_DV_RGB_RANGE setting for YUV formats

2016-06-28 Thread Hans Verkuil
The V4L2_DV_RGB_RANGE_* settings are, as the name says, for RGB formats only.
So they should be ignored for non-RGB formats.

Signed-off-by: Hans Verkuil 
---
diff --git a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c 
b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
index cf1dadd..3ec3ceb 100644
--- a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
+++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
@@ -777,7 +777,7 @@ static void precalculate_color(struct tpg_data *tpg, int k)
 * Remember that r, g and b are still in the 0 - 0xff0 range.
 */
if (tpg->real_rgb_range == V4L2_DV_RGB_RANGE_LIMITED &&
-   tpg->rgb_range == V4L2_DV_RGB_RANGE_FULL) {
+   tpg->rgb_range == V4L2_DV_RGB_RANGE_FULL && !tpg->is_yuv) {
/*
 * Convert from full range (which is what r, g and b are)
 * to limited range (which is the 'real' RGB range), which
@@ -787,7 +787,7 @@ static void precalculate_color(struct tpg_data *tpg, int k)
g = (g * 219) / 255 + (16 << 4);
b = (b * 219) / 255 + (16 << 4);
} else if (tpg->real_rgb_range != V4L2_DV_RGB_RANGE_LIMITED &&
-  tpg->rgb_range == V4L2_DV_RGB_RANGE_LIMITED) {
+  tpg->rgb_range == V4L2_DV_RGB_RANGE_LIMITED && !tpg->is_yuv) 
{
/*
 * Clamp r, g and b to the limited range and convert to full
 * range since that's what we deliver.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: s5p-mfc fix memory leak in s5p_mfc_remove()

2016-06-28 Thread Shuah Khan
On 06/28/2016 03:57 AM, Kamil Debski wrote:
> HI Shuah,
> 
> Which branch do you base your patches on?
> 
> I have trouble applying this path
> (https://patchwork.linuxtv.org/patch/34577/) and 
> "s5p-mfc fix null pointer deference in clk_core_enable()"
> (https://patchwork.linuxtv.org/patch/34751/) 
> onto current linuxtv/master.
> 
> The top commit of linuxtv/master is :
> "commit 0db5c79989de2c68d5abb7ba891bfdb3cd3b7e05
> Author: Mauro Carvalho Chehab 
> Date:   Thu Jun 16 08:04:40 2016 -0300
> 
> [media] media-devnode.h: Fix documentation"
> 
> Could you please rebase the two patches mentioned above to the
> linuxtv/master?
> 
> Best wishes,
> 

I based them on linux_next. I will rebase both patches on linuxtv/master
and resend.

thanks,
-- Shuah
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] v4l: ioctl: Clear the v4l2_pix_format_mplane reserved field

2016-06-28 Thread Laurent Pinchart
The S_FMT and TRY_FMT handlers in multiplane mode attempt at clearing
the reserved fields of the v4l2_format structure after the pix_mp
member. However, the reserved fields are inside pix_mp, not after it.

Signed-off-by: Laurent Pinchart 
---
 drivers/media/v4l2-core/v4l2-ioctl.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

Kieran, this should fix the v4l2-compliance failures you saw when not clearing
pix_mp.reserved manually in the FDP1 driver. Could you please test it ?

diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c 
b/drivers/media/v4l2-core/v4l2-ioctl.c
index 19d3aee3b374..86332072a575 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1508,7 +1508,7 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops,
case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
if (unlikely(!is_rx || !is_vid || 
!ops->vidioc_s_fmt_vid_cap_mplane))
break;
-   CLEAR_AFTER_FIELD(p, fmt.pix_mp);
+   CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
return ops->vidioc_s_fmt_vid_cap_mplane(file, fh, arg);
case V4L2_BUF_TYPE_VIDEO_OVERLAY:
if (unlikely(!is_rx || !is_vid || 
!ops->vidioc_s_fmt_vid_overlay))
@@ -1536,7 +1536,7 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops,
case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
if (unlikely(!is_tx || !is_vid || 
!ops->vidioc_s_fmt_vid_out_mplane))
break;
-   CLEAR_AFTER_FIELD(p, fmt.pix_mp);
+   CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
return ops->vidioc_s_fmt_vid_out_mplane(file, fh, arg);
case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
if (unlikely(!is_tx || !is_vid || 
!ops->vidioc_s_fmt_vid_out_overlay))
@@ -1598,7 +1598,7 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops,
case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
if (unlikely(!is_rx || !is_vid || 
!ops->vidioc_try_fmt_vid_cap_mplane))
break;
-   CLEAR_AFTER_FIELD(p, fmt.pix_mp);
+   CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
return ops->vidioc_try_fmt_vid_cap_mplane(file, fh, arg);
case V4L2_BUF_TYPE_VIDEO_OVERLAY:
if (unlikely(!is_rx || !is_vid || 
!ops->vidioc_try_fmt_vid_overlay))
@@ -1626,7 +1626,7 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops,
case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
if (unlikely(!is_tx || !is_vid || 
!ops->vidioc_try_fmt_vid_out_mplane))
break;
-   CLEAR_AFTER_FIELD(p, fmt.pix_mp);
+   CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
return ops->vidioc_try_fmt_vid_out_mplane(file, fh, arg);
case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
if (unlikely(!is_tx || !is_vid || 
!ops->vidioc_try_fmt_vid_out_overlay))
-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [media] rcar-csi2: add Renesas R-Car MIPI CSI-2 driver

2016-06-28 Thread Geert Uytterhoeven
Hi Niklas,

On Mon, Jun 27, 2016 at 7:45 PM, Niklas Söderlund
 wrote:
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/rcar-csi2.txt
> @@ -0,0 +1,79 @@
> +Renesas R-Car MIPI CSI-2 driver (rcar-csi2)
> +---
> +
> +The rcar-csi2 device provides MIPI CSI-2 capabilities for the Renesas R-Car
> +family of devices. It is to be used in conjunction with the rcar-vin driver 
> which
> +provides the video input capabilities.
> +
> + - compatible: Must be one or more of the following
> +   - "renesas,csi2-r8a7795" for the R8A7795 device

Please use "renesas,-" for new bindings, i.e.
"renesas,r8a7795-csi2".

> +   - "renesas,rcar-gen3-csi2" for a generic R-Car Gen3 compatible device.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Submit media entity without media device

2016-06-28 Thread Ramiro Oliveira
Hi all,

We at Synopsys have a media device driver and in that media device we have a
media entity for our CSI-2 Host.

At the moment we aren't ready to submit the entire media device, so I was
wondering if it was possible to submit a media entity driver separately, without
the rest of the architecture, and if so where should we place it.

Best Regards,

Ramiro Oliveira


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 2/2] Add support for Omnivision OV5647

2016-06-28 Thread Ramiro Oliveira
Signed-off-by: Ramiro Oliveira 
---
 MAINTAINERS|   7 +
 drivers/media/i2c/Kconfig  |  12 +
 drivers/media/i2c/Makefile |   1 +
 drivers/media/i2c/ov5647.c | 891 +
 4 files changed, 911 insertions(+)
 create mode 100644 drivers/media/i2c/ov5647.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 02299fd..58bd175 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8393,6 +8393,13 @@ M:   Harald Welte 
 S: Maintained
 F: drivers/char/pcmcia/cm4040_cs.*
 
+OMNIVISION OV5647 SENSOR DRIVER
+M: Ramiro Oliveira 
+L: linux-media@vger.kernel.org
+T: git git://linuxtv.org/media_tree.git
+S: Maintained
+F: drivers/media/i2c/ov5647.c
+
 OMNIVISION OV7670 SENSOR DRIVER
 M: Jonathan Corbet 
 L: linux-media@vger.kernel.org
diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index 993dc50..e0a4da5 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -500,6 +500,18 @@ config VIDEO_OV2659
  To compile this driver as a module, choose M here: the
  module will be called ov2659.
 
+config VIDEO_OV5647
+   tristate "OmniVision OV5647 sensor support"
+   depends on OF
+   depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+   depends on MEDIA_CAMERA_SUPPORT
+   ---help---
+ This is a Video4Linux2 sensor-level driver for the OmniVision
+ OV5647 camera.
+
+ To compile this driver as a module, choose M here: the
+ module will be called ov5647.
+
 config VIDEO_OV7640
tristate "OmniVision OV7640 sensor support"
depends on I2C && VIDEO_V4L2
diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile
index 94f2c99..a732a0c 100644
--- a/drivers/media/i2c/Makefile
+++ b/drivers/media/i2c/Makefile
@@ -80,3 +80,4 @@ obj-$(CONFIG_VIDEO_IR_I2C)  += ir-kbd-i2c.o
 obj-$(CONFIG_VIDEO_ML86V7667)  += ml86v7667.o
 obj-$(CONFIG_VIDEO_OV2659) += ov2659.o
 obj-$(CONFIG_VIDEO_TC358743)   += tc358743.o
+obj-$(CONFIG_VIDEO_OV5647) += ov5647.o
diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
new file mode 100644
index 000..ba9a874
--- /dev/null
+++ b/drivers/media/i2c/ov5647.c
@@ -0,0 +1,891 @@
+/*
+ * A V4L2 driver for OmniVision OV5647 cameras.
+ *
+ * Based on Samsung S5K6AAFX SXGA 1/6" 1.3M CMOS Image Sensor driver
+ * Copyright (C) 2011 Sylwester Nawrocki 
+ *
+ * Based on Omnivision OV7670 Camera Driver
+ * Copyright (C) 2006-7 Jonathan Corbet 
+ *
+ * Copyright (C) 2016, Synopsys, Inc.
+ *
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static bool debug;
+module_param(debug, bool, 0644);
+MODULE_PARM_DESC(debug, "Debug level (0-1)");
+
+/*
+ * The ov5647 sits on i2c with ID 0x6c
+ */
+#define OV5647_I2C_ADDR 0x6c
+#define SENSOR_NAME "ov5647"
+
+#define OV5647_REG_CHIPID_H0x300A
+#define OV5647_REG_CHIPID_L0x300B
+
+#define REG_TERM 0xfffe
+#define VAL_TERM 0xfe
+#define REG_DLY  0x
+
+/*define the voltage level of control signal*/
+#define CSI_STBY_ON1
+#define CSI_STBY_OFF   0
+#define CSI_RST_ON 0
+#define CSI_RST_OFF1
+#define CSI_PWR_ON 1
+#define CSI_PWR_OFF0
+#define CSI_AF_PWR_ON  1
+#define CSI_AF_PWR_OFF 0
+
+
+#define OV5647_ROW_START   0x01
+#define OV5647_ROW_START_MIN   0
+#define OV5647_ROW_START_MAX   2004
+#define OV5647_ROW_START_DEF   54
+
+#define OV5647_COLUMN_START0x02
+#define OV5647_COLUMN_START_MIN0
+#define OV5647_COLUMN_START_MAX2750
+#define OV5647_COLUMN_START_DEF16
+
+#define OV5647_WINDOW_HEIGHT   0x03
+#define OV5647_WINDOW_HEIGHT_MIN   2
+#define OV5647_WINDOW_HEIGHT_MAX   2006
+#define OV5647_WINDOW_HEIGHT_DEF   1944
+
+#define OV5647_WINDOW_WIDTH0x04
+#define OV5647_WINDOW_WIDTH_MIN2
+#define OV5647_WINDOW_WIDTH_MAX2752
+#define OV5647_WINDOW_WIDTH_DEF2592
+
+enum power_seq_cmd {
+   CSI_SUBDEV_PWR_OFF = 0x00,
+   CSI_SUBDEV_PWR_ON = 0x01,
+};
+
+struct regval_list {
+   uint16_t addr;
+   uint8_t data;
+};
+
+struct cfg_array {
+   struct regval_list *regs;
+   int size;
+};
+
+struct sensor_win_size {
+   int width;
+   int height;
+   unsigned int hoffset;
+   unsigned int voffset;
+   unsigned int hts;
+   unsigned int vts;
+   unsigned int pclk;
+   unsigned int mipi_bps;
+   unsigned int fps_fixed;
+   unsigned int bin_factor;
+   unsigned int intg_min;
+   unsigned int intg_max;
+   void *regs;
+   int regs_size;
+   int (*set_size)(struct v4l2_subdev *subdev);
+};
+
+
+struct ov5647 {
+   

[PATCH v2 0/2] OV5647 sensor driver

2016-06-28 Thread Ramiro Oliveira
Hello,

This patch adds support for the Omnivision OV5647 sensor.

At the moment it only supports 640x480 in Raw 8.

Ramiro Oliveira (2):
  Add OV5647 device tree documentation
  Add support for Omnivision OV5647

 .../devicetree/bindings/media/i2c/ov5647.txt   |  19 +
 MAINTAINERS|   7 +
 drivers/media/i2c/Kconfig  |  12 +
 drivers/media/i2c/Makefile |   1 +
 drivers/media/i2c/ov5647.c | 891 +
 5 files changed, 930 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ov5647.txt
 create mode 100644 drivers/media/i2c/ov5647.c

-- 
2.8.1


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL FOR v4.8] rcar-vin patches

2016-06-28 Thread Hans Verkuil
Try again, this time Cc-ed to Ulrich's correct email address.

Sorry Ulrich,

Hans

On 06/28/16 13:52, Hans Verkuil wrote:
> Updated these patches.
> 
> Ulrich, sorry, the compile error was my fault: I added these patches in the
> wrong order.
> 
> Regards,
> 
>   Hans
> 
> The following changes since commit 904aef0f9f6deff94223c0ce93eb598c47dd3aad:
> 
>   [media] v4l2-ctrl.h: fix comments (2016-06-28 08:07:04 -0300)
> 
> are available in the git repository at:
> 
>   git://linuxtv.org/hverkuil/media_tree.git for-v4.8c
> 
> for you to fetch changes up to e86f5324263ff8a3f1a49dbada27f076c4327005:
> 
>   media: rcar-vin: add DV timings support (2016-06-28 13:50:35 +0200)
> 
> 
> Ulrich Hecht (3):
>   media: rcar-vin: pad-aware driver initialisation
>   media: rcar_vin: Use correct pad number in try_fmt
>   media: rcar-vin: add DV timings support
> 
>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 112 
> ++---
>  drivers/media/platform/rcar-vin/rcar-vin.h  |   2 ++
>  2 files changed, 111 insertions(+), 3 deletions(-)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/2] solo6x10: Set FRAME_BUF_SIZE to 200KB

2016-06-28 Thread Hans Verkuil
On 06/28/16 13:48, Andrey Utkin wrote:
> On Mon, Jun 27, 2016 at 11:12:42AM +0200, Hans Verkuil wrote:
>> Andrey,
>>
>> Since you are the original author, can you give me your Signed-off-by line?
> 
> No, as increasing buffer size by few kilobytes doesn't change anything. I've
> increased it from 200 to 204, then found new occurances of the issue,
> then increased it again and again by few kilobytes. Then I got that this
> is not a (nice) solution, and have never came back to this. Maybe
> doubling current buffer size would make users forget about this, but I'm
> not sure maintainers would be glad with such patch.

I don't care. Right now it doesn't work. The cause is that the buffers are
too small to handle the worst-case situation. So if doubling the size makes
it work, then that's perfectly OK. Memory is cheap these days. If it will
fail, then that's much worse than consuming a few meg more.

Ideally you can calculate what the worst-case size is, but I expect that to
be quite difficult if not impossible.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 3/8] media: rcar_vin: Use correct pad number in try_fmt

2016-06-28 Thread Geert Uytterhoeven
Hi Mauro,

On Tue, Jun 28, 2016 at 1:32 PM, Mauro Carvalho Chehab
 wrote:
> Em Wed, 11 May 2016 16:02:51 +0200
> Ulrich Hecht  escreveu:
>
>> Fix rcar_vin_try_fmt's use of an inappropriate pad number when calling
>> the subdev set_fmt function - for the ADV7612, IDs should be non-zero.
>>
>> Signed-off-by: William Towle 
>> Reviewed-by: Rob Taylor 
>> Acked-by: Hans Verkuil 
>> [uli: adapted to rcar-vin rewrite]
>
> Please use [email@domain: some revierwer note], as stated at 
> Documentation/SubmittingPatches.

"While there is nothing mandatory about this, it
 seems like prepending the description with your mail and/or name, all
 enclosed in square brackets, is noticeable enough to make it obvious that
 you are responsible for last-minute changes."

Hence a name should be sufficient.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 1/2] Add OV5647 device tree documentation

2016-06-28 Thread Ramiro Oliveira
Signed-off-by: Ramiro Oliveira 
---
 .../devicetree/bindings/media/i2c/ov5647.txt  | 19 +++
 1 file changed, 19 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/ov5647.txt

diff --git a/Documentation/devicetree/bindings/media/i2c/ov5647.txt 
b/Documentation/devicetree/bindings/media/i2c/ov5647.txt
new file mode 100644
index 000..4c91b3b
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/ov5647.txt
@@ -0,0 +1,19 @@
+Omnivision OV5647 raw image sensor
+-
+
+OV5647 is a raw image sensor with MIPI CSI-2 and CCP2 image data interfaces
+and CCI (I2C compatible) control bus.
+
+Required properties:
+
+- compatible   : "ovti,ov5647";
+- reg  : I2C slave address of the sensor;
+
+The common video interfaces bindings (see video-interfaces.txt) should be
+used to specify link to the image data receiver. The OV5647 device
+node should contain one 'port' child node with an 'endpoint' subnode.
+
+Following properties are valid for the endpoint node:
+
+- data-lanes : (optional) specifies MIPI CSI-2 data lanes as covered in
+  video-interfaces.txt.  The sensor supports only two data lanes.
-- 
2.8.1


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL FOR v4.8] rcar-vin patches

2016-06-28 Thread Hans Verkuil
Updated these patches.

Ulrich, sorry, the compile error was my fault: I added these patches in the
wrong order.

Regards,

Hans

The following changes since commit 904aef0f9f6deff94223c0ce93eb598c47dd3aad:

  [media] v4l2-ctrl.h: fix comments (2016-06-28 08:07:04 -0300)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git for-v4.8c

for you to fetch changes up to e86f5324263ff8a3f1a49dbada27f076c4327005:

  media: rcar-vin: add DV timings support (2016-06-28 13:50:35 +0200)


Ulrich Hecht (3):
  media: rcar-vin: pad-aware driver initialisation
  media: rcar_vin: Use correct pad number in try_fmt
  media: rcar-vin: add DV timings support

 drivers/media/platform/rcar-vin/rcar-v4l2.c | 112 
++---
 drivers/media/platform/rcar-vin/rcar-vin.h  |   2 ++
 2 files changed, 111 insertions(+), 3 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/2] solo6x10: Set FRAME_BUF_SIZE to 200KB

2016-06-28 Thread Andrey Utkin
On Mon, Jun 27, 2016 at 11:12:42AM +0200, Hans Verkuil wrote:
> Andrey,
> 
> Since you are the original author, can you give me your Signed-off-by line?

No, as increasing buffer size by few kilobytes doesn't change anything. I've
increased it from 200 to 204, then found new occurances of the issue,
then increased it again and again by few kilobytes. Then I got that this
is not a (nice) solution, and have never came back to this. Maybe
doubling current buffer size would make users forget about this, but I'm
not sure maintainers would be glad with such patch.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL FOR v4.8] Various fixes

2016-06-28 Thread Mauro Carvalho Chehab
Em Mon, 27 Jun 2016 14:31:02 +0200
Hans Verkuil  escreveu:

> Note for Ulrich's patches: these are prerequisites for two other patch
> series (one from Ulrich for HDMI support and one from Niklas for Gen3
> support). It doesn't hurt to add these now, and it will simplify future
> development.
> 
> Regards,
> 
>   Hans
> 
> The following changes since commit 0db5c79989de2c68d5abb7ba891bfdb3cd3b7e05:
> 
>   [media] media-devnode.h: Fix documentation (2016-06-16 08:14:56 -0300)
> 
> are available in the git repository at:
> 
>   git://linuxtv.org/hverkuil/media_tree.git for-v4.8c
> 
> for you to fetch changes up to ad124b474f36aa0581ca46a5f609e7d8c7e0a5a6:
> 
>   media: rcar-vin: add DV timings support (2016-06-27 11:34:52 +0200)
> 
> 
> Alexey Khoroshilov (1):
>   radio-maxiradio: fix memory leak when device is removed
> 
> Hans Verkuil (1):
>   v4l2-ctrl.h: fix comments
> 
> Helen Fornazier (1):
>   stk1160: Check *nplanes in queue_setup
> 
> Ismael Luceno (1):
>   solo6x10: Simplify solo_enum_ext_input
> 


> Ulrich Hecht (3):
>   media: rcar_vin: Use correct pad number in try_fmt
>   media: rcar-vin: pad-aware driver initialisation
>   media: rcar-vin: add DV timings support

I'm not applying those three patches. The first one broke compilation.
Clearly, they weren't tested.

Please re-submit those three patches after fixing and testing them.

Regard

Thanks,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 3/8] media: rcar_vin: Use correct pad number in try_fmt

2016-06-28 Thread Mauro Carvalho Chehab
Em Wed, 11 May 2016 16:02:51 +0200
Ulrich Hecht  escreveu:

> Fix rcar_vin_try_fmt's use of an inappropriate pad number when calling
> the subdev set_fmt function - for the ADV7612, IDs should be non-zero.
> 
> Signed-off-by: William Towle 
> Reviewed-by: Rob Taylor 
> Acked-by: Hans Verkuil 
> [uli: adapted to rcar-vin rewrite]

Please use [email@domain: some revierwer note], as stated at 
Documentation/SubmittingPatches.

> Signed-off-by: Ulrich Hecht 

This patch breaks compilation:

drivers/media/platform/rcar-vin/rcar-v4l2.c: In function 
'__rvin_try_format_source':
drivers/media/platform/rcar-vin/rcar-v4l2.c:115:18: error: 'struct rvin_dev' 
has no member named 'src_pad_idx'
  format.pad = vin->src_pad_idx;
  ^~



> ---
>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 14 +++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
> b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> index 0bc4487..42dbd35 100644
> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> @@ -98,7 +98,7 @@ static int __rvin_try_format_source(struct rvin_dev *vin,
>   struct rvin_source_fmt *source)
>  {
>   struct v4l2_subdev *sd;
> - struct v4l2_subdev_pad_config pad_cfg;
> + struct v4l2_subdev_pad_config *pad_cfg;
>   struct v4l2_subdev_format format = {
>   .which = which,
>   };
> @@ -108,10 +108,16 @@ static int __rvin_try_format_source(struct rvin_dev 
> *vin,
>  
>   v4l2_fill_mbus_format(, pix, vin->source.code);
>  
> + pad_cfg = v4l2_subdev_alloc_pad_config(sd);
> + if (pad_cfg == NULL)
> + return -ENOMEM;
> +
> + format.pad = vin->src_pad_idx;
> +
>   ret = v4l2_device_call_until_err(sd->v4l2_dev, 0, pad, set_fmt,
> -  _cfg, );
> +  pad_cfg, );
>   if (ret < 0)
> - return ret;
> + goto cleanup;
>  
>   v4l2_fill_pix_format(pix, );
>  
> @@ -121,6 +127,8 @@ static int __rvin_try_format_source(struct rvin_dev *vin,
>   vin_dbg(vin, "Source resolution: %ux%u\n", source->width,
>   source->height);
>  
> +cleanup:
> + v4l2_subdev_free_pad_config(pad_cfg);
>   return 0;
>  }
>  



Thanks,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] media: s5p-mfc fix memory leak in s5p_mfc_remove()

2016-06-28 Thread Kamil Debski
HI Shuah,

Which branch do you base your patches on?

I have trouble applying this path
(https://patchwork.linuxtv.org/patch/34577/) and 
"s5p-mfc fix null pointer deference in clk_core_enable()"
(https://patchwork.linuxtv.org/patch/34751/) 
onto current linuxtv/master.

The top commit of linuxtv/master is :
"commit 0db5c79989de2c68d5abb7ba891bfdb3cd3b7e05
Author: Mauro Carvalho Chehab 
Date:   Thu Jun 16 08:04:40 2016 -0300

[media] media-devnode.h: Fix documentation"

Could you please rebase the two patches mentioned above to the
linuxtv/master?

Best wishes,
-- 
Kamil Debski
Samsung R Institute Poland


> -Original Message-
> From: Shuah Khan [mailto:shua...@osg.samsung.com]
> Sent: Monday, June 13, 2016 9:45 PM
> To: kyungmin.p...@samsung.com; k.deb...@samsung.com;
> jtp.p...@samsung.com; mche...@osg.samsung.com
> Cc: Shuah Khan; linux-arm-ker...@lists.infradead.org; linux-
> me...@vger.kernel.org; linux-ker...@vger.kernel.org
> Subject: [PATCH] media: s5p-mfc fix memory leak in s5p_mfc_remove()
> 
> s5p_mfc_remove() fails to release encoder and decoder video devices.
> 
> Signed-off-by: Shuah Khan 
> Reviewed-by: Javier Martinez Canillas 
> ---
> 
> Changes since v1:
> - Addressed comments from Javier Martinez Canillas and added
>   his reviewed by:
> 
>  drivers/media/platform/s5p-mfc/s5p_mfc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c
> b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> index 274b4f1..f537b74 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> @@ -1318,6 +1318,8 @@ static int s5p_mfc_remove(struct platform_device
> *pdev)
> 
>   video_unregister_device(dev->vfd_enc);
>   video_unregister_device(dev->vfd_dec);
> + video_device_release(dev->vfd_enc);
> + video_device_release(dev->vfd_dec);
>   v4l2_device_unregister(>v4l2_dev);
>   s5p_mfc_release_firmware(dev);
>   vb2_dma_contig_cleanup_ctx(dev->alloc_ctx[0]);
> --
> 2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html