Re: [PATCH 0/3] vimc: Allow multiple capture devices to use the same sensor

2019-10-23 Thread Niklas Söderlund
t; Regards, > > Hans > > On 5/18/19 3:07 AM, Niklas Söderlund wrote: > > Hi, > > > > This series adds support for two (or more) capture devices to be > > connected to the same senors and run simultaneously. Each capture device > > can be started a

Re: [PATCH 0/4] Add VIN/CSI-2 support

2019-10-20 Thread Niklas Söderlund
Hi Biju, Thanks for your work. On 2019-10-15 11:57:54 +0100, Biju Das wrote: > This patch series add VIN/CSI-2 driver support for RZ/G2N SoC. For the whole series, Reviewed-by: Niklas Söderlund > > Biju Das (4): > media: dt-bindings: rcar-vin: Add R8A774B1 support > med

[PATCH 3/3] staging/intel-ipu3: Make use of V4L2_CAP_IO_MC

2019-10-15 Thread Niklas Söderlund
Set the V4L2_CAP_IO_MC capability flag and remove the driver specific enum, get and set input callbacks. Signed-off-by: Niklas Söderlund --- drivers/staging/media/ipu3/ipu3-v4l2.c | 60 +- 1 file changed, 2 insertions(+), 58 deletions(-) diff --git a/drivers/staging

[PATCH 2/3] rcar-vin: Make use of V4L2_CAP_IO_MC

2019-10-15 Thread Niklas Söderlund
Set the V4L2_CAP_IO_MC capability flag and remove the driver specific enum, get and set input callbacks for the media controller enabled mode of the driver. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 17 + 1 file changed, 1 insertion(+), 16

[PATCH 0/3] v4l2-dev/ioctl: Add V4L2_CAP_IO_MC

2019-10-15 Thread Niklas Söderlund
hose. 1. https://patchwork.linuxtv.org/patch/41857/ Niklas Söderlund (3): v4l2-dev/ioctl: Add V4L2_CAP_IO_MC rcar-vin: Make use of V4L2_CAP_IO_MC staging/intel-ipu3: Make use of V4L2_CAP_IO_MC .../media/uapi/v4l/vidioc-querycap.rst| 3 + .../media/videodev2.h.rst.exceptions | 1 + drivers

[PATCH 1/3] v4l2-dev/ioctl: Add V4L2_CAP_IO_MC

2019-10-15 Thread Niklas Söderlund
: Helen Koike Signed-off-by: Niklas Söderlund --- .../media/uapi/v4l/vidioc-querycap.rst| 3 + .../media/videodev2.h.rst.exceptions | 1 + drivers/media/v4l2-core/v4l2-dev.c| 24 +++-- drivers/media/v4l2-core/v4l2-ioctl.c | 87 ++- include/uapi

[PATCH v2 1/2] rcar-vin: Define which hardware supports NV12

2019-10-13 Thread Niklas Söderlund
Most but not all Gen3 hardware support outputting NV12, add a flag to indicate which SoCs do support it. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-core.c | 6 ++ drivers/media/platform/rcar-vin/rcar-vin.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a

[PATCH v2 0/2] rcar-vin: Add support for outputting NV12

2019-10-13 Thread Niklas Söderlund
. While patch 2/2 is the real change adding the format and register writes to deliver NV12. Niklas Söderlund (2): rcar-vin: Define which hardware supports NV12 rcar-vin: Add support for outputting NV12 drivers/media/platform/rcar-vin/rcar-core.c | 6 drivers/media/platform/rcar-vin/rcar

[PATCH v2 2/2] rcar-vin: Add support for outputting NV12

2019-10-13 Thread Niklas Söderlund
Most Gen3 boards can output frames in NV12 format, add support for this with a runtime check that the running hardware supports it. Signed-off-by: Niklas Söderlund Reviewed-by: Simon Horman --- drivers/media/platform/rcar-vin/rcar-dma.c | 5 ++- drivers/media/platform/rcar-vin/rcar-v4l2.c

[PATCH v2] rcar-vin: Do not enumerate unsupported pixel formats

2019-10-13 Thread Niklas Söderlund
If a pixel format is not supported by the hardware NULL is returned by rvin_format_from_pixel() for that fourcc. Verify that the pixel format is supported using this or skip it when enumerating. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 20

[PATCH v2 0/2] rcar-vin: Support V4L2_FIELD_SEQ_{TB,BT}

2019-10-09 Thread Niklas Söderlund
for the two new field formats. Niklas Söderlund (2): rcar-vin: Move hardware buffer tracking to own struct rcar-vin: Add support for V4L2_FIELD_SEQ_{TB,BT} drivers/media/platform/rcar-vin/rcar-dma.c | 80 - drivers/media/platform/rcar-vin/rcar-v4l2.c | 7 +- drivers

[PATCH v2 1/2] rcar-vin: Move hardware buffer tracking to own struct

2019-10-09 Thread Niklas Söderlund
To support SEQ_TB/BT not all buffers given to the hardware will be equal, the driver needs to keep track of different buffer types. Move the tracking of buffers given to hardware into a struct so additional tracking fields can be associated with each buffer. Signed-off-by: Niklas Söderlund

[PATCH v2 2/2] rcar-vin: Add support for V4L2_FIELD_SEQ_{TB,BT}

2019-10-09 Thread Niklas Söderlund
The hardware does not support capturing the field types V4L2_FIELD_SEQ_TB and V4L2_FIELD_SEQ_BT. To capture in these formats the driver needs to adjust the offset of the capture buffer and capture twice to each vb2 buffer. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar

