Hi Laurent,
Thanks for your feedback.
On 2019-05-16 13:08:22 +0300, Laurent Pinchart wrote:
> Hi Niklas,
>
> Thank you for the patch.
>
> On Thu, May 16, 2019 at 02:47:46AM +0200, Niklas Söderlund wrote:
> > The R-Car VIN module supports V4L2_PIX_FMT_ARGB555 and
> >
Hi Laurent,
Thanks for your feedback.
On 2019-05-16 13:01:38 +0300, Laurent Pinchart wrote:
> Hi Niklas,
>
> Thank you for the patch.
>
> On Thu, May 16, 2019 at 02:47:45AM +0200, Niklas Söderlund wrote:
> > In preparation to adding support for RGB pixel formats with an al
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
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
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
/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
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
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
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
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
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
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
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
-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
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
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
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
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
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
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
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
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
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
@@ 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
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
> >
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
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
> ---
>
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
--
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
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
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
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
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
()
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
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
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
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
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
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
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
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
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
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
.
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
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
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
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
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
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
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
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
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
o be used. But for the change
itself.
Reviewed-by: Niklas Söderlund
> ---
> drivers/media/platform/rcar-vin/rcar-core.c | 16
> 1 file changed, 16 insertions(+)
>
> diff --git a/drivers/media/platform/rcar-vin/rcar-core.c
> b/drivers/media/platform/rcar-vin/
n_dev *vin)
> {
> int ret;
>
> - /* All our sources are CSI-2 */
> - vin->mbus_cfg.type = V4L2_MBUS_CSI2;
> - vin->mbus_cfg.flags = 0;
> -
> vin->pad.flags = MEDIA_PAD_FL_SINK;
> ret = media_entity_pads_init(&vin->vdev.entity, 1, &vin->pad);
> if (ret)
> diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h
> b/drivers/media/platform/rcar-vin/rcar-vin.h
> index c2aef78..a63f3c6 100644
> --- a/drivers/media/platform/rcar-vin/rcar-vin.h
> +++ b/drivers/media/platform/rcar-vin/rcar-vin.h
> @@ -52,6 +52,19 @@ enum rvin_csi_id {
> };
>
> /**
> + * enum rvin_port_id
> + *
> + * List the available VIN port functions.
> + *
> + * RVIN_PORT_DIGITAL - Input port for digital video connection
> + * RVIN_PORT_CSI2- Input port for CSI-2 video connection
> + */
> +enum rvin_port_id {
> + RVIN_PORT_DIGITAL,
> + RVIN_PORT_CSI2
> +};
This enum is never used in the patch-set is it used later by a different
patch-set or a left over from refactoring?
> +
> +/**
> * STOPPED - No operation in progress
> * RUNNING - Operation in progress have buffers
> * STOPPING - Stopping operation
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
rvin_write(vin, vin->crop.top, VNSLPRC_REG);
> - rvin_write(vin, vin->crop.top + vin->crop.height - 1,
> -VNELPRC_REG);
> + rvin_write(vin, height - 1, VNELPRC_REG);
> break;
> }
>
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
Hi again,
On 2018-05-11 13:10:37 +0200, Niklas Söderlund wrote:
> Hi Jacopo,
>
> Thanks for your work.
>
> On 2018-05-11 11:59:40 +0200, Jacopo Mondi wrote:
> > The crop_scale routine uses the crop rectangle memebers to configure the
> > VIN clipping rectangle. When
: Update AFE fixed pixel rate]
Signed-off-by: Niklas Söderlund
---
* Changes since v1
- Update AFE fixed pixel rate.
---
drivers/media/i2c/adv748x/adv748x-afe.c | 12 ++--
drivers/media/i2c/adv748x/adv748x-hdmi.c | 8 +---
2 files changed, 7 insertions(+), 13 deletions(-)
diff
requested format resulting in the DMA engine not properly stopping
before writing outside the buffer.
This series reverts the incorrect fix in 1/2 and applies a correct one
in 2/2. I think this should be picked up for v4.18.
Niklas Söderlund (2):
Revert "media: rcar-vin: enable field tog
: 5e7c623632fcf8f5 ("media: rcar-vin: use different v4l2 operations in
media controller mode")
Reported-by: Jacopo Mondi
Signed-off-by: Niklas Söderlund
---
drivers/media/platform/rcar-vin/rcar-v4l2.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/drivers/media/platform/rcar-vin/rcar
This reverts commit 015060cb7795eac34454696cc9c9f8b76926a401.
---
drivers/media/platform/rcar-vin/rcar-dma.c | 20 +---
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c
b/drivers/media/platform/rcar-vin/rcar-dma.c
index b41b
: 5e7c623632fcf8f5 ("media: rcar-vin: use different v4l2 operations in
media controller mode")
Reported-by: Jacopo Mondi
Signed-off-by: Niklas Söderlund
---
drivers/media/platform/rcar-vin/rcar-v4l2.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/drivers/media/platform/rcar-vin/rcar
ted format resulting in the DMA engine not properly stopping
before writing outside the buffer.
This series reverts the incorrect fix in 1/2 and applies a correct one
in 2/2. I think this should be picked up for v4.18.
* Changes since v1
- Add commit message to 1/2.
Niklas Söderlund (2):
Revert "
reverts commit 015060cb7795eac34454696cc9c9f8b76926a401.
Signed-off-by: Niklas Söderlund
---
drivers/media/platform/rcar-vin/rcar-dma.c | 20 +---
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c
b/drivers/media/platform
Hi Kieran,
Thanks for your feedback.
On 2018-05-12 09:04:18 +0100, Kieran Bingham wrote:
> Hi Niklas, Laurent,
>
> Thanks for the updated patch and detailed investigation to get this right.
>
> On 11/05/18 15:04, Niklas Söderlund wrote:
> > From: Laurent Pinchart
> &
Hi Simon,
Thanks for your patch.
On 2018-05-09 20:45:58 +0200, Simon Horman wrote:
> The example vin port node does not have an address and thus does not
> need address-cells or address size-properties.
>
> Signed-off-by: Simon Horman
Acked-by: Niklas Söderlund
> ---
&
Signed-off-by: Niklas Söderlund
---
Documentation/devicetree/bindings/media/rcar_vin.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/media/rcar_vin.txt
b/Documentation/devicetree/bindings/media/rcar_vin.txt
index a19517e1c669eb35..c2c57dcf73f4851b
Add the SoC specific information for Renesas r8a77965.
Signed-off-by: Niklas Söderlund
---
drivers/media/platform/rcar-vin/rcar-core.c | 48 +
1 file changed, 48 insertions(+)
diff --git a/drivers/media/platform/rcar-vin/rcar-core.c
b/drivers/media/platform/rcar-vin/rcar
Hi Laurent,
On 2018-04-28 19:01:37 +0300, Laurent Pinchart wrote:
> Hi Niklas,
>
> On Friday, 27 April 2018 02:28:32 EEST Niklas Söderlund wrote:
> > On 2018-04-27 00:30:25 +0300, Laurent Pinchart wrote:
> > > On Thursday, 26 April 2018 23:21:21 EEST Niklas Söderlund wro
iew comments and to add r8a7796 support.
- Add get_fmt handler.
- Fix media bus format error s/YUYV8/UYVY8/
Changes since v1:
- Drop dependency on a pad aware s_stream operation.
- Use the DT bindings format "renesas,-", thanks Geert
for pointing this out.
Niklas Söderlund (2):
rcar
-by: Niklas Söderlund
Acked-by: Rob Herring
Acked-by: Sakari Ailus
Reviewed-by: Laurent Pinchart
---
* Changes since v14.
- Added compatible string for R8A77965 and R8A77970.
- s/Port 0/port@0/
- s/Port 1/port@1/
- s/Endpoint 0/endpoint@0/
* Changes since v13
- Add Laurent'
RCAR_CSI2_SOURCE_VC0; i < NR_OF_RCAR_CSI2_PAD; i++)
+ priv->pads[i].flags = MEDIA_PAD_FL_SOURCE;
+
+ ret = media_entity_pads_init(&priv->subdev.entity, NR_OF_RCAR_CSI2_PAD,
+priv->pads);
+ if (ret)
+ goto error;
+
+ pm_runtime_enable(&pdev->dev);
+
+ ret = v4l2_async_register_subdev(&priv->subdev);
+ if (ret < 0)
+ goto error;
+
+ dev_info(priv->dev, "%d lanes found\n", priv->lanes);
+
+ return 0;
+
+error:
+ v4l2_async_notifier_unregister(&priv->notifier);
+ v4l2_async_notifier_cleanup(&priv->notifier);
+
+ return ret;
+}
+
+static int rcsi2_remove(struct platform_device *pdev)
+{
+ struct rcar_csi2 *priv = platform_get_drvdata(pdev);
+
+ v4l2_async_notifier_unregister(&priv->notifier);
+ v4l2_async_notifier_cleanup(&priv->notifier);
+ v4l2_async_unregister_subdev(&priv->subdev);
+
+ pm_runtime_disable(&pdev->dev);
+
+ return 0;
+}
+
+static struct platform_driver __refdata rcar_csi2_pdrv = {
+ .remove = rcsi2_remove,
+ .probe = rcsi2_probe,
+ .driver = {
+ .name = "rcar-csi2",
+ .of_match_table = rcar_csi2_of_table,
+ },
+};
+
+module_platform_driver(rcar_csi2_pdrv);
+
+MODULE_AUTHOR("Niklas Söderlund ");
+MODULE_DESCRIPTION("Renesas R-Car MIPI CSI-2 receiver");
+MODULE_LICENSE("GPL");
--
2.17.0
Hi Jacopo,
Thanks for your feedback.
On 2018-05-14 15:14:48 +0200, Jacopo Mondi wrote:
> Hi Niklas,
>thanks for the patch
>
> On Sun, May 13, 2018 at 09:19:17PM +0200, Niklas Söderlund wrote:
> > A V4L2 driver for Renesas R-Car MIPI CSI-2 receiver. The driver
> >
-by: Niklas Söderlund
Acked-by: Rob Herring
Acked-by: Sakari Ailus
Reviewed-by: Laurent Pinchart
Reviewed-by: Jacopo Mondi
---
* Changes since v14.
- Added compatible string for R8A77965 and R8A77970.
- s/Port 0/port@0/
- s/Port 1/port@1/
- s/Endpoint 0/endpoint@0/
* Changes since v13
- Add
after review comments and to add r8a7796 support.
- Add get_fmt handler.
- Fix media bus format error s/YUYV8/UYVY8/
Changes since v1:
- Drop dependency on a pad aware s_stream operation.
- Use the DT bindings format "renesas,-", thanks Geert
for pointing this out.
Niklas S
_SINK].flags = MEDIA_PAD_FL_SINK;
+ for (i = RCAR_CSI2_SOURCE_VC0; i < NR_OF_RCAR_CSI2_PAD; i++)
+ priv->pads[i].flags = MEDIA_PAD_FL_SOURCE;
+
+ ret = media_entity_pads_init(&priv->subdev.entity, NR_OF_RCAR_CSI2_PAD,
+pri
N port functions.
> + *
> + * RVIN_PORT_DIGITAL - Input port for digital video connection
> + * RVIN_PORT_CSI2- Input port for CSI-2 video connection
> + */
> +enum rvin_port_id {
> + RVIN_PORT_DIGITAL,
> + RVIN_PORT_CSI2
> +};
> +
> +/**
> * STOPPED - No operation in progress
> * RUNNING - Operation in progress have buffers
> * STOPPING - Stopping operation
> @@ -225,6 +238,7 @@ struct rvin_dev {
> *
> * @lock:protects the count, notifier, vin and csi members
> * @count: number of enabled VIN instances found in DT
> + * @v4l2_dev:pointer to the group v4l2 device
I pray there is a away to avoid adding this here, it feels awkward :-(
> * @notifier:pointer to the notifier of a VIN which handles
> the
> * groups async sub-devices.
> * @vin: VIN instances which are part of the group
> @@ -238,6 +252,7 @@ struct rvin_group {
>
> struct mutex lock;
> unsigned int count;
> + struct v4l2_device *v4l2_dev;
> struct v4l2_async_notifier *notifier;
> struct rvin_dev *vin[RCAR_VIN_NUM];
>
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
+ /*
> + * If we run with media-controller, notifiers will be registered
> + * later, once all VINs have probed.
> + */
> + if (vin->info->use_mc)
> + return 0;
> +
> vin->notifier.ops = &rvin_digital_notify_ops;
> ret = v4l2_async_notifier_register(&vin->v4l2_dev, &vin->notifier);
> if (ret < 0) {
> @@ -596,7 +631,8 @@ static int rvin_group_notify_complete(struct
> v4l2_async_notifier *notifier)
>
> /* Register all video nodes for the group. */
> for (i = 0; i < RCAR_VIN_NUM; i++) {
> - if (vin->group->vin[i]) {
> + if (vin->group->vin[i] &&
> + !video_is_registered(&vin->group->vin[i]->vdev)) {
> ret = rvin_v4l2_register(vin->group->vin[i]);
> if (ret)
> return ret;
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
EV;
> + goto out;
> + }
I like this patch, you made it so simple. I feared this would be the
ugly part when adding parallel support to Gen3. All that is missing is
handling of vin->mbus_cfg or how you think we best handle that for the
different input buses.
>
> + mask_new = mask & rvin_group_get_mask(vin, csi_id, channel);
> vin_dbg(vin, "Try link change mask: 0x%x new: 0x%x\n", mask, mask_new);
>
> if (!mask_new) {
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
Hi Jacopo,
On 2018-05-16 14:16:56 +0200, Jacopo Mondi wrote:
> Add R-Car R8A77995 SoC to the rcar-vin supported ones.
>
> Signed-off-by: Jacopo Mondi
> Reviewed-by: Niklas Söderlund
> Reviewed-by: Laurent Pinchart
> ---
> drivers/media/platform/rcar-vin/rcar-core.c | 16
/boot/dts/r8a7793-gose.dts | 4 +---
> arch/arm/boot/dts/r8a7794-alt.dts| 2 +-
> arch/arm/boot/dts/r8a7794-silk.dts | 2 +-
> drivers/media/platform/rcar-vin/rcar-core.c | 10 --
> drivers/media/platform/rcar-vin/rcar-dma.c | 11 +++
> 9 files changed, 42 insertions(+), 15 deletions(-)
>
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
Hi Jacopo,
Thanks for your patch.
On 2018-05-16 18:32:27 +0200, Jacopo Mondi wrote:
> Describe the optional endpoint properties for endpoint nodes of port@0
> and port@1 of the R-Car VIN driver device tree bindings documentation.
>
> Signed-off-by: Jacopo Mondi
Acked-by: Nikl
describing one or more endpoints connected to
>the VIN from local SoC CSI-2 receivers. The endpoint numbers must
>use the following schema.
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
vin_err(vin,
> + "Missing data enable signal polarity
> property\n");
I fear this can't be an error as that would break backward comp ability
with existing dtb's.
> + return -EINVAL;
> + }
> break;
> default:
> vin_err(vin, "Unknown media bus type\n");
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
g.flags & V4L2_MBUS_DATA_ACTIVE_LOW))
dmr2 |= VNDMR2_CES;
/* Use HSYNC as clock enable if VIn_CLKENB is not available. */
if (!(vin->mbus_cfg.flags & (V4L2_MBUS_DATA_ACTIVE_LOW |
V4L2_MBUS_DATA_ACTIVE_HIGH)))
dmr2 |= VNDMR2_CHS;
Or am I misunderstanding something?
> +
> + /*
>* Output format
>*/
> switch (vin->format.pixelformat) {
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
dts
> b/arch/arm/boot/dts/r8a7794-alt.dts
> index 26a8834..4bbb9cc 100644
> --- a/arch/arm/boot/dts/r8a7794-alt.dts
> +++ b/arch/arm/boot/dts/r8a7794-alt.dts
> @@ -380,7 +380,6 @@
>
> vin0ep: endpoint {
> remote-endpoint = <&adv7180>;
> - bus-width = <8>;
> };
> };
> };
> diff --git a/arch/arm/boot/dts/r8a7794-silk.dts
> b/arch/arm/boot/dts/r8a7794-silk.dts
> index 351cb3b..c0c5d31 100644
> --- a/arch/arm/boot/dts/r8a7794-silk.dts
> +++ b/arch/arm/boot/dts/r8a7794-silk.dts
> @@ -480,7 +480,6 @@
>
> vin0ep: endpoint {
> remote-endpoint = <&adv7180>;
> - bus-width = <8>;
> };
> };
> };
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
oot/dts/r8a7794-silk.dts
> b/arch/arm/boot/dts/r8a7794-silk.dts
> index c0c5d31..ed17376 100644
> --- a/arch/arm/boot/dts/r8a7794-silk.dts
> +++ b/arch/arm/boot/dts/r8a7794-silk.dts
> @@ -480,6 +480,7 @@
>
> vin0ep: endpoint {
> remote-endpoint = <&adv7180>;
> + data-active = <1>;
> };
> };
> };
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
Instead of failing the set_fmt() if a unsupported format is requested
set a default one and return the changed format to the user.
Signed-off-by: Niklas Söderlund
Reported-by: Sakari Ailus
---
drivers/media/platform/rcar-vin/rcar-csi2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion
turing so that the driver always returns buffers in the same order
they are queued and prepare for SEQ_TB/BT output.
Signed-off-by: Niklas Söderlund
---
drivers/media/platform/rcar-vin/rcar-dma.c | 16 +++-
drivers/media/platform/rcar-vin/rcar-vin.h | 2 ++
2 files changed, 17 in
The style for referring to ports and endpoint are wrong. Refer to them
using lowercase and a unit address, port@x and endpoint@x.
Signed-off-by: Niklas Söderlund
Reported-by: Geert Uytterhoeven
---
.../devicetree/bindings/media/rcar_vin.txt| 20 +--
1 file changed, 10
Signed-off-by: Niklas Söderlund
---
Documentation/media/uapi/v4l/vidioc-g-std.rst| 14 ++
Documentation/media/uapi/v4l/vidioc-querystd.rst | 11 +++
drivers/media/v4l2-core/v4l2-subdev.c| 12
include/uapi/linux/v4l2-subdev.h | 3
Hi Jacopo,
On 2018-05-17 12:13:06 +0200, Jacopo Mondi wrote:
> Hi Niklas,
>thanks for review.
>
> On Wed, May 16, 2018 at 10:32:49PM +0200, Niklas Söderlund wrote:
> > Hi Jacopo,
> >
> > Thanks for your work!
> >
> > First let me apologies f
Hi Hans,
Thanks for your feedback.
On 2018-05-17 10:04:35 +0200, Hans Verkuil wrote:
> On 17/05/18 04:00, Niklas Söderlund wrote:
>
> Missing commit log.
I checked other commits doing the same thing, they had no commit log and
that was enough reason for me to be lazy. Will fix i
git://git.ragnatech.se/v4l-utils#subdev-std
* Changes since v1
- Add VIDIOC_SUBDEV_ENUMSTD.
Niklas Söderlund (2):
v4l2-ioctl: create helper to fill in v4l2_standard for ENUMSTD
v4l: Add support for STD ioctls on subdev nodes
.../media/uapi/v4l/vidioc-enumstd.rst | 11 ++--
Document
Prepare for adding a new IOCTL VIDIOC_SUBDEV_ENUMSTD which would
enumerate the standards for a subdevice by breaking out the code which
could be shared between the video and subdevice versions of this IOCTL.
Signed-off-by: Niklas Söderlund
---
drivers/media/v4l2-core/v4l2-ioctl.c | 66
controlled on the subdev device directly.
Add four new ioctls to be able to directly interact with subdevices and
control the video standard; VIDIOC_SUBDEV_ENUMSTD, VIDIOC_SUBDEV_G_STD,
VIDIOC_SUBDEV_S_STD and VIDIOC_SUBDEV_QUERYSTD.
Signed-off-by: Niklas Söderlund
---
* Changes since v1
Hi Jacopo,
Thanks for your patch.
On 2018-05-21 19:27:40 +0200, Jacopo Mondi wrote:
> Describe the optional properties for endpoint nodes of port@0
> and port@1 of the R-Car VIN driver device tree bindings documentation.
>
> Signed-off-by: Jacopo Mondi
> Acked-by: N
vin.txt file only spaces are used for
indentation.
> +
> - port 1 - sub-nodes describing one or more endpoints connected to
>the VIN from local SoC CSI-2 receivers. The endpoint numbers must
>use the following schema.
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
something like this be much more readable?
/* Clock Enable signal polarity select. */
if (vin->parallel->mbus_flags & V4L2_MBUS_DATA_ACTIVE_LOW)
dmr2 |= VNDMR2_CES;
/* Use HSYNC as clock enable if VIn_CLKENB is not available. */
if (!(vin->parallel->mbus_flags & (V4L2_MBUS_DATA_ACTIVE_LOW |
V4L2_MBUS_DATA_ACTIVE_HIGH)))
dmr2 |= VNDMR2_CHS;
> + }
>
> /*
>* Output format
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
struct v4l2_async_subdev *asd)
> +static void rvin_parallel_notify_unbind(struct v4l2_async_notifier *notifier,
> + struct v4l2_subdev *subdev,
> + struct v4l2_async_subdev *asd)
When I run my indentation scrip
Hi Jacopo,
Thanks for your work.
On 2018-05-18 16:40:38 +0200, Jacopo Mondi wrote:
> Remove un-necessary empty lines.
>
> Signed-off-by: Jacopo Mondi
Acked-by: Niklas Söderlund
> ---
> drivers/media/platform/rcar-vin/rcar-core.c | 2 --
> 1 file changed, 2 deletions(-)
201 - 300 of 1216 matches
Mail list logo