mbox series

[0/3] Add Input Video Control Block driver for RZ/V2H

Message ID 20250519145754.454005-1-dan.scally@ideasonboard.com
Headers show
Series Add Input Video Control Block driver for RZ/V2H | expand

Message

Daniel Scally May 19, 2025, 2:57 p.m. UTC
Hello all

This series adds a driver for the Input Video Control Block in the
RZ/V2H SoC. The IVC block transmits input image data from memory to
the ISP core (on this SoC, a Mali-C55 ISP). The driver registers an
output video device for userspace to queue image buffers to. One
noteworthy feature is that - because it is not a part of the main ISP
drive - the IVC driver also registers a subdevice, which connects to
the media device created by the ISP driver through the usual v4l2
async framework. This requires delaying the registration of the video
device until the .registered() callback of the subdevice, so that the
struct v4l2_dev pointer the subdevice connected to can be set to the
video device.

To facilitate communication between the ISP driver and the IVC driver
we use the new media jobs framework that was posted recently [1]. The
series is also based on top of the latest version of the Mali-C55
driver [2] and some updates to rzg2l-cru [3].

Note that this is not quite ready to merge, as there's an outstanding
bug that sometimes causes the driver to hang. The device should fire
two interrupts per frame; once on completion of data transmission and
once on expiration of the blanking period. The second interrupt seems
sometimes not to arrive, and at the moment the problem is worked
around with a timeout in rzv2h_ivc_send_next_buffer(). We're working
on that issue, but because the driver lends helpful context to the
media jobs and mali-c55 series (and is probably otherwise ready for
comment too) I wanted to post it.

Thanks
Dan

[1] https://lore.kernel.org/linux-media/20250519140403.443915-1-dan.scally@ideasonboard.com/T/
[2] https://lore.kernel.org/linux-media/20250519143409.451100-1-dan.scally@ideasonboard.com/T/
[3] https://lore.kernel.org/linux-media/20250506125015.567746-1-dan.scally@ideasonboard.com/T/


Daniel Scally (3):
  dt-bindings: media: Add bindings for the RZ/V2H IVC block
  media: platform: Add Renesas Input Video Control block driver
  MAINTAINERS: Add entry for rzv2h-ivc driver

 .../bindings/media/renesas,rzv2h-ivc.yaml     |  99 +++
 MAINTAINERS                                   |   7 +
 drivers/media/platform/renesas/Kconfig        |   2 +
 drivers/media/platform/renesas/Makefile       |   1 +
 .../media/platform/renesas/rzv2h-ivc/Kconfig  |  11 +
 .../media/platform/renesas/rzv2h-ivc/Makefile |   7 +
 .../renesas/rzv2h-ivc/rzv2h-ivc-dev.c         | 239 ++++++
 .../renesas/rzv2h-ivc/rzv2h-ivc-subdev.c      | 376 ++++++++++
 .../renesas/rzv2h-ivc/rzv2h-ivc-video.c       | 703 ++++++++++++++++++
 .../platform/renesas/rzv2h-ivc/rzv2h-ivc.h    | 141 ++++
 10 files changed, 1586 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/renesas,rzv2h-ivc.yaml
 create mode 100644 drivers/media/platform/renesas/rzv2h-ivc/Kconfig
 create mode 100644 drivers/media/platform/renesas/rzv2h-ivc/Makefile
 create mode 100644 drivers/media/platform/renesas/rzv2h-ivc/rzv2h-ivc-dev.c
 create mode 100644 drivers/media/platform/renesas/rzv2h-ivc/rzv2h-ivc-subdev.c
 create mode 100644 drivers/media/platform/renesas/rzv2h-ivc/rzv2h-ivc-video.c
 create mode 100644 drivers/media/platform/renesas/rzv2h-ivc/rzv2h-ivc.h

Comments

Krzysztof Kozlowski May 20, 2025, 6:48 a.m. UTC | #1
On Mon, May 19, 2025 at 03:57:52PM GMT, Daniel Scally wrote:
> The RZ/V2H SoC has a block called the Input Video Control block which
> feeds image data into the Image Signal Processor. Add dt bindings to
> describe the IVC.

A nit, subject: drop second/last, redundant "bindings for". The
"dt-bindings" prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

> 
> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
> ---
>  .../bindings/media/renesas,rzv2h-ivc.yaml     | 99 +++++++++++++++++++

This fails testing - expect Rob's bot report (or check DT patchwork) -
thus limited review.

>  1 file changed, 99 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/renesas,rzv2h-ivc.yaml

Filename matching compatible. You can also explain exception in the
commit msg.

> 
> diff --git a/Documentation/devicetree/bindings/media/renesas,rzv2h-ivc.yaml b/Documentation/devicetree/bindings/media/renesas,rzv2h-ivc.yaml
> new file mode 100644
> index 000000000000..29d522f7d365
>

...


> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +  - resets
> +  - reset-names
> +  - port
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/renesas,r9a09g057-cpg.h>
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +    ivc: ivc@16040000 {

Node names should be generic. See also an explanation and list of
examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation

video-codec? video-encoder? video-engine? Or anything reasonable you
find.

Drop unused label

> +      compatible = "renesas,r9a09g057-ivc";
> +      reg = <0x16040000 0x230>;
> +
> +      clocks = <&cpg CPG_MOD R9A09G057_ISP0_PCLK>,
> +      <&cpg CPG_MOD R9A09G057_ISP0_VIN_ACLK>,
> +      <&cpg CPG_MOD R9A09G057_ISP0_SCLK>;

Misaligned, should be aligned to < (see DTS coding style).

> +      clock-names = "pclk", "vin_aclk", "sclk";
> +
> +      resets = <&cpg R9A09G057_ISP_0_PRESETN>,
> +      <&cpg R9A09G057_ISP_0_VIN_ARESETN>,

Same here

> +      <&cpg R9A09G057_ISP_0_ISP_SRESETN>;
> +      reset-names = "presetn", "vin_aresetn", "sresetn";
> +
> +      interrupts = <GIC_SPI 861 IRQ_TYPE_EDGE_RISING>;
> +
> +      status = "okay";

Drop

These are nits, so normally would qualify for review, but maybe I
missed something since it fails testing.

Best regards,
Krzysztof
Biju Das May 20, 2025, 6:55 a.m. UTC | #2
Hi Daniel,

Thanks for the patch.

> -----Original Message-----
> From: Daniel Scally <dan.scally@ideasonboard.com>


> Subject: [PATCH 1/3] dt-bindings: media: Add bindings for the RZ/V2H IVC block
> 
> The RZ/V2H SoC has a block called the Input Video Control block which feeds image data into the Image
> Signal Processor. Add dt bindings to describe the IVC.
> 
> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
> ---
>  .../bindings/media/renesas,rzv2h-ivc.yaml     | 99 +++++++++++++++++++
>  1 file changed, 99 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/renesas,rzv2h-ivc.yaml
> 
> diff --git a/Documentation/devicetree/bindings/media/renesas,rzv2h-ivc.yaml
> b/Documentation/devicetree/bindings/media/renesas,rzv2h-ivc.yaml
> new file mode 100644
> index 000000000000..29d522f7d365
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/renesas,rzv2h-ivc.yaml
> @@ -0,0 +1,99 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/media/renesas,rzv2h-ivc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas RZ/V2H Input Video Control Block
> +
> +maintainers:
> +  - Daniel Scally <dan.scally@ideasonboard.com>
> +
> +description:
> +  The IVC block is a module that takes video frames from memory and
> +feeds them
> +  to the Image Signal Processor for processing.
> +
> +properties:
> +  compatible:
> +    const: renesas,r9a09g057-ivc
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    items:
> +      - description: Input Video Control block register access clock
> +      - description: Video input data AXI bus clock
> +      - description: ISP system clock
> +
> +  clock-names:
> +    items:
> +      - const: pclk
> +      - const: vin_aclk
> +      - const: sclk


power-domains:
	maxItems: 1 ??


> +
> +  resets:
> +    items:
> +      - description: Input Video Control block register access reset
> +      - description: Video input data AXI bus reset
> +      - description: ISP core reset
> +
> +  reset-names:
> +    items:
> +      - const: presetn
> +      - const: vin_aresetn
> +      - const: sresetn
> +
> +  port:
> +    $ref: /schemas/graph.yaml#/properties/port
> +    description: Output parallel video bus
> +
> +    properties:
> +      endpoint:
> +        $ref: /schemas/graph.yaml#/properties/endpoint
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names

- power-domains ??


> +  - resets
> +  - reset-names
> +  - port
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/renesas,r9a09g057-cpg.h>
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +    ivc: ivc@16040000 {
> +      compatible = "renesas,r9a09g057-ivc";
> +      reg = <0x16040000 0x230>;
> +
> +      clocks = <&cpg CPG_MOD R9A09G057_ISP0_PCLK>,
> +      <&cpg CPG_MOD R9A09G057_ISP0_VIN_ACLK>,
> +      <&cpg CPG_MOD R9A09G057_ISP0_SCLK>;
> +      clock-names = "pclk", "vin_aclk", "sclk";

power-domains??

Cheers,
Biju

> +
> +      resets = <&cpg R9A09G057_ISP_0_PRESETN>,
> +      <&cpg R9A09G057_ISP_0_VIN_ARESETN>,
> +      <&cpg R9A09G057_ISP_0_ISP_SRESETN>;
> +      reset-names = "presetn", "vin_aresetn", "sresetn";
> +
> +      interrupts = <GIC_SPI 861 IRQ_TYPE_EDGE_RISING>;
> +
> +      status = "okay";
> +
> +      port {
> +        ivc_out: endpoint {
> +          remote-endpoint = <&isp_in>;
> +        };
> +      };
> +    };
> +...
> --
> 2.34.1
>