Re: [PATCH 1/2] rcar-vin: Define which hardware supports NV12

2019-10-08 Thread Niklas Söderlund
Hi Simon, Sorry for missing this mail. On 2019-09-08 13:20:59 +0100, Simon Horman wrote: > On Fri, Sep 06, 2019 at 04:40:28PM +0200, Niklas Söderlund wrote: > > Most but not all Gen3 boards support outputting NV12, add a flag to > > indicate which boards. > > > > Sign

[PATCH 0/2] rcar-vin: Cleanup how subdevice format is handled

2019-10-08 Thread Niklas Söderlund
Hi, This small series clean up how formats coming from the subdevice is handled inside the driver. The changes are made possible after recent VIN patches paved the way. There should not be any functional changes in this series. Niklas Söderlund (2): rcar-vin: Rename wrongly named rectangle

[PATCH 1/2] rcar-vin: Rename wrongly named rectangle

2019-10-08 Thread Niklas Söderlund
After recent refactoring the rectangle named crop no longer reflects it usage, to contain the source rectangle. Fix this by renaming it. There is no functional change. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 21 +++-- 1 file changed, 11

[PATCH 2/2] rcar-vin: Create compose rectangle where it is used

2019-10-08 Thread Niklas Söderlund
. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 25 + 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c index f809350c514c337c

[PATCH 0/2] rcar-vin: Add support for outputting NV12

2019-09-06 Thread Niklas Söderlund
. While patch 2/2 is the real change adding the format and register writes to deliver NV12. Niklas Söderlund (2): rcar-vin: Define which hardware supports NV12 rcar-vin: Add support for outputting NV12 drivers/media/platform/rcar-vin/rcar-core.c | 6 drivers/media/platform/rcar-vin/rcar

[PATCH 1/2] rcar-vin: Define which hardware supports NV12

2019-09-06 Thread Niklas Söderlund
Most but not all Gen3 boards support outputting NV12, add a flag to indicate which boards. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-core.c | 6 ++ drivers/media/platform/rcar-vin/rcar-vin.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/media

[PATCH 2/2] rcar-vin: Add support for outputting NV12

2019-09-06 Thread Niklas Söderlund
Most Gen3 boards can output frames in NV12 format, add support for this with a runtime check that the running hardware support it. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-dma.c | 5 ++- drivers/media/platform/rcar-vin/rcar-v4l2.c | 39 + 2

[PATCH] rcar-vin: Do not enumerate unsupported pixel formats

2019-09-06 Thread Niklas Söderlund
If a pixel format is not supported by the hardware NULL is returned by rvin_format_from_pixel() for that fourcc. Verify that the pixel format is supported using this or skip it when enumerating. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 12 +++- 1

[PATCH 1/2] rcar-vin: Move hardware buffer tracking to own struct

2019-09-05 Thread Niklas Söderlund
To support SEQ_TB/BT not all buffers given to the hardware will be equal, the driver needs to keep track of different buffer types. Move the tracking of buffers given to hardware into a struct so additional tracking fields can be associated with each buffer. Signed-off-by: Niklas Söderlund

[PATCH 2/2] rcar-vin: Add support for V4L2_FIELD_SEQ_{TB,BT}

2019-09-05 Thread Niklas Söderlund
The hardware do not support capturing the field types V4L2_FIELD_SEQ_TB and V4L2_FIELD_SEQ_BT. To capture in these formats the driver needs to adjust the offset of the capture buffer and capture twice to each vb2 buffer. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar

[PATCH 0/2] rcar-vin: Support V4L2_FIELD_SEQ_{TB,BT}

2019-09-05 Thread Niklas Söderlund
two new field formats. 1. [PATCH v3 0/6] rcar-vin: Add support for V4L2_FIELD_ALTERNATE Niklas Söderlund (2): rcar-vin: Move hardware buffer tracking to own struct rcar-vin: Add support for V4L2_FIELD_SEQ_{TB,BT} drivers/media/platform/rcar-vin/rcar-dma.c | 80 - drivers

[PATCH] rcar-vin: Use bytes per line instead of width for UV offset

2019-09-05 Thread Niklas Söderlund
The image size is doubled for NV16 and is calculated as bytesperline * height * 2 to accommodate the split of UV data. When writing the offset to hardware width is used instead of bytesperline, fix this. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-dma.c | 4 ++-- 1

[PATCH v3 1/6] rcar-vin: Fix incorrect return statement in rvin_try_format()

2019-09-04 Thread Niklas Söderlund
While refactoring code the return statement became corrupted, fix it by returning the correct return code. Reported-by: Kieran Bingham Fixes: 897e371389e77514 ("media: rcar-vin: simplify how formats are set and reset" Signed-off-by: Niklas Söderlund Reviewed-by: Lauren

[PATCH v3 0/6] rcar-vin: Add support for V4L2_FIELD_ALTERNATE

2019-09-04 Thread Niklas Söderlund
a requirement and removes a bit of ugly code as a result. Niklas Söderlund (6): rcar-vin: Fix incorrect return statement in rvin_try_format() rcar-vin: Make use of V4L2_FIELD_IS_INTERLACED() macro rcar-vin: Rename rectangle holding the video source information rcar-vin: Do not reset the

[PATCH v3 2/6] rcar-vin: Make use of V4L2_FIELD_IS_INTERLACED() macro

2019-09-04 Thread Niklas Söderlund
The V4L2_FIELD_IS_INTERLACED() can be used to make the code more readable, use it. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-dma.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform

[PATCH v3 3/6] rcar-vin: Rename rectangle holding the video source information

2019-09-04 Thread Niklas Söderlund
The variable to hold the video source information dimensions was poorly named 'source'. This is confusing as a lot of other members of structs share the same name with different purposes, rename it src_rect in preparation of refactoring code. Signed-off-by: Niklas Söderlund Reviewed-

[PATCH v3 4/6] rcar-vin: Do not reset the crop and compose rectangles in s_fmt

2019-09-04 Thread Niklas Söderlund
The crop and compose rectangles are reset when s_fmt is called resulting in potentially valid rectangles being lost when updating the format. Fix this by mapping the rectangles inside the new format. Signed-off-by: Niklas Söderlund Reviewed-by: Kieran Bingham --- drivers/media/platform/rcar

[PATCH v3 5/6] rcar-vin: Add support for V4L2_FIELD_ALTERNATE

2019-09-04 Thread Niklas Söderlund
interlaced frame. After this change the user can request to receive frames as alternate if the sensor provides it. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-dma.c | 43 + drivers/media/platform/rcar-vin/rcar-v4l2.c | 31 +++ 2 files

[PATCH v3 6/6] rcar-vin: Clean up how format is set on subdevice

2019-09-04 Thread Niklas Söderlund
With support for V4L2_FIELD_ALTERNATE added it's possible to clean up how formats are set on the subdevice. This makes the code easier to read as variable names now more clearly express their intent. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-v4l2.c

Re: [PATCH v2 3/6] rcar-vin: Rename rectangle holding the video source information

2019-09-04 Thread Niklas Söderlund
Hi Laurent, Thanks for your feedback. On 2019-08-08 11:30:45 +0300, Laurent Pinchart wrote: > Hi Niklas, > > Thank you for the patch. > > On Thu, Aug 08, 2019 at 03:18:47AM +0200, Niklas Söderlund wrote: > > The variable to hold the video source information dimensions

Re: [ANN] Topics for a media summit in Lyon in October

2019-09-03 Thread Niklas Söderlund
making the driver and userspace > >> implementations overly difficult and prone to repetitive mistakes, > >> - the above also limiting the flexibility of the API - formats, frame > >> rates, etc. set using distinct APIs, not covered by Request API, with > >> non-failure "negotiation hell", etc. > >> - lack of fences, etc. > >> > >> Jacopo: > >> > >> Apart from discussing libcamera and hope we could kickstart a review of > >> its API, I would like to re-start discussing multiplexed stream support, > >> but that would require Sakari to be there, something I'm not certain > >> about. Sakari? > >> > >> Alexandre: > >> > >> If Collabora/Bootlin is there, I'd certainly want to discuss stateless > >> codecs, in particular m2m codec helpers and finalize the specification > >> in general. > >> > >> Regards, > >> > >>Hans > >> > > > -- Regards, Niklas Söderlund

Re: [PATCH 2/2] max9286: Add MAX9286 driver

2019-08-09 Thread Niklas Söderlund
Hi Kieran, On 2019-08-09 13:12:49 +0100, Kieran Bingham wrote: > On 09/08/2019 13:04, Niklas Söderlund wrote: > > Hi Kieran, > > > > Thanks for your feedback. > > > > On 2019-08-09 09:09:43 +0100, Kieran Bingham wrote: > >> Hi Niklas, > >> >

Re: [PATCH 2/2] max9286: Add MAX9286 driver

2019-08-09 Thread Niklas Söderlund
s to clean up notifiers and unified naming of the private data structure. -- Regards, Niklas Söderlund

[PATCH 0/2] max9286: Add MAX9286 driver with single camera support

2019-08-08 Thread Niklas Söderlund
. Laurent Pinchart (1): dt-bindings: media: i2c: Add bindings for Maxim Integrated MAX9286 Niklas Söderlund (1): max9286: Add MAX9286 driver .../bindings/media/i2c/maxim,max9286.txt | 182 +++ MAINTAINERS | 10 + drivers/media/i2c/Kconfig

[PATCH 1/2] dt-bindings: media: i2c: Add bindings for Maxim Integrated MAX9286

2019-08-08 Thread Niklas Söderlund
Söderlund Signed-off-by: Niklas Söderlund --- .../bindings/media/i2c/maxim,max9286.txt | 182 ++ 1 file changed, 182 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/i2c/maxim,max9286.txt diff --git a/Documentation/devicetree/bindings/media/i2c/maxim

[PATCH 2/2] max9286: Add MAX9286 driver

2019-08-08 Thread Niklas Söderlund
: Jacopo Mondi Signed-off-by: Kieran Bingham Signed-off-by: Laurent Pinchart Signed-off-by: Niklas Söderlund --- MAINTAINERS | 10 + drivers/media/i2c/Kconfig | 11 + drivers/media/i2c/Makefile |1 + drivers/media/i2c/max9286.c | 1081

Re: [PATCH v2 4/6] rcar-vin: Do not reset the crop and compose rectangles in s_fmt

2019-08-08 Thread Niklas Söderlund
Hi Laurent, Thanks for your feedback. On 2019-08-08 11:37:51 +0300, Laurent Pinchart wrote: > Hi Niklas, > > Thank you for the patch. > > On Thu, Aug 08, 2019 at 03:18:48AM +0200, Niklas Söderlund wrote: > > The crop and compose rectangles are reset when s_fmt is ca

[PATCH] rcar-vin: Report correct image stride

2019-08-07 Thread Niklas Söderlund
The image stride was adjusted when it was written to hardware and not when configuring the format. Calculate the correct stride value and report it to userspace. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-dma.c | 10 ++ drivers/media/platform/rcar-vin/rcar

[PATCH v2 4/6] rcar-vin: Do not reset the crop and compose rectangles in s_fmt

2019-08-07 Thread Niklas Söderlund
The crop and compose rectangles are reset when s_fmt is called resulting in potentially valid rectangles being lost when updating the format. Fix this by mapping the rectangles inside the new format. Signed-off-by: Niklas Söderlund Reviewed-by: Kieran Bingham --- drivers/media/platform/rcar

[PATCH v2 3/6] rcar-vin: Rename rectangle holding the video source information

2019-08-07 Thread Niklas Söderlund
The variable to hold the video source information dimensions was poorly named 'source'. This is confusing as a lot of other members of structs share the same name with different purposes, rename it src_rect in preparation of refactoring code. Signed-off-by: Niklas Söderlund Reviewed-

[PATCH v2 0/6] rcar-vin: Add support for V4L2_FIELD_ALTERNATE

2019-08-07 Thread Niklas Söderlund
longer a requirement and removes a bit of ugly code as a result. Niklas Söderlund (6): rcar-vin: Fix incorrect return statement in rvin_try_format() rcar-vin: Make use of V4L2_FIELD_IS_INTERLACED() macro rcar-vin: Rename rectangle holding the video source information rcar-vin: Do not reset

[PATCH v2 1/6] rcar-vin: Fix incorrect return statement in rvin_try_format()

2019-08-07 Thread Niklas Söderlund
While refactoring code the return statement became corrupted, fix it by returning the correct return code. Reported-by: Kieran Bingham Fixes: 897e371389e77514 ("media: rcar-vin: simplify how formats are set and reset" Signed-off-by: Niklas Söderlund --- drivers/media/platform/rca

[PATCH v2 6/6] rcar-vin: Clean up how format is set on subdevice

2019-08-07 Thread Niklas Söderlund
With support for V4L2_FIELD_ALTERNATE added it's possible to clean up how formats are set on the subdevice. This makes the code easier to read as variable names now more clearly express their intent. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-v4l2.c

[PATCH v2 5/6] rcar-vin: Add support for V4L2_FIELD_ALTERNATE

2019-08-07 Thread Niklas Söderlund
interlaced frame. After this change the user can request to receive frames as alternate if the sensor provides it. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-dma.c | 43 + drivers/media/platform/rcar-vin/rcar-v4l2.c | 31 +++ 2 files

[PATCH v2 2/6] rcar-vin: Make use of V4L2_FIELD_IS_INTERLACED() macro

2019-08-07 Thread Niklas Söderlund
The V4L2_FIELD_IS_INTERLACED() can be used to make the code more readable, use it. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-dma.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers

[PATCH v3] dt-bindings: rcar-{csi2,vin}: Rename bindings documentation files

2019-08-07 Thread Niklas Söderlund
Renesas media binding documentation files uses a naming schema of 'renesas,.txt'. Rename VIN and CSI-2 files to match this pattern. Signed-off-by: Niklas Söderlund Reviewed-by: Geert Uytterhoeven Reviewed-by: Ulrich Hecht Reviewed-by: Simon Horman --- .../media/{renesas,rca

Re: [PATCH 3/4] rcar-vin: Add support for V4L2_FIELD_ALTERNATE

2019-08-07 Thread Niklas Söderlund
HI Kieran, Thanks for your review! On 2019-07-19 12:13:30 +0100, Kieran Bingham wrote: > Hi Niklas, > > On 05/07/2019 05:55, Niklas Söderlund wrote: > > The hardware is capable to passing V4L2_FIELD_ALTERNATE to user-space. > > Allow users to request this field format but s

Re: [PATCH] dt-bindings: rcar-imr: Rename bindings documentation file

2019-07-29 Thread Niklas Söderlund
Hi Simon, Thanks for your work. On 2019-07-29 09:47:57 +0200, Simon Horman wrote: > Renesas media binding documentation files uses a naming schema of > 'renesas,.txt'. Rename IMR file to match this pattern. > > Cc: Niklas Söderlund > Signed-off-by: Simon Horman Revi

Re: [PATCH v2] dt-bindings: rcar-{csi2,vin}: Rename bindings documentation files

2019-07-29 Thread Niklas Söderlund
Hi, On 2019-07-29 09:43:55 +0200, Simon Horman wrote: > On Fri, Jul 12, 2019 at 04:17:03PM +0900, Niklas Söderlund wrote: > > Hi, > > > > A gentle ping on this patch. I assume if it could get a ack from Rob it > > could be taken in thru the media-tree? > > Give

Re: [PATCH v2] dt-bindings: rcar-{csi2,vin}: Rename bindings documentation files

2019-07-12 Thread Niklas Söderlund
Hi, A gentle ping on this patch. I assume if it could get a ack from Rob it could be taken in thru the media-tree? On 2019-06-12 23:12:41 +0200, Niklas Söderlund wrote: > Renesas media binding documentation files uses a naming schema of > 'renesas,.txt'. Rename VIN and CSI-2 fil

Re: [PATCH 3/3] vimc: Join pipeline if one already exists

2019-07-10 Thread Niklas Söderlund
Hi Helen, Thanks for your feedback. On 2019-07-09 15:24:10 -0300, Helen Koike wrote: > Hi Niklas, > > Thanks for the patch (and sorry for my late reply). > > On 5/17/19 10:07 PM, Niklas Söderlund wrote: > > A sensor which is running is already part of a pipeline and tryi

[PATCH 0/4] rcar-vin: Add support for V4L2_FIELD_ALTERNATE

2019-07-04 Thread Niklas Söderlund
. Niklas Söderlund (4): rcar-vin: Rename rectangle holding holding the video source information rcar-vin: Do not reset the crop and compose rectangles in s_fmt rcar-vin: Add support for V4L2_FIELD_ALTERNATE rcar-vin: Clean up how format is set on subdevice drivers/media/platform/rcar-vin

[PATCH 3/4] rcar-vin: Add support for V4L2_FIELD_ALTERNATE

2019-07-04 Thread Niklas Söderlund
The hardware is capable to passing V4L2_FIELD_ALTERNATE to user-space. Allow users to request this field format but still default to using the hardware interlacer if alternating is not explicitly requested. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-dma.c | 54

[PATCH 1/4] rcar-vin: Rename rectangle holding holding the video source information

2019-07-04 Thread Niklas Söderlund
The variable to hold the video source information dimensions was poorly named 'source'. This is confusing as a lot of other members of struts share the same name with different purposes, rename it src_rect in preparation of refactoring code. Signed-off-by: Niklas Söderlund --- dri

[PATCH 4/4] rcar-vin: Clean up how format is set on subdevice

2019-07-04 Thread Niklas Söderlund
With support for V4L2_FIELD_ALTERNATE added it's possible to clean up how formats are set on the subdevice. This makes the code easier to read as variable names now more clearly express their intent. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-v4l2.c

[PATCH 2/4] rcar-vin: Do not reset the crop and compose rectangles in s_fmt

2019-07-04 Thread Niklas Söderlund
The crop and compose rectangles where reset when s_fmt was called resulting in potentially valid rectangles where lost when updating the format. Fix this by instead trying to map the rectangles inside the new format. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-v4l2

[PATCH] rcar-vin: Centralize black listing of pixel formats

2019-07-04 Thread Niklas Söderlund
Instead of scattering black listing of pixel formats who are not supported on particular platforms move it to a central location. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-dma.c | 2 +- drivers/media/platform/rcar-vin/rcar-v4l2.c | 23

[PATCH v4 1/4] rcar-vin: Rename VNDMR_DTMD_ARGB1555 to VNDMR_DTMD_ARGB

2019-07-04 Thread Niklas Söderlund
The value have nothing to do with ARGB1555, it controls if the alpha component should be filled in for ARGB1555 or ARGB888. Rename it to reflect this. Signed-off-by: Niklas Söderlund Reviewed-by: Ulrich Hecht Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- drivers/media

[PATCH v4 0/4] rcar-vin: Add support for RGB formats with alpha component

2019-07-04 Thread Niklas Söderlund
the media controller centric Gen3 mode of the driver. Niklas Söderlund (4): rcar-vin: Rename VNDMR_DTMD_ARGB1555 to VNDMR_DTMD_ARGB rcar-vin: Add control for alpha component rcar-vin: Add support for RGB formats with alpha component rcar-vin: Always setup controls when opening video

[PATCH v4 3/4] rcar-vin: Add support for RGB formats with alpha component

2019-07-04 Thread Niklas Söderlund
The R-Car VIN module supports V4L2_PIX_FMT_ARGB555 and V4L2_PIX_FMT_ABGR32 pixel formats. Add the hardware register setup and allow the alpha component to be changed while streaming using the V4L2_CID_ALPHA_COMPONENT control. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart

[PATCH v4 2/4] rcar-vin: Add control for alpha component

2019-07-04 Thread Niklas Söderlund
In preparation to adding support for RGB pixel formats with an alpha component add a control to allow the user to control which alpha value should be used. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- drivers/media/platform/rcar-vin/rcar-core.c

[PATCH v4 4/4] rcar-vin: Always setup controls when opening video device

2019-07-04 Thread Niklas Söderlund
Now that both Gen2 (video device centric) and Gen3 (media device centric) modes of the driver have controls it is required to always setup the controls when opening the devices. Remove the check which only calls v4l2_ctrl_handler_setup() for Gen2 and call it unconditionally. Signed-off-by: Niklas

Re: [PATCH v3 2/4] rcar-vin: Add control for alpha component

2019-07-04 Thread Niklas Söderlund
Hi Kieran, Thanks for your feedback. On 2019-07-04 16:15:54 +0100, Kieran Bingham wrote: > Hi Niklas, > > On 04/07/2019 02:58, Niklas Söderlund wrote: > > In preparation to adding support for RGB pixel formats with an alpha > > component add a control to allow the user t

[PATCH v3 4/4] rcar-vin: Always setup controls when opening video device

2019-07-03 Thread Niklas Söderlund
Now that both Gen2 (device centric) and Gen3 (media device centric) modes of this driver have controls it make sens to call v4l2_ctrl_handler_setup() unconditionally when opening the video device. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 30

[PATCH v3 3/4] rcar-vin: Add support for RGB formats with alpha component

2019-07-03 Thread Niklas Söderlund
The R-Car VIN module supports V4L2_PIX_FMT_ARGB555 and V4L2_PIX_FMT_ABGR32 pixel formats. Add the hardware register setup and allow the alpha component to be changed while streaming using the V4L2_CID_ALPHA_COMPONENT control. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin

[PATCH v3 0/4] rcar-vin: Add support for RGB formats with alpha

2019-07-03 Thread Niklas Söderlund
() should be called for both cases. * Changes since v2 - Protect the writing of the alpha value when streaming with the spin lock to make sure the streaming state is stable. - Add patch 4/4 to call v4l2_ctrl_handler_setup() for the media controller centric Gen3 mode of the driver. Niklas

[PATCH v3 1/4] rcar-vin: Rename VNDMR_DTMD_ARGB1555 to VNDMR_DTMD_ARGB

2019-07-03 Thread Niklas Söderlund
The value have nothing to do with ARGB1555, it controls if the alpha component should be filled in for ARGB1555 or ARGB888. Rename it to reflect this. Signed-off-by: Niklas Söderlund Reviewed-by: Ulrich Hecht Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-dma.c | 4

[PATCH v3 2/4] rcar-vin: Add control for alpha component

2019-07-03 Thread Niklas Söderlund
In preparation to adding support for RGB pixel formats with an alpha component add a control to allow the user to control which alpha value should be used. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-core.c | 53

Re: [PATCH 0/2] Use Media Dev Allocator to fix vimc dev lifetime bugs

2019-07-03 Thread Niklas Söderlund
ocator, which I > have pointed out numerous times and has never been addressed (and which > explains why I didn't think the code was ready to be merged) is that the > media_device contains operations that are based on having a single > driver controlling the media device. A proper shared media device > allocator needs to drop the concept of a single master for the media > device, and thus needs to refactor those operations to allow any user of > the media device to implement them (the .link_notify() operation is a > prime example, and the recently added request operations will make this > even more challenging - think of how this patch series would prevent > vimc from properly implementing the request API). As long as these issue > are not fixed I will be firmly opposed to spreading the usage of the > media device allocator beyond what exists today. > > > Collapsing the drivers into one might be lot more difficult and complex > > than solving this problem with Media Device Allocator API. This approach > > has an added benefit of extending the API to be generic and not just for > > USB. > > I've never disputed the fact that fixing a problem correctly is usually > more work than hacking around it :-) > > > I looked at this as a good way to add generic API and have a great test > > case for it. This patch series fixes the problem for the current vimc > > architecture. > > NAK, for the reasons above. Please drop this series and fix the problem > properly. > > -- > Regards, > > Laurent Pinchart -- Regards, Niklas Söderlund

[PATCH v2] rcar-vin: Clean up correct notifier in error path

2019-07-02 Thread Niklas Söderlund
The parallel input initialization error path cleans up the wrong async notifier, fix this by cleaning up the correct notifier. Fixes: 9863bc8695bc36e3 ("media: rcar-vin: Cleanup notifier in error path") Signed-off-by: Niklas Söderlund Reviewed-by: Jacopo Mondi Tested-by: Geert Uy

Re: [PATCH] rcar-vin: Clean up correct notifier in error path

2019-07-02 Thread Niklas Söderlund
Hi Geert, On 2019-07-02 13:42:44 +0200, Geert Uytterhoeven wrote: > Hi Niklas, > > On Tue, Jul 2, 2019 at 3:25 AM Niklas Söderlund > wrote: > > When adding the v4l2_async_notifier_cleanup() callas the wrong notifier > > was cleaned up if the parallel notifier registra

[PATCH] rcar-vin: Clean up correct notifier in error path

2019-07-01 Thread Niklas Söderlund
When adding the v4l2_async_notifier_cleanup() callas the wrong notifier was cleaned up if the parallel notifier registration failed. Fix this by cleaning up the correct one. Fixes: 9863bc8695bc36e3 ("media: rcar-vin: Cleanup notifier in error path") Signed-off-by: Niklas Söderlund --

Re: [PATCH for v5.3] v4l2-subdev: fix regression in check_pad()

2019-06-29 Thread Niklas Söderlund
instead since that doesn't depend > on mdev. > > Signed-off-by: Hans Verkuil > Reported-by: Niklas Söderlund > Fixes: a8fa55078a77 ("media: v4l2-subdev: Verify arguments in > v4l2_subdev_call()") This fixes my problem, Tested-by: Niklas Söderlund > --- >

Re: [PATCH v2 2/9] v4l2-async: Use endpoint node, not device node, for fwnode match

2019-06-21 Thread Niklas Söderlund
Hi Jacopo, On 2019-06-21 11:19:27 +0200, Jacopo Mondi wrote: > Hi Niklas, > > On Fri, Jun 14, 2019 at 11:21:05PM +0200, Niklas Söderlund wrote: > > Hi Sakari, > > > > Thanks for your work and sorry that I missed this and replied to v1 the > > other day. I have t

Re: [PATCH v2 3/3] rcar-vin: Add support for RGB formats with alpha component

2019-06-17 Thread Niklas Söderlund
Hi Laurent, Thanks for your feedback. On 2019-06-17 17:33:41 +0300, Laurent Pinchart wrote: > Hi Niklas, > > Thank you for the patch. > > On Thu, Jun 13, 2019 at 02:04:39AM +0200, Niklas Söderlund wrote: > > The R-Car VIN module supports V4L2_PIX_FMT_ARGB555 and > >

Re: [PATCH v2 2/9] v4l2-async: Use endpoint node, not device node, for fwnode match

2019-06-14 Thread Niklas Söderlund
@@ static int soc_of_bind(struct soc_camera_host *ici, > struct soc_camera_async_client *sasc; > struct soc_of_info *info; > struct i2c_client *client; > + struct device_node *np; > char clk_name[V4L2_CLK_NAME_SIZE]; > int ret; > > @@ -1548,23 +1549,23 @@ static int soc_of_bind(struct soc_camera_host *ici, > v4l2_async_notifier_init(&sasc->notifier); > > ret = v4l2_async_notifier_add_subdev(&sasc->notifier, info->subdev); > - if (ret) { > - of_node_put(remote); > + if (ret) > goto eaddasd; > - } > > sasc->notifier.ops = &soc_camera_async_ops; > > icd->sasc = sasc; > icd->parent = ici->v4l2_dev.dev; > + np = of_graph_get_port_parent(remote); > + of_node_put(remote); > > - client = of_find_i2c_device_by_node(remote); > + client = of_find_i2c_device_by_node(np); > > if (client) > v4l2_clk_name_i2c(clk_name, sizeof(clk_name), > client->adapter->nr, client->addr); > else > - v4l2_clk_name_of(clk_name, sizeof(clk_name), remote); > + v4l2_clk_name_of(clk_name, sizeof(clk_name), np); > > icd->clk = v4l2_clk_register(&soc_camera_clk_ops, clk_name, icd); > if (IS_ERR(icd->clk)) { > @@ -1587,6 +1588,7 @@ static int soc_of_bind(struct soc_camera_host *ici, > eallocpdev: > devm_kfree(ici->v4l2_dev.dev, info); > dev_err(ici->v4l2_dev.dev, "group probe failed: %d\n", ret); > + of_node_put(np); > > return ret; > } > @@ -1603,7 +1605,7 @@ static void scan_of_host(struct soc_camera_host *ici) > if (!epn) > break; > > - rem = of_graph_get_remote_port_parent(epn); > + rem = of_graph_get_remote_endpoint(epn); > if (!rem) { > dev_notice(dev, "no remote for %pOF\n", epn); > continue; > -- > 2.11.0 > -- Regards, Niklas Söderlund

[PATCH v3 1/8] rcar-vin: Do not call pm_runtime_{resume,suspend}()

2019-06-13 Thread Niklas Söderlund
The driver does not implement runtime resume and suspend function so there is little point in trying to call them. This is a leftover from the drivers soc_camera beginnings. Signed-off-by: Niklas Söderlund Reviewed-by: Ulrich Hecht --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 5 - 1

[PATCH v3 2/8] rcar-vin: Remove unneeded calls to pm_runtime_{enable,disable}

2019-06-13 Thread Niklas Söderlund
Runtime PM is already enabled unconditionally when the driver is probed and disabled when it's removed. There is no point in doing it again for Gen2 when opening and closing the video device. Signed-off-by: Niklas Söderlund Reviewed-by: Ulrich Hecht --- drivers/media/platform/rcar-vin

[PATCH v3 5/8] rcar-vin: Move pm_runtime_{get,put} out of helpers

2019-06-13 Thread Niklas Söderlund
The helpers rvin_power_{on,off} deal with both VIN and the parallel subdevice power. This makes it hard to merge the Gen2 and Gen3 open/release functions. Move the VIN power handling directly to the open/release functions to prepare for the merge. Signed-off-by: Niklas Söderlund Reviewed-by

[PATCH v3 4/8] rcar-vin: Do not sync subdevice format when opening the video device

2019-06-13 Thread Niklas Söderlund
The format is already synced when the subdevice is bound, there is no need to do do it every time the video device is opened. Signed-off-by: Niklas Söderlund Reviewed-by: Ulrich Hecht Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 25 - 1

[PATCH v3 0/8] rcar-vin: Merge Gen2 and Gen3 file operations

2019-06-13 Thread Niklas Söderlund
controller way of looking at things ;-) After refactoring out a lot of code left over from the Gen2 mode which stems from the drivers origin in soc_camera it became apparent that a lot of code could me removed by merging the two sets. Tested on both Gen2 and Gen3 no regressions found. Niklas

[PATCH v3 8/8] rcar-vin: Merge Gen2 and Gen3 file operations

2019-06-13 Thread Niklas Söderlund
After the rework of the Gen2 file operations it's now trivial to merge the Gen2 and Gen3 versions. Signed-off-by: Niklas Söderlund Reviewed-by: Ulrich Hecht --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 100 1 file changed, 18 insertions(+), 82 deletions(-) diff

[PATCH v3 7/8] rcar-vin: Fold rvin_initialize_device() into rvin_open()

2019-06-13 Thread Niklas Söderlund
The function no longer serve a purpose as most tasks it performed have been refactored, fold what remains of it into the only caller. While at it add error checking for v4l2_ctrl_handler_setup(). Signed-off-by: Niklas Söderlund Reviewed-by: Ulrich Hecht --- drivers/media/platform/rcar-vin/rcar

[PATCH v3 6/8] rcar-vin: Merge helpers dealing with powering the parallel subdevice

2019-06-13 Thread Niklas Söderlund
The two power helpers are now only dealing with the parallel subdevice, merge them into a single rvin_power_parallel() helper to reduce code duplication. Signed-off-by: Niklas Söderlund Reviewed-by: Ulrich Hecht Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-v4l2.c

[PATCH v3 3/8] rcar-vin: Allow interrupting lock when trying to open the video device

2019-06-13 Thread Niklas Söderlund
The user should be allowed to break waiting for the lock when opening the video device. Signed-off-by: Niklas Söderlund Reviewed-by: Ulrich Hecht Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH v2 1/3] rcar-vin: Rename VNDMR_DTMD_ARGB1555 to VNDMR_DTMD_ARGB

2019-06-13 Thread Niklas Söderlund
The value have nothing to do with ARGB1555, it controls if the alpha component should be filled in for ARGB1555 or ARGB888. Rename it to reflect this. Signed-off-by: Niklas Söderlund Reviewed-by: Ulrich Hecht Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-dma.c | 4

[PATCH v2 3/3] rcar-vin: Add support for RGB formats with alpha component

2019-06-13 Thread Niklas Söderlund
The R-Car VIN module supports V4L2_PIX_FMT_ARGB555 and V4L2_PIX_FMT_ABGR32 pixel formats. Add the hardware register setup and allow the alpha component to be changed while streaming using the V4L2_CID_ALPHA_COMPONENT control. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin

[PATCH v2 2/3] rcar-vin: Add control for alpha component

2019-06-13 Thread Niklas Söderlund
In preparation to adding support for RGB pixel formats with an alpha component add a control to allow the user to control which alpha value should be used. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-core.c | 53

[PATCH v2 0/3] rcar-vin: Add support for RGB formats with alpha component

2019-06-13 Thread Niklas Söderlund
-tree and is tested on both Renesas Gen2 and Gen3 hardware without any regressions found. Patch 1/3 fixes a badly named register name, 2/3 adds the new control and finally 3/3 adds the two new pixel formats. Niklas Söderlund (3): rcar-vin: Rename VNDMR_DTMD_ARGB1555 to VNDMR_DTMD_ARGB rcar-vin

Re: [PATCH 2/9] v4l2-async: Use endpoint node, not device node, for fwnode match

2019-06-13 Thread Niklas Söderlund
name[V4L2_CLK_NAME_SIZE]; > int ret; > > @@ -1552,23 +1553,23 @@ static int soc_of_bind(struct soc_camera_host *ici, > v4l2_async_notifier_init(&sasc->notifier); > > ret = v4l2_async_notifier_add_subdev(&sasc->notifier, info->subdev); > - if (ret) { > - of_node_put(remote); > + if (ret) > goto eaddasd; > - } > > sasc->notifier.ops = &soc_camera_async_ops; > > icd->sasc = sasc; > icd->parent = ici->v4l2_dev.dev; > + np = of_graph_get_port_parent(remote); > + of_node_put(remote); > > - client = of_find_i2c_device_by_node(remote); > + client = of_find_i2c_device_by_node(np); > > if (client) > v4l2_clk_name_i2c(clk_name, sizeof(clk_name), > client->adapter->nr, client->addr); > else > - v4l2_clk_name_of(clk_name, sizeof(clk_name), remote); > + v4l2_clk_name_of(clk_name, sizeof(clk_name), np); > > icd->clk = v4l2_clk_register(&soc_camera_clk_ops, clk_name, icd); > if (IS_ERR(icd->clk)) { > @@ -1591,6 +1592,7 @@ static int soc_of_bind(struct soc_camera_host *ici, > eallocpdev: > devm_kfree(ici->v4l2_dev.dev, info); > dev_err(ici->v4l2_dev.dev, "group probe failed: %d\n", ret); > + of_node_put(np); > > return ret; > } > @@ -1607,7 +1609,7 @@ static void scan_of_host(struct soc_camera_host *ici) > if (!epn) > break; > > - rem = of_graph_get_remote_port_parent(epn); > + rem = of_graph_get_remote_endpoint(epn); > if (!rem) { > dev_notice(dev, "no remote for %pOF\n", epn); > continue; > -- > 2.11.0 > -- Regards, Niklas Söderlund

[PATCH v2] dt-bindings: rcar-{csi2,vin}: Rename bindings documentation files

2019-06-12 Thread Niklas Söderlund
Renesas media binding documentation files uses a naming schema of 'renesas,.txt'. Rename VIN and CSI-2 files to match this pattern. Signed-off-by: Niklas Söderlund Reviewed-by: Geert Uytterhoeven Reviewed-by: Ulrich Hecht --- .../media/{renesas,rcar-csi2.txt => renesas,csi2.txt

[PATCH 2/3] vimc: Serialize vimc_streamer_s_stream()

2019-05-17 Thread Niklas Söderlund
they are being started and stopped at the same time, prevent this by serializing starting and stopping of the vimc streamer. Signed-off-by: Niklas Söderlund --- drivers/media/platform/vimc/vimc-streamer.c | 23 ++--- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a

[PATCH 0/3] vimc: Allow multiple capture devices to use the same sensor

2019-05-17 Thread Niklas Söderlund
/dev/video0 --capture=100 wait >>> end test <<< In addition to testing with this test the series is tested with multiple qv4l2 instances controlling different capture devices connected to the same sensor. Niklas Söderlund (3): vimc: Add usage count to su

[PATCH 1/3] vimc: Add usage count to subdevices

2019-05-17 Thread Niklas Söderlund
0 (stopped). This allow for multiple s_stream() calls to try to either start or stop the device while only the first/last call will actually effect the state of the device. Signed-off-by: Niklas Söderlund --- drivers/media/platform/vimc/vimc-debayer.c | 8 drivers/media/platform/vimc

[PATCH 3/3] vimc: Join pipeline if one already exists

2019-05-17 Thread Niklas Söderlund
pipeline by looking it up at the sensor. This allows two (or more) capture devices to independently be started and stopped while still being connected to the same sensor. Signed-off-by: Niklas Söderlund --- drivers/media/platform/vimc/vimc-capture.c | 35 +- 1 file changed, 34

[PATCH] vimc: Remove unneeded return statement in vimc_sen_s_stream()

2019-05-17 Thread Niklas Söderlund
The other subdevice implementations in vimc (debayer and scaler) which share there code structure with the sensor does not have an explicit return statement at the end of the s_stream(0) code path. Align the sensor subdevices by dropping the return statement. Signed-off-by: Niklas Söderlund

Re: [PATCH v2 4/8] rcar-vin: Do not sync subdevice format when opening the video device

2019-05-16 Thread Niklas Söderlund
Hi Laurent, Thanks for your feedback. On 2019-05-16 14:26:44 +0300, Laurent Pinchart wrote: > Hi Niklas, > > Thank you for the patch. > > On Thu, May 16, 2019 at 03:14:13AM +0200, Niklas Söderlund wrote: > > The format is already synced when the subdevice is bound, there

  1   2   3   4   5   6   7   8   9   10   >