mbox series

[00/18] media: rcar: Streams support

Message ID 20250219-rcar-streams-v1-0-f1b93e370aab@ideasonboard.com (mailing list archive)
Headers show
Series media: rcar: Streams support | expand

Message

Tomi Valkeinen Feb. 19, 2025, 1:48 p.m. UTC
Add streams support to Renesas rcar platform driver.

The series attempts to keep compatibility with the current upstream.
However, in upstream there's some kind of custom multi-stream support
implemented to the rcar driver, which breaks at patch "media: rcar-csi2:
Simplify rcsi2_calc_mbps()".

The behavior should not change when using a single stream.

A problem with the series currently is that it has a lot of
dependencies that are not in upstream yet.

Testing is even more problematic, as the only way currently for me to
get multiple streams is by using the GMSL2 deserializer add-on board
with GMSL2 serializers. These are not supported in upstream. If someone
has the hardware and wants to test, I can share the very-WIP branch that
contains the missing pieces.

 Tomi

Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
---
Tomi Valkeinen (18):
      media: rcar-vin: Add RCAR_GEN4 model value
      media: rcar-vin: Fix RAW8
      media: rcar-vin: Fix RAW10
      media: rcar-isp: Improve ISPPROCMODE_DT_PROC_MODE_VC
      media: rcar-isp: Move {enable|disable}_streams() calls
      media: rcar-csi2: Move {enable|disable}_streams() calls
      media: rcar-csi2: Fix typo
      media: rcar-csi2: Move rcar2_calc_mbps()
      media: rcar-csi2: Simplify rcsi2_calc_mbps()
      media: rcar-csi2: Optimize rcsi2_calc_mbps()
      media: rcar-csi2: Switch to Streams API
      media: rcar-isp: Switch to Streams API
      media: rcar-csi2: Add .get_frame_desc op
      media: rcar-isp: Call get_frame_desc to find out VC & DT
      media: rcar-csi2: Add more stream support to rcsi2_calc_mbps()
      media: rcar-csi2: Call get_frame_desc to find out VC & DT (Gen3)
      media: rcar-csi2: Add full streams support
      media: rcar-isp: Add full streams support

 drivers/media/platform/renesas/rcar-csi2.c         | 430 ++++++++++++++-------
 drivers/media/platform/renesas/rcar-isp.c          | 228 ++++++++---
 .../media/platform/renesas/rcar-vin/rcar-core.c    |   2 +-
 drivers/media/platform/renesas/rcar-vin/rcar-dma.c |  20 +-
 .../media/platform/renesas/rcar-vin/rcar-v4l2.c    |   8 +-
 drivers/media/platform/renesas/rcar-vin/rcar-vin.h |   1 +
 6 files changed, 499 insertions(+), 190 deletions(-)
---
base-commit: c4b7779abc6633677e6edb79e2809f4f61fde157
change-id: 20250219-rcar-streams-1fdea8860e5e
prerequisite-message-id: <20240129202254.1126012-1-niklas.soderlund+renesas@ragnatech.se>
prerequisite-patch-id: 23c9dfd64dd6176312d50191e60b0a92937c0051
prerequisite-patch-id: c49831184e0a6ff063cadbc79381c0f68d5b0f63
prerequisite-patch-id: 47104e797dfef692022a72cb62d7fad2fc44f0f5
prerequisite-patch-id: c89cf1fd9e528e6685ba8ce1e93e94f019f43913
prerequisite-patch-id: e096565500ed748974824328adf14905ae40bcaa
prerequisite-patch-id: 87a61e2c15f59928a96e9213c338cc2a65344c58
prerequisite-message-id: <20240129195954.1110643-1-niklas.soderlund+renesas@ragnatech.se>
prerequisite-patch-id: 748963119debbf990374b9eb06659381a3924824
prerequisite-change-id: 20250120-rcar-media-impro-2c37c1036e19:v1
prerequisite-patch-id: 3741e9cc665b78b56d18eee0041626d3c739dad5
prerequisite-patch-id: 99a13857e0de3c1cadc7a971f6c3fb4449599313
prerequisite-patch-id: a034cd446e21ba28273607f1d928c13739fb83f9
prerequisite-patch-id: cdf480b4562e749c4190ceec50e78a8dac155bd5
prerequisite-patch-id: 94c99ecd291d3d3f86b148406bbc383405016f2a
prerequisite-patch-id: 690790ff01515aa452e73581c3ee4312246bfbc2
prerequisite-patch-id: 74c5bed5396ef54ded950b9c449ea23b8f67636b
prerequisite-patch-id: 3a6b197715760886ab383fefe1d5f95f40d8b063
prerequisite-patch-id: e9f04f626ae08c981faa66de72663e8940a4f92e
prerequisite-patch-id: 58b5dc8fd9026dcfede60b005294692964def2a1
prerequisite-message-id: <20250210175615.1686529-1-niklas.soderlund+renesas@ragnatech.se>
prerequisite-patch-id: a4aa6a184c6a21fc4536c11e14d9b5cc61f13346
prerequisite-patch-id: 1b0091875529d392b142814005baa38b2ef77f98
prerequisite-patch-id: 4c960ae93b1e663b11194903ed1810e0ed1e4f59
prerequisite-patch-id: a5641e1dcad0f39baef8996b6731a471046f18f9
prerequisite-patch-id: 481317ba4b987cbb069c31f3372686a59c0fcb67
prerequisite-change-id: 20250218-frame-desc-passthrough-66805e413974:v2
prerequisite-patch-id: da0097f1a6c5b58f87210acd974d7eba0b721dc3
prerequisite-patch-id: 7cc5997549353a7e300f4778fd883e900d2251b2
prerequisite-patch-id: 57d4622505842a9c9b8cbedb49745a155826c464

Best regards,

Comments

Niklas Söderlund Feb. 19, 2025, 2:22 p.m. UTC | #1
Hi Tomi,

I'm happy to see this, nice work.

Unfortunately it does not apply to the media-tree. As this series is a 
mix of fixes and new features as well as covering multiple drivers. Do 
you think it would make sens to break out the fixes per driver which we 
could review and apply ASAP and the new features which we can review but 
need to wait until the dependencies are meet?

If the new features depends on stuff that is hard to upport, maybe just 
focus on the fixes to get them out of the way?

On 2025-02-19 15:48:54 +0200, Tomi Valkeinen wrote:
> Add streams support to Renesas rcar platform driver.
> 
> The series attempts to keep compatibility with the current upstream.
> However, in upstream there's some kind of custom multi-stream support
> implemented to the rcar driver, which breaks at patch "media: rcar-csi2:
> Simplify rcsi2_calc_mbps()".

I would not worry about breaking the make shift multi-stream, it was 
based on our first attempt to allow streams for GMSL many years ago and 
it was bonkers ;-) As long as it don't break a single streams, even from 
subdevs that do not themself support streams I'm happy.

> 
> The behavior should not change when using a single stream.
> 
> A problem with the series currently is that it has a lot of
> dependencies that are not in upstream yet.
> 
> Testing is even more problematic, as the only way currently for me to
> get multiple streams is by using the GMSL2 deserializer add-on board
> with GMSL2 serializers. These are not supported in upstream. If someone
> has the hardware and wants to test, I can share the very-WIP branch that
> contains the missing pieces.
> 
>  Tomi
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
> ---
> Tomi Valkeinen (18):
>       media: rcar-vin: Add RCAR_GEN4 model value
>       media: rcar-vin: Fix RAW8
>       media: rcar-vin: Fix RAW10
>       media: rcar-isp: Improve ISPPROCMODE_DT_PROC_MODE_VC
>       media: rcar-isp: Move {enable|disable}_streams() calls
>       media: rcar-csi2: Move {enable|disable}_streams() calls
>       media: rcar-csi2: Fix typo
>       media: rcar-csi2: Move rcar2_calc_mbps()
>       media: rcar-csi2: Simplify rcsi2_calc_mbps()
>       media: rcar-csi2: Optimize rcsi2_calc_mbps()
>       media: rcar-csi2: Switch to Streams API
>       media: rcar-isp: Switch to Streams API
>       media: rcar-csi2: Add .get_frame_desc op
>       media: rcar-isp: Call get_frame_desc to find out VC & DT
>       media: rcar-csi2: Add more stream support to rcsi2_calc_mbps()
>       media: rcar-csi2: Call get_frame_desc to find out VC & DT (Gen3)
>       media: rcar-csi2: Add full streams support
>       media: rcar-isp: Add full streams support
> 
>  drivers/media/platform/renesas/rcar-csi2.c         | 430 ++++++++++++++-------
>  drivers/media/platform/renesas/rcar-isp.c          | 228 ++++++++---
>  .../media/platform/renesas/rcar-vin/rcar-core.c    |   2 +-
>  drivers/media/platform/renesas/rcar-vin/rcar-dma.c |  20 +-
>  .../media/platform/renesas/rcar-vin/rcar-v4l2.c    |   8 +-
>  drivers/media/platform/renesas/rcar-vin/rcar-vin.h |   1 +
>  6 files changed, 499 insertions(+), 190 deletions(-)
> ---
> base-commit: c4b7779abc6633677e6edb79e2809f4f61fde157
> change-id: 20250219-rcar-streams-1fdea8860e5e
> prerequisite-message-id: <20240129202254.1126012-1-niklas.soderlund+renesas@ragnatech.se>
> prerequisite-patch-id: 23c9dfd64dd6176312d50191e60b0a92937c0051
> prerequisite-patch-id: c49831184e0a6ff063cadbc79381c0f68d5b0f63
> prerequisite-patch-id: 47104e797dfef692022a72cb62d7fad2fc44f0f5
> prerequisite-patch-id: c89cf1fd9e528e6685ba8ce1e93e94f019f43913
> prerequisite-patch-id: e096565500ed748974824328adf14905ae40bcaa
> prerequisite-patch-id: 87a61e2c15f59928a96e9213c338cc2a65344c58
> prerequisite-message-id: <20240129195954.1110643-1-niklas.soderlund+renesas@ragnatech.se>
> prerequisite-patch-id: 748963119debbf990374b9eb06659381a3924824
> prerequisite-change-id: 20250120-rcar-media-impro-2c37c1036e19:v1
> prerequisite-patch-id: 3741e9cc665b78b56d18eee0041626d3c739dad5
> prerequisite-patch-id: 99a13857e0de3c1cadc7a971f6c3fb4449599313
> prerequisite-patch-id: a034cd446e21ba28273607f1d928c13739fb83f9
> prerequisite-patch-id: cdf480b4562e749c4190ceec50e78a8dac155bd5
> prerequisite-patch-id: 94c99ecd291d3d3f86b148406bbc383405016f2a
> prerequisite-patch-id: 690790ff01515aa452e73581c3ee4312246bfbc2
> prerequisite-patch-id: 74c5bed5396ef54ded950b9c449ea23b8f67636b
> prerequisite-patch-id: 3a6b197715760886ab383fefe1d5f95f40d8b063
> prerequisite-patch-id: e9f04f626ae08c981faa66de72663e8940a4f92e
> prerequisite-patch-id: 58b5dc8fd9026dcfede60b005294692964def2a1
> prerequisite-message-id: <20250210175615.1686529-1-niklas.soderlund+renesas@ragnatech.se>
> prerequisite-patch-id: a4aa6a184c6a21fc4536c11e14d9b5cc61f13346
> prerequisite-patch-id: 1b0091875529d392b142814005baa38b2ef77f98
> prerequisite-patch-id: 4c960ae93b1e663b11194903ed1810e0ed1e4f59
> prerequisite-patch-id: a5641e1dcad0f39baef8996b6731a471046f18f9
> prerequisite-patch-id: 481317ba4b987cbb069c31f3372686a59c0fcb67
> prerequisite-change-id: 20250218-frame-desc-passthrough-66805e413974:v2
> prerequisite-patch-id: da0097f1a6c5b58f87210acd974d7eba0b721dc3
> prerequisite-patch-id: 7cc5997549353a7e300f4778fd883e900d2251b2
> prerequisite-patch-id: 57d4622505842a9c9b8cbedb49745a155826c464
> 
> Best regards,
> -- 
> Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
>
Tomi Valkeinen Feb. 19, 2025, 2:41 p.m. UTC | #2
Hi,

On 19/02/2025 16:22, Niklas Söderlund wrote:
> Hi Tomi,
> 
> I'm happy to see this, nice work.
> 
> Unfortunately it does not apply to the media-tree. As this series is a

It should, if you apply the dependencies first. But one of the 
dependencies from you is a bit old and that doesn't apply without some 
conflicts resolved. So... Yes, doesn't apply =).

> mix of fixes and new features as well as covering multiple drivers. Do
> you think it would make sens to break out the fixes per driver which we
> could review and apply ASAP and the new features which we can review but
> need to wait until the dependencies are meet?

Yes. I think that's the RAW8 and RAW10 fixes. However, I can't test them 
without streams and GMSL2, so...

> If the new features depends on stuff that is hard to upport, maybe just
> focus on the fixes to get them out of the way?
> 
> On 2025-02-19 15:48:54 +0200, Tomi Valkeinen wrote:
>> Add streams support to Renesas rcar platform driver.
>>
>> The series attempts to keep compatibility with the current upstream.
>> However, in upstream there's some kind of custom multi-stream support
>> implemented to the rcar driver, which breaks at patch "media: rcar-csi2:
>> Simplify rcsi2_calc_mbps()".
> 
> I would not worry about breaking the make shift multi-stream, it was
> based on our first attempt to allow streams for GMSL many years ago and
> it was bonkers ;-) As long as it don't break a single streams, even from
> subdevs that do not themself support streams I'm happy.

Alright. Then you're happy with this series. I hope =). I don't have 
anything to test this with, and only the v4h board.

  Tomi
Niklas Söderlund Feb. 19, 2025, 2:56 p.m. UTC | #3
On 2025-02-19 16:41:24 +0200, Tomi Valkeinen wrote:
> Hi,
> 
> On 19/02/2025 16:22, Niklas Söderlund wrote:
> > Hi Tomi,
> > 
> > I'm happy to see this, nice work.
> > 
> > Unfortunately it does not apply to the media-tree. As this series is a
> 
> It should, if you apply the dependencies first. But one of the dependencies
> from you is a bit old and that doesn't apply without some conflicts
> resolved. So... Yes, doesn't apply =).

:-)

> 
> > mix of fixes and new features as well as covering multiple drivers. Do
> > you think it would make sens to break out the fixes per driver which we
> > could review and apply ASAP and the new features which we can review but
> > need to wait until the dependencies are meet?
> 
> Yes. I think that's the RAW8 and RAW10 fixes. However, I can't test them
> without streams and GMSL2, so...

Sure but the fixes for the format setup registers don't depend on 
streams support, right? The fixes are properly tested but depend on new 
features to enable hardware to produce the test environment. It's miles 
better then the BSP testing done when these things where first 
written...

> 
> > If the new features depends on stuff that is hard to upport, maybe just
> > focus on the fixes to get them out of the way?
> > 
> > On 2025-02-19 15:48:54 +0200, Tomi Valkeinen wrote:
> > > Add streams support to Renesas rcar platform driver.
> > > 
> > > The series attempts to keep compatibility with the current upstream.
> > > However, in upstream there's some kind of custom multi-stream support
> > > implemented to the rcar driver, which breaks at patch "media: rcar-csi2:
> > > Simplify rcsi2_calc_mbps()".
> > 
> > I would not worry about breaking the make shift multi-stream, it was
> > based on our first attempt to allow streams for GMSL many years ago and
> > it was bonkers ;-) As long as it don't break a single streams, even from
> > subdevs that do not themself support streams I'm happy.
> 
> Alright. Then you're happy with this series. I hope =). I don't have
> anything to test this with, and only the v4h board.

You can test single stream on V4H using the staging GMSL2 driver and the 
TPG. I will ofc also test it so no need if it's troublesome for you to 
rewire the V4H you have to this configuration.
Tomi Valkeinen Feb. 19, 2025, 3 p.m. UTC | #4
Hi,

On 19/02/2025 16:56, Niklas Söderlund wrote:
> On 2025-02-19 16:41:24 +0200, Tomi Valkeinen wrote:
>> Hi,
>>
>> On 19/02/2025 16:22, Niklas Söderlund wrote:
>>> Hi Tomi,
>>>
>>> I'm happy to see this, nice work.
>>>
>>> Unfortunately it does not apply to the media-tree. As this series is a
>>
>> It should, if you apply the dependencies first. But one of the dependencies
>> from you is a bit old and that doesn't apply without some conflicts
>> resolved. So... Yes, doesn't apply =).
> 
> :-)
> 
>>
>>> mix of fixes and new features as well as covering multiple drivers. Do
>>> you think it would make sens to break out the fixes per driver which we
>>> could review and apply ASAP and the new features which we can review but
>>> need to wait until the dependencies are meet?
>>
>> Yes. I think that's the RAW8 and RAW10 fixes. However, I can't test them
>> without streams and GMSL2, so...
> 
> Sure but the fixes for the format setup registers don't depend on
> streams support, right? The fixes are properly tested but depend on new
> features to enable hardware to produce the test environment. It's miles
> better then the BSP testing done when these things where first
> written...

If you say so. I'm reluctant to apply fixes that I can only test with a 
huge pile of other stuff =).

>>
>>> If the new features depends on stuff that is hard to upport, maybe just
>>> focus on the fixes to get them out of the way?
>>>
>>> On 2025-02-19 15:48:54 +0200, Tomi Valkeinen wrote:
>>>> Add streams support to Renesas rcar platform driver.
>>>>
>>>> The series attempts to keep compatibility with the current upstream.
>>>> However, in upstream there's some kind of custom multi-stream support
>>>> implemented to the rcar driver, which breaks at patch "media: rcar-csi2:
>>>> Simplify rcsi2_calc_mbps()".
>>>
>>> I would not worry about breaking the make shift multi-stream, it was
>>> based on our first attempt to allow streams for GMSL many years ago and
>>> it was bonkers ;-) As long as it don't break a single streams, even from
>>> subdevs that do not themself support streams I'm happy.
>>
>> Alright. Then you're happy with this series. I hope =). I don't have
>> anything to test this with, and only the v4h board.
> 
> You can test single stream on V4H using the staging GMSL2 driver and the
> TPG. I will ofc also test it so no need if it's troublesome for you to
> rewire the V4H you have to this configuration.

Yes, that I have tested. So I have used my V4H board with two GMSL2 
deserializers + imx219 cameras, with unpublished GMSL drivers, and some 
other stuff. And I have tested (just the patches in this series, and the 
dependencies, no "other stuff") with the upstream staging driver with 
deser TPG.

I meant that I can't test this with anything "real" except with the full 
multi-stream gmsl setup. It would be great to be able to just plug in a 
single imx219 or such, but, nope.

  Tomi