Re: [PATCH v4 2/3] media: platform: Add Renesas Input Video Control block driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dan,

On Thu, Jul 24, 2025 at 7:04 PM Dan Scally <dan.scally@xxxxxxxxxxxxxxxx> wrote:
>
> Hi Prabhakar - thanks for the review
>
> On 24/07/2025 17:52, Lad, Prabhakar wrote:
> > Hi Daniel,
> >
> > Thank you for the patch.
> >
> > On Mon, Jul 14, 2025 at 4:25 PM Daniel Scally
> > <dan.scally@xxxxxxxxxxxxxxxx> wrote:
> >> Add a driver for the Input Video Control block in an RZ/V2H SoC which
> >> feeds data into the Arm Mali-C55 ISP.
> >>
> > s/V2H/V2HP everywhere.
> Ack!
> >> Signed-off-by: Daniel Scally <dan.scally@xxxxxxxxxxxxxxxx>
> >> ---
> >> Changes in v5:
> >>
> >>          - Fixed .enum_frame_sizes() to properly check that the
> >>            given mbus_code matches the source pads format.
> >>          - Tidy up extra space in Kconfig
> >>          - Revise Kconfig option message
> >>          - Don't mark functions inline
> >>          - Fixup misleading comment
> >>          - select CONFIG_PM
> >>          - Use the new pm_sleep_ptr() functionality
> >>          - Minor formatting
> >>
> >> Changes in v4:
> >>
> >>          - Update the compatible to renesas,r9a09g057-ivc
> >>          - Dropped the media jobs / scheduler functionality, and re
> >>            worked the driver to have its own workqueue pushing frames
> >>          - Fix .enum_mbus_code() to return 20-bit output for source
> >>            pad.
> >>          - Fix some alignment issues
> >>          - Make the forwarding of sink to source pad format a more
> >>            explicit operation.
> >>          - Rename rzv2h_initialise_video_device_and_queue()
> >>          - Reversed order of v4l2_subdev_init_finalize() and
> >>            v4l2_async_register_subdev() to make sure everything is
> >>            finished initialising before registering the subdev.
> >>          - Change function to MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER
> >>          - Use a parametised macro for min vblank
> >>          - Minor formatting
> >>          - Use the DEFAULT macros for quantization / ycbcr_enc values
> >>          - Switch to using the mplane API
> >>          - Dropped select RESET_CONTROLLER
> >>          - Used the new helpers for starting a media pipeline
> >>          - Switch from threaded irq to normal with driver workqueue
> >>            and revised startup routine
> >>
> >> Changes in v3:
> >>
> >>          - Account for the renamed CRU pixel formats
> >>
> >> Changes in v2:
> >>
> >>          - Added selects and depends statements to Kconfig entry
> >>          - Fixed copyright year
> >>          - Stopped including in .c files headers already included in .h
> >>          - Fixed uninitialized variable in iterator
> >>          - Only check vvalid member in interrupt function and wait
> >>            unconditionally elsewhere
> >>          - __maybe_unused for the PM ops
> >>          - Initialise the subdevice after setting up PM
> >>          - Fixed the remove function for the driver to actually do
> >>            something.
> >>          - Some minor formatting changes
> >>          - Fixed the quantization member for the format
> >>          - Changes accounting for the v2 of the media jobs framework
> >>          - Change min_queued_buffers to 0
> >> ---
> >>   drivers/media/platform/renesas/Kconfig             |   1 +
> >>   drivers/media/platform/renesas/Makefile            |   1 +
> >>   drivers/media/platform/renesas/rzv2h-ivc/Kconfig   |  18 +
> >>   drivers/media/platform/renesas/rzv2h-ivc/Makefile  |   5 +
> >>   .../platform/renesas/rzv2h-ivc/rzv2h-ivc-dev.c     | 229 +++++++++
> >>   .../platform/renesas/rzv2h-ivc/rzv2h-ivc-subdev.c  | 376 ++++++++++++++
<snip>
> > ISP Probe:
> > [   11.600383] mali-c55 16080000.isp: Detected Mali-C55 ISP 9000043.31032022.0
> > [   11.622062] mali-c55 16080000.isp: Runtime PM usage count underflow!
> >
> > Logs from IVC:
> > root@rzv2h-evk:~/c55# media-ctl -p
> > Media controller API version 6.16.0
> >
> > Media device information
> > ------------------------
> > driver          mali-c55
> > model           ARM Mali-C55 ISP
> > serial
> > bus info        platform:16080000.isp
> > hw revision     0x1d982d6
> > driver version  6.16.0
> >
> > Device topology
> > - entity 1: mali-c55 tpg (1 pad, 1 link, 0 routes)
> >              type V4L2 subdev subtype Sensor flags 0
> >              device node name /dev/v4l-subdev0
> >          pad0: SOURCE
> >                  [stream:0 fmt:SRGGB20_1X20/1920x1080 field:none
> > colorspace:raw xfer:none ycbcr:601 quantization:lim-range]
> >                  -> "mali-c55 isp":0 []
> >
> > - entity 3: mali-c55 isp (5 pads, 6 links, 0 routes)
> >              type V4L2 subdev subtype Unknown flags 0
> >              device node name /dev/v4l-subdev1
> >          pad0: SINK,MUST_CONNECT
> >                  [stream:0 fmt:SGRBG20_1X20/2304x1296 field:none
> > colorspace:raw xfer:none ycbcr:601 quantization:lim-range
> >                   crop:(0,0)/2304x1296]
> >                  <- "mali-c55 tpg":0 []
> >                  <- "rzv2h ivc block":1 [ENABLED]
> >          pad1: SOURCE
> >                  [stream:0 fmt:RGB121212_1X36/2304x1296 field:none
> > colorspace:srgb xfer:none ycbcr:601 quantization:lim-range]
> >                  -> "mali-c55 resizer fr":0 [ENABLED,IMMUTABLE]
> >          pad2: SOURCE
> >                  [stream:0 fmt:SGRBG20_1X20/2304x1296 field:none
> > colorspace:raw xfer:none ycbcr:601 quantization:lim-range]
> >                  -> "mali-c55 resizer fr":2 [ENABLED,IMMUTABLE]
> >          pad3: SOURCE
> >                  [stream:0 fmt:unknown/0x0 field:none]
> >                  -> "mali-c55 3a stats":0 []
> >          pad4: SINK
> >                  [stream:0 fmt:unknown/0x0 field:none]
> >                  <- "mali-c55 3a params":0 []
> >
> > - entity 9: mali-c55 resizer fr (3 pads, 3 links, 0 routes)
> >              type V4L2 subdev subtype Unknown flags 0
> >              device node name /dev/v4l-subdev2
> >          pad0: SINK
> >                  [stream:0 fmt:RGB121212_1X36/2304x1296 field:none
> > colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range
> >                   crop:(0,0)/2304x1296
> >                   compose:(0,0)/2304x1296]
> >                  <- "mali-c55 isp":1 [ENABLED,IMMUTABLE]
> >          pad1: SOURCE
> >                  [stream:0 fmt:RGB121212_1X36/2304x1296 field:none
> > colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
> >                  -> "mali-c55 fr":0 [ENABLED]
> >          pad2: SINK
> >                  <- "mali-c55 isp":2 [ENABLED,IMMUTABLE]
> >
> > - entity 13: mali-c55 fr (1 pad, 1 link)
> >               type Node subtype V4L flags 0
> >               device node name /dev/video0
> >          pad0: SINK
> >                  <- "mali-c55 resizer fr":1 [ENABLED]
> >
> > - entity 17: mali-c55 3a params (1 pad, 1 link)
> >               type Node subtype V4L flags 0
> >               device node name /dev/video1
> >          pad0: SOURCE
> >                  -> "mali-c55 isp":4 []
> >
> > - entity 21: mali-c55 3a stats (1 pad, 1 link)
> >               type Node subtype V4L flags 0
> >               device node name /dev/video2
> >          pad0: SINK
> >                  <- "mali-c55 isp":3 []
> >
> > - entity 37: rzv2h ivc block (2 pads, 2 links, 0 routes)
> >               type V4L2 subdev subtype Unknown flags 0
> >               device node name /dev/v4l-subdev3
> >          pad0: SINK
> >                  [stream:0 fmt:SGRBG10_1X10/2304x1296 field:none
> > colorspace:raw xfer:none ycbcr:601 quantization:full-range]
> >                  <- "rzv2h-ivc":0 [ENABLED,IMMUTABLE]
> >          pad1: SOURCE
> >                  [stream:0 fmt:SGRBG20_1X20/2304x1296 field:none
> > colorspace:raw xfer:none ycbcr:601 quantization:full-range]
> >                  -> "mali-c55 isp":0 [ENABLED]
> >
> > - entity 40: rzv2h-ivc (1 pad, 1 link)
> >               type Node subtype V4L flags 0
> >               device node name /dev/video3
> >          pad0: SOURCE
> >                  -> "rzv2h ivc block":0 [ENABLED,IMMUTABLE]
> >
> > root@rzv2h-evk:~/c55#
> > root@rzv2h-evk:~# v4l2-ctl -d3 --stream-out-mmap
> > --stream-from=/root/c55/frame-15.bin --stream-loop
> >>>>> VIDIOC_STREAMON returned -1 (Input/output error)
> > root@rzv2h-evk:~#
> >
> > Logs from ISP:
> > root@rzv2h-evk:~/c55# ./isp.sh
> > Device /dev/video0 opened.
> > Device `ARM Mali-C55 ISP' on `platform:16080000.isp' (driver
> > 'mali-c55') supports video, capture, with mplanes.
> > Video format set: RGB565 (50424752) 2304x1296 field none, 1 planes:
> >   * Stride 4608, buffer size 5971968
> > Video format: RGB565 (50424752) 2304x1296 field none, 1 planes:
> >   * Stride 4608, buffer size 5971968
> > 8 buffers requested.
> > length: 1 offset: 4017363672 timestamp type/source: mono/EoF
> > Buffer 0/0 mapped at address 0xffff81f2e000.
> > length: 1 offset: 4017363672 timestamp type/source: mono/EoF
> > Buffer 1/0 mapped at address 0xffff8197c000.
> > length: 1 offset: 4017363672 timestamp type/source: mono/EoF
> > Buffer 2/0 mapped at address 0xffff813ca000.
> > length: 1 offset: 4017363672 timestamp type/source: mono/EoF
> > Buffer 3/0 mapped at address 0xffff80e18000.
> > length: 1 offset: 4017363672 timestamp type/source: mono/EoF
> > Buffer 4/0 mapped at address 0xffff80866000.
> > length: 1 offset: 4017363672 timestamp type/source: mono/EoF
> > Buffer 5/0 mapped at address 0xffff802b4000.
> > length: 1 offset: 4017363672 timestamp type/source: mono/EoF
> > Buffer 6/0 mapped at address 0xffff7fd02000.
> > length: 1 offset: 4017363672 timestamp type/source: mono/EoF
> > Buffer 7/0 mapped at address 0xffff7f750000.
> > [   92.647719] kauditd_printk_skb: 8 callbacks suppressed
> > [   92.647734] audit: type=1006 audit(1753371566.385:25): pid=407
> > uid=0 old-auid=4294967295 auid=0 tty=(none) old-ses=4294967295 ses=4
> > res=1
> > [   92.665263] audit: type=1300 audit(1753371566.385:25):
> > arch=c00000b7 syscall=64 success=yes exit=1 a0=7 a1=ffffc4ff5740 a2=1
> > a3=1 items=0 ppid=1 pid=407 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0
> > egid=0 sgid=0 fsgid=0 tty=(none) ses=4 comm="sshd"
> > exe="/usr/sbin/sshd" key=(null)
> > [   92.689604] audit: type=1327 audit(1753371566.385:25):
> > proctitle=737368643A20726F6F74205B707269765D
> >
> > [  100.932191] rz-dmac 11400000.dma-controller: dma_sync_wait: timeout!
> > [  100.938566] mali-c55 16080000.isp: Failed to DMA xfer ISP config
> > [  100.944702] mali-c55 16080000.isp: failed to write ISP config
> > [  100.950562] mali-c55 16080000.isp: Failed to start ISP
>
>
> Hm, Is this on the EVK? How did you set up devicetree?  It's trying to use the DMA write; I've so
> far just been using CPU write on the RZ/V2H...I'll try to replicate it and see where I get
>
>
Yes this is on the EVK. I have the changes [0] done to get it working
(Ive not enabled the DMA).

[0] https://gist.github.com/prabhakarlad/bb1d3649243617d88c9b4e8b386f0803

Cheers,
Prabhakar





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux