Add StarFive Camera Subsystem driver
Subsystems (3)
v9 cover Add StarFive Camera Subsystem driver
Hi,
This series is the v9 series that attempts to support the Camera Subsystem found on StarFive JH7110 SoC.
This series is based on top of the master branch of media_stage repository.
The following are the media graph for the device and the v4l2-compliance output.
===========================================================================
[the media graph]:
digraph board {
rankdir=TB
n00000001 [label="{{<port0> 0} | stf_isp\n/dev/v4l-subdev0 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n00000001:port1 -> n00000008 [style=dashed]
n00000004 [label="capture_raw\n/dev/video0", shape=box, style=filled, fillcolor=yellow]
n00000008 [label="capture_yuv\n/dev/video1", shape=box, style=filled, fillcolor=yellow]
n0000000e [label="{{<port0> 0} | cdns_csi2rx.19800000.csi-bridge\n | {<port1> 1 | <port2> 2 | <port3> 3 | <port4> 4}}", shape=Mrecord, style=filled, fillcolor=green]
n0000000e:port1 -> n00000001:port0 [style=dashed]
n0000000e:port1 -> n00000004 [style=dashed]
n00000018 [label="{{} | imx219 6-0010\n/dev/v4l-subdev1 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green]
n00000018:port0 -> n0000000e:port0 [style=bold]
}[the device topology]:
Media controller API version 6.5.0
Media device information
------------------------
driver starfive-camss
model Starfive Camera Subsystem
serial
bus info platform:19840000.camss hw revision 0x0 driver version 6.5.0
Device topology
- entity 1: stf_isp (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
pad0: Sink
[fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb
crop.bounds:(0,0)/1920x1080
crop:(0,0)/1920x1080]
<- "cdns_csi2rx.19800000.csi-bridge":1 []
pad1: Source
[fmt:YUYV8_1_5X8/1920x1080 field:none colorspace:srgb
crop.bounds:(0,0)/1920x1080
crop:(0,0)/1920x1080]
-> "capture_yuv":0 []- entity 4: capture_raw (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video0
pad0: Sink
<- "cdns_csi2rx.19800000.csi-bridge":1 []
- entity 8: capture_yuv (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video1
pad0: Sink
<- "stf_isp":1 []
- entity 14: cdns_csi2rx.19800000.csi-bridge (5 pads, 3 links)
type V4L2 subdev subtype Unknown flags 0 pad0: Sink <- "imx219 6-0010":0 [ENABLED,IMMUTABLE] pad1: Source -> "stf_isp":0 [] -> "capture_raw":0 [] pad2: Source pad3: Source pad4: Source
- entity 24: imx219 6-0010 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev1
pad0: Source
[fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range
crop.bounds:(8,8)/3280x2464
crop:(8,8)/3280x2464]
-> "cdns_csi2rx.19800000.csi-bridge":0 [ENABLED,IMMUTABLE]===========================================================================
[the v4l2-compliance output]:
v4l2-compliance 1.24.1, 64 bits, 64-bit time_t
Compliance test for stf camss device /dev/video1:
Driver Info:
Driver name : stf camss Card type : Starfive Camera Subsystem Bus info : platform:19840000.camss Driver version : 6.5.0 Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : starfive-camss Model : Starfive Camera Subsystem Serial : Bus info : platform:19840000.camss Media version : 6.5.0 Hardware revision: 0x00000000 (0) Driver version : 6.5.0 Interface Info: ID : 0x0300000a Type : V4L Video Entity Info: ID : 0x00000008 (8) Name : capture_yuv Function : V4L2 I/O Pad 0x01000009 : 0: Sink Link 0x0200000c: from remote pad 0x1000003 of entity 'stf_isp' (Unknown Function (00004009)): Data, Enabled
Required ioctls:
test MC information (see 'Media Driver Info' above): OK test VIDIOC_QUERYCAP: OK
test invalid ioctls: OK
Allow for multiple opens:
test second /dev/video1 open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK
Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported) test VIDIOC_LOG_STATUS: OK (Not Supported)
Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported) test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0
Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0
Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported)
Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported) test VIDIOC_QUERYCTRL: OK (Not Supported)
test VIDIOC_G/S_CTRL: OK (Not Supported)
test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported) test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported) test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 0 Private Controls: 0
Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK test VIDIOC_G/S_PARM: OK (Not Supported) test VIDIOC_G_FBUF: OK (Not Supported) test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported) test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK
Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test VIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)
Test input 0:
Streaming ioctls:
test read/write: OK (Not Supported)
test blocking wait: OK
test MMAP (no poll): OK
test MMAP (select): OK
test MMAP (epoll): OK
test USERPTR (no poll): OK (Not Supported) test USERPTR (select): OK (Not Supported) test DMABUF: Cannot test, specify --expbuf-device
Total for stf camss device /dev/video1: 53, Succeeded: 53, Failed: 0, Warnings: 0
===========================================================================
Changes in v9:
- Rebased on top of the master branch of media_stage repository.
- Renamed file name.
- Added of_node_put(node) in the error handling path of stfcamss_of_parse_ports().
v8 link: https://lore.kernel.org/all/[email protected]/
Changes in v8:
- Rebased on v6.5-rc7.
- Dropped VIN subdev.
- Created two new video devices: capture_raw and capture_yuv, to replace the previous video devices.
- Dropped VB2_READ io methods.
- Recursively called .s_stream() on subdevs.
v7 link: https://lore.kernel.org/all/[email protected]/
Changes in v7:
- HAS_DMA is used instead of DMA_CMA in Kconfig.
- Dropped some non-essential member variables.
- Used v4l2_async_nf_add_fwnode_remote() to simplify the relevant code.
- Modified some Local variable types in the function.
- Used v4l2_create_fwnode_links_to_pad() to simplify the relevant code.
- Added error handling for clk_prepare_enable().
- Simplified stfcamss_format_info struct and modified the relevant code.
- Dropped enum_input, g_input and s_input.
- Unified v4l2_ioctl_ops struct.
- Used v4l2_fh_open()/vb2_fop_release to replace deprecated APIs.
- Added a camss directory under the starfive directory and modified the patch title.
v6 link: https://lore.kernel.org/all/[email protected]/
Changes in v6:
- Added 'bus-type' in bindings example.
- Corrected spelling errors.
- As reviewed by Bryan, used 'nclks' and 'nrsts' variables.
- Added lccf config for ISP.
v5 link: https://lore.kernel.org/all/[email protected]/
Changes in v5:
- Rebased on v6.4-rc1.
- Added new patch.
- Modified ISP driver.
v4 link: https://lore.kernel.org/all/[email protected]/
Previous cover letter from v4:
This patch series adds support for the StarFive Camera Subsystem found on StarFive JH7110 SoC.
The driver implements V4L2, Media controller and V4L2 subdev interfaces. Camera sensor using V4L2 subdev interface in the kernel is supported.
The driver is tested on VisionFive V2 board with IMX219 camera sensor. GStreamer 1.18.5 with v4l2src plugin is supported.
Previous version link, missing v1 version:
v3: https://lore.kernel.org/all/[email protected]/
v2: https://lore.kernel.org/all/[email protected]/
Jack Zhu (8):
media: dt-bindings: Add JH7110 Camera Subsystem
media: admin-guide: Add starfive_camss.rst for Starfive Camera
Subsystem
media: staging: media: starfive: camss: Add core driver
media: staging: media: starfive: camss: Add video driver
media: staging: media: starfive: camss: Add ISP driver
media: staging: media: starfive: camss: Add capture driver
media: staging: media: starfive: camss: Add interrupt handling
media: staging: media: starfive: camss: Register devices
.../admin-guide/media/starfive_camss.rst | 72 +++ .../media/starfive_camss_graph.dot | 12 + .../admin-guide/media/v4l-drivers.rst | 1 + .../bindings/media/starfive,jh7110-camss.yaml | 180 ++++++ MAINTAINERS | 9 + drivers/staging/media/Kconfig | 2 + drivers/staging/media/Makefile | 1 + drivers/staging/media/starfive/Kconfig | 5 + drivers/staging/media/starfive/Makefile | 2 + drivers/staging/media/starfive/camss/Kconfig | 17 + drivers/staging/media/starfive/camss/Makefile | 13 + .../staging/media/starfive/camss/stf-camss.c | 436 +++++++++++++ .../staging/media/starfive/camss/stf-camss.h | 134 ++++ .../media/starfive/camss/stf-capture.c | 603 ++++++++++++++++++ .../media/starfive/camss/stf-capture.h | 87 +++ .../media/starfive/camss/stf-isp-hw-ops.c | 445 +++++++++++++ .../staging/media/starfive/camss/stf-isp.c | 407 ++++++++++++ .../staging/media/starfive/camss/stf-isp.h | 428 +++++++++++++ .../staging/media/starfive/camss/stf-video.c | 571 +++++++++++++++++ .../staging/media/starfive/camss/stf-video.h | 100 +++ 20 files changed, 3525 insertions(+) create mode 100644 Documentation/admin-guide/media/starfive_camss.rst create mode 100644 Documentation/admin-guide/media/starfive_camss_graph.dot create mode 100644 Documentation/devicetree/bindings/media/starfive,jh7110-camss.yaml create mode 100644 drivers/staging/media/starfive/Kconfig create mode 100644 drivers/staging/media/starfive/Makefile create mode 100644 drivers/staging/media/starfive/camss/Kconfig create mode 100644 drivers/staging/media/starfive/camss/Makefile create mode 100644 drivers/staging/media/starfive/camss/stf-camss.c create mode 100644 drivers/staging/media/starfive/camss/stf-camss.h create mode 100644 drivers/staging/media/starfive/camss/stf-capture.c create mode 100644 drivers/staging/media/starfive/camss/stf-capture.h create mode 100644 drivers/staging/media/starfive/camss/stf-isp-hw-ops.c create mode 100644 drivers/staging/media/starfive/camss/stf-isp.c create mode 100644 drivers/staging/media/starfive/camss/stf-isp.h create mode 100644 drivers/staging/media/starfive/camss/stf-video.c create mode 100644 drivers/staging/media/starfive/camss/stf-video.h
Signature · 1 line
2.34.1
PATCH v9 1/8 media: dt-bindings: Add JH7110 Camera Subsystem
Add the bindings documentation for Starfive JH7110 Camera Subsystem which is used for handing image sensor data.
--- .../bindings/media/starfive,jh7110-camss.yaml | 180 ++++++++++++++++++ MAINTAINERS | 7 + 2 files changed, 187 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/starfive,jh7110-camss.yaml
Documentation/devicetree/bindings/media/starfive,jh7110-camss.yaml new file +180 -0
@@ -0,0 +1,180 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/starfive,jh7110-camss.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Starfive SoC CAMSS ISP + +maintainers: + - Jack Zhu <[email protected]> + - Changhuang Liang <[email protected]> + +description: + The Starfive CAMSS ISP is a Camera interface for Starfive JH7110 SoC. It + consists of a VIN controller (Video In Controller, a top-level control unit) + and an ISP. + +properties: + compatible: + const: starfive,jh7110-camss + + reg: + maxItems: 2 + + reg-names: + items: + - const: syscon + - const: isp + + clocks: + maxItems: 7 + + clock-names: + items: + - const: apb_func + - const: wrapper_clk_c + - const: dvp_inv + - const: axiwr + - const: mipi_rx0_pxl + - const: ispcore_2x + - const: isp_axi + + resets: + maxItems: 6 + + reset-names: + items: + - const: wrapper_p + - const: wrapper_c + - const: axird + - const: axiwr + - const: isp_top_n + - const: isp_top_axi + + power-domains: + items: + - description: JH7110 ISP Power Domain Switch Controller. + + interrupts: + maxItems: 4 + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + properties: + port@0: + $ref: /schemas/graph.yaml#/$defs/port-base + unevaluatedProperties: false + description: Input port for receiving DVP data. + + properties: + endpoint: + $ref: video-interfaces.yaml# + unevaluatedProperties: false + + properties: + bus-type: + enum: [5, 6] + + bus-width: + enum: [8, 10, 12] + + data-shift: + enum: [0, 2] + default: 0 + + hsync-active: + enum: [0, 1] + default: 1 + + vsync-active: + enum: [0, 1] + default: 1 + + required: + - bus-type + - bus-width + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: Input port for receiving CSI data. + + required: + - port@0 + - port@1 + +required: + - compatible + - reg + - reg-names + - clocks + - clock-names + - resets + - reset-names + - power-domains + - interrupts + - ports + +additionalProperties: false + +examples: + - | + isp@19840000 { + compatible = "starfive,jh7110-camss"; + reg = <0x19840000 0x10000>, + <0x19870000 0x30000>; + reg-names = "syscon", "isp"; + clocks = <&ispcrg 0>, + <&ispcrg 13>, + <&ispcrg 2>, + <&ispcrg 12>, + <&ispcrg 1>, + <&syscrg 51>, + <&syscrg 52>; + clock-names = "apb_func", + "wrapper_clk_c", + "dvp_inv", + "axiwr", + "mipi_rx0_pxl", + "ispcore_2x", + "isp_axi"; + resets = <&ispcrg 0>, + <&ispcrg 1>, + <&ispcrg 10>, + <&ispcrg 11>, + <&syscrg 41>, + <&syscrg 42>; + reset-names = "wrapper_p", + "wrapper_c", + "axird", + "axiwr", + "isp_top_n", + "isp_top_axi"; + power-domains = <&pwrc 5>; + interrupts = <92>, <87>, <88>, <90>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + vin_from_sc2235: endpoint { + remote-endpoint = <&sc2235_to_vin>; + bus-type = <5>; + bus-width = <8>; + data-shift = <2>; + hsync-active = <1>; + vsync-active = <0>; + pclk-sample = <1>; + }; + }; + + port@1 { + reg = <1>; + vin_from_csi2rx: endpoint { + remote-endpoint = <&csi2rx_to_vin>; + }; + }; + }; + };
MAINTAINERS +7 -0
@@ -20263,6 +20263,13 @@ M: Ion Badulescu <[email protected]> S: Odd Fixes F: drivers/net/ethernet/adaptec/starfire* +STARFIVE CAMERA SUBSYSTEM DRIVER +M: Jack Zhu <[email protected]> +M: Changhuang Liang <[email protected]> +L: [email protected] +S: Maintained +F: Documentation/devicetree/bindings/media/starfive,jh7110-camss.yaml + STARFIVE CRYPTO DRIVER M: Jia Jie Ho <[email protected]> M: William Qiu <[email protected]>
Signature · 1 line
2.34.1
PATCH v9 2/8 media: admin-guide: Add starfive_camss.rst for Starfive Camera Subsystem
In reply to Jack ZhuAdd starfive_camss.rst file that documents the Starfive Camera Subsystem driver which is used for handing image sensor data.
--- .../admin-guide/media/starfive_camss.rst | 72 +++++++++++++++++++ .../media/starfive_camss_graph.dot | 12 ++++ .../admin-guide/media/v4l-drivers.rst | 1 + MAINTAINERS | 1 + 4 files changed, 86 insertions(+) create mode 100644 Documentation/admin-guide/media/starfive_camss.rst create mode 100644 Documentation/admin-guide/media/starfive_camss_graph.dot
Documentation/admin-guide/media/starfive_camss.rst new file +72 -0
@@ -0,0 +1,72 @@ +.. SPDX-License-Identifier: GPL-2.0 + +.. include:: <isonum.txt> + +================================ +Starfive Camera Subsystem driver +================================ + +Introduction +------------ + +This file documents the driver for the Starfive Camera Subsystem found on +Starfive JH7110 SoC. The driver is located under drivers/staging/media/starfive/ +camss. + +The driver implements V4L2, Media controller and v4l2_subdev interfaces. Camera +sensor using V4L2 subdev interface in the kernel is supported. + +The driver has been successfully used on the Gstreamer 1.18.5 with v4l2src +plugin. + + +Starfive Camera Subsystem hardware +---------------------------------- + +The Starfive Camera Subsystem hardware consists of:: + + |\ +---------------+ +-----------+ + +----------+ | \ | | | | + | | | | | | | | + | MIPI |----->| |----->| ISP |----->| | + | | | | | | | | + +----------+ | | | | | Memory | + |MUX| +---------------+ | Interface | + +----------+ | | | | + | | | |---------------------------->| | + | Parallel |----->| | | | + | | | | | | + +----------+ | / | | + |/ +-----------+ + +- MIPI: The MIPI interface, receiving data from a MIPI CSI-2 camera sensor. + +- Parallel: The parallel interface, receiving data from a parallel sensor. + +- ISP: The ISP, processing raw Bayer data from an image sensor and producing + YUV frames. + + +Topology +-------- + +The media controller pipeline graph is as follows: + +.. _starfive_camss_graph: + +.. kernel-figure:: starfive_camss_graph.dot + :alt: starfive_camss_graph.dot + :align: center + +The driver has 2 video devices: + +- capture_raw: The capture device, capturing image data directly from a sensor. +- capture_yuv: The capture device, capturing YUV frame data processed by the + ISP module + +The driver has 3 subdevices: + +- stf_isp: is responsible for all the isp operations, outputs YUV frames. +- cdns_csi2rx: a CSI-2 bridge supporting up to 4 CSI lanes in input, and 4 + different pixel streams in output. +- imx219: an image sensor, image data is sent through MIPI CSI-2.
Documentation/admin-guide/media/starfive_camss_graph.dot new file +12 -0
@@ -0,0 +1,12 @@ +digraph board { + rankdir=TB + n00000001 [label="{{<port0> 0} | stf_isp\n/dev/v4l-subdev0 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green] + n00000001:port1 -> n00000008 [style=dashed] + n00000004 [label="capture_raw\n/dev/video0", shape=box, style=filled, fillcolor=yellow] + n00000008 [label="capture_yuv\n/dev/video1", shape=box, style=filled, fillcolor=yellow] + n0000000e [label="{{<port0> 0} | cdns_csi2rx.19800000.csi-bridge\n | {<port1> 1 | <port2> 2 | <port3> 3 | <port4> 4}}", shape=Mrecord, style=filled, fillcolor=green] + n0000000e:port1 -> n00000001:port0 [style=dashed] + n0000000e:port1 -> n00000004 [style=dashed] + n00000018 [label="{{} | imx219 6-0010\n/dev/v4l-subdev1 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green] + n00000018:port0 -> n0000000e:port0 [style=bold] +}
Documentation/admin-guide/media/v4l-drivers.rst +1 -0
@@ -27,6 +27,7 @@ Video4Linux (V4L) driver-specific documentation si470x si4713 si476x + starfive_camss vimc visl vivid
MAINTAINERS +1 -0
@@ -20268,6 +20268,7 @@ M: Jack Zhu <[email protected]> M: Changhuang Liang <[email protected]> L: [email protected] S: Maintained +F: Documentation/admin-guide/media/starfive_camss.rst F: Documentation/devicetree/bindings/media/starfive,jh7110-camss.yaml STARFIVE CRYPTO DRIVER
Signature · 1 line
2.34.1
PATCH v9 3/8 media: staging: media: starfive: camss: Add core driver
In reply to Jack ZhuAdd core driver for StarFive Camera Subsystem. The code parses the device platform resources and registers related devices.
--- MAINTAINERS | 1 + drivers/staging/media/Kconfig | 2 + drivers/staging/media/Makefile | 1 + drivers/staging/media/starfive/Kconfig | 5 + drivers/staging/media/starfive/Makefile | 2 + drivers/staging/media/starfive/camss/Kconfig | 17 + drivers/staging/media/starfive/camss/Makefile | 9 + .../staging/media/starfive/camss/stf-camss.c | 320 ++++++++++++++++++ .../staging/media/starfive/camss/stf-camss.h | 129 +++++++ 9 files changed, 486 insertions(+) create mode 100644 drivers/staging/media/starfive/Kconfig create mode 100644 drivers/staging/media/starfive/Makefile create mode 100644 drivers/staging/media/starfive/camss/Kconfig create mode 100644 drivers/staging/media/starfive/camss/Makefile create mode 100644 drivers/staging/media/starfive/camss/stf-camss.c create mode 100644 drivers/staging/media/starfive/camss/stf-camss.h
MAINTAINERS +1 -0
@@ -20270,6 +20270,7 @@ L: [email protected] S: Maintained F: Documentation/admin-guide/media/starfive_camss.rst F: Documentation/devicetree/bindings/media/starfive,jh7110-camss.yaml +F: drivers/staging/media/starfive/camss STARFIVE CRYPTO DRIVER M: Jia Jie Ho <[email protected]>
drivers/staging/media/Kconfig +2 -0
@@ -36,6 +36,8 @@ source "drivers/staging/media/omap4iss/Kconfig" source "drivers/staging/media/rkvdec/Kconfig" +source "drivers/staging/media/starfive/Kconfig" + source "drivers/staging/media/sunxi/Kconfig" source "drivers/staging/media/tegra-video/Kconfig"
drivers/staging/media/Makefile +1 -0
@@ -6,6 +6,7 @@ obj-$(CONFIG_VIDEO_MAX96712) += max96712/ obj-$(CONFIG_VIDEO_MESON_VDEC) += meson/vdec/ obj-$(CONFIG_VIDEO_OMAP4) += omap4iss/ obj-$(CONFIG_VIDEO_ROCKCHIP_VDEC) += rkvdec/ +obj-$(CONFIG_VIDEO_STARFIVE_CAMSS) += starfive/ obj-$(CONFIG_VIDEO_SUNXI) += sunxi/ obj-$(CONFIG_VIDEO_TEGRA) += tegra-video/ obj-$(CONFIG_VIDEO_IPU3_IMGU) += ipu3/
drivers/staging/media/starfive/Kconfig new file +5 -0
@@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + +comment "StarFive media platform drivers" + +source "drivers/staging/media/starfive/camss/Kconfig"
drivers/staging/media/starfive/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +obj-y += camss/
drivers/staging/media/starfive/camss/Kconfig new file +17 -0
@@ -0,0 +1,17 @@ +# SPDX-License-Identifier: GPL-2.0-only +config VIDEO_STARFIVE_CAMSS + tristate "Starfive Camera Subsystem driver" + depends on V4L_PLATFORM_DRIVERS + depends on VIDEO_DEV && OF + depends on HAS_DMA + depends on PM + select MEDIA_CONTROLLER + select VIDEO_V4L2_SUBDEV_API + select VIDEOBUF2_DMA_CONTIG + select V4L2_FWNODE + help + Enable this to support for the Starfive Camera subsystem + found on Starfive JH7110 SoC. + + To compile this driver as a module, choose M here: the + module will be called starfive-camss.
drivers/staging/media/starfive/camss/Makefile new file +9 -0
@@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for StarFive Camera Subsystem driver +# + +starfive-camss-objs += \ + stf-camss.o + +obj-$(CONFIG_VIDEO_STARFIVE_CAMSS) += starfive-camss.o
drivers/staging/media/starfive/camss/stf-camss.c new file +320 -0
320 lines not on this page · raw message
drivers/staging/media/starfive/camss/stf-camss.h new file +129 -0
129 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v9 4/8 media: staging: media: starfive: camss: Add video driver
In reply to Jack ZhuAdd video driver for StarFive Camera Subsystem.
--- drivers/staging/media/starfive/camss/Makefile | 3 +- .../staging/media/starfive/camss/stf-video.c | 571 ++++++++++++++++++ .../staging/media/starfive/camss/stf-video.h | 100 +++ 3 files changed, 673 insertions(+), 1 deletion(-) create mode 100644 drivers/staging/media/starfive/camss/stf-video.c create mode 100644 drivers/staging/media/starfive/camss/stf-video.h
drivers/staging/media/starfive/camss/Makefile +2 -1
@@ -4,6 +4,7 @@ # starfive-camss-objs += \ - stf-camss.o + stf-camss.o \ + stf-video.o obj-$(CONFIG_VIDEO_STARFIVE_CAMSS) += starfive-camss.o
drivers/staging/media/starfive/camss/stf-video.c new file +571 -0
571 lines not on this page · raw message
drivers/staging/media/starfive/camss/stf-video.h new file +100 -0
100 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v9 5/8 media: staging: media: starfive: camss: Add ISP driver
In reply to Jack ZhuAdd ISP driver for StarFive Camera Subsystem.
--- drivers/staging/media/starfive/camss/Makefile | 2 + .../staging/media/starfive/camss/stf-camss.h | 3 + .../media/starfive/camss/stf-isp-hw-ops.c | 445 ++++++++++++++++++ .../staging/media/starfive/camss/stf-isp.c | 407 ++++++++++++++++ .../staging/media/starfive/camss/stf-isp.h | 428 +++++++++++++++++ 5 files changed, 1285 insertions(+) create mode 100644 drivers/staging/media/starfive/camss/stf-isp-hw-ops.c create mode 100644 drivers/staging/media/starfive/camss/stf-isp.c create mode 100644 drivers/staging/media/starfive/camss/stf-isp.h
drivers/staging/media/starfive/camss/Makefile +2 -0
@@ -5,6 +5,8 @@ starfive-camss-objs += \ stf-camss.o \ + stf-isp.o \ + stf-isp-hw-ops.o \ stf-video.o obj-$(CONFIG_VIDEO_STARFIVE_CAMSS) += starfive-camss.o
drivers/staging/media/starfive/camss/stf-camss.h +3 -0
@@ -18,6 +18,8 @@#include <media/v4l2-async.h> #include <media/v4l2-device.h> +#include "stf-isp.h" +enum stf_port_num {STF_PORT_DVP =0 ,STF_PORT_CSI2RX
@@ -49,6 +51,7 @@ struct stfcamss {struct media_device media_dev;struct media_pipeline pipe;struct device *dev; +struct stf_isp_dev isp_dev;struct v4l2_async_notifier notifier;void __iomem *syscon_base;void __iomem *isp_base;
drivers/staging/media/starfive/camss/stf-isp-hw-ops.c new file +445 -0
445 lines not on this page · raw message
drivers/staging/media/starfive/camss/stf-isp.c new file +407 -0
407 lines not on this page · raw message
drivers/staging/media/starfive/camss/stf-isp.h new file +428 -0
428 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v9 6/8 media: staging: media: starfive: camss: Add capture driver
In reply to Jack ZhuAdd capture driver for StarFive Camera Subsystem. It contains two video
devices: capture_yuv and capture_raw.
--- drivers/staging/media/starfive/camss/Makefile | 1 + .../staging/media/starfive/camss/stf-camss.h | 2 + .../media/starfive/camss/stf-capture.c | 603 ++++++++++++++++++ .../media/starfive/camss/stf-capture.h | 87 +++ 4 files changed, 693 insertions(+) create mode 100644 drivers/staging/media/starfive/camss/stf-capture.c create mode 100644 drivers/staging/media/starfive/camss/stf-capture.h
drivers/staging/media/starfive/camss/Makefile +1 -0
@@ -5,6 +5,7 @@ starfive-camss-objs += \ stf-camss.o \ + stf-capture.o \ stf-isp.o \ stf-isp-hw-ops.o \ stf-video.o
drivers/staging/media/starfive/camss/stf-camss.h +2 -0
@@ -19,6 +19,7 @@#include <media/v4l2-device.h> #include "stf-isp.h" +#include "stf-capture.h" enum stf_port_num {STF_PORT_DVP =0 ,
@@ -52,6 +53,7 @@ struct stfcamss {struct media_pipeline pipe;struct device *dev;struct stf_isp_dev isp_dev; +struct stf_capture captures[STF_CAPTURE_NUM ];struct v4l2_async_notifier notifier;void __iomem *syscon_base;void __iomem *isp_base;
drivers/staging/media/starfive/camss/stf-capture.c new file +603 -0
603 lines not on this page · raw message
drivers/staging/media/starfive/camss/stf-capture.h new file +87 -0
87 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v9 7/8 media: staging: media: starfive: camss: Add interrupt handling
In reply to Jack ZhuParse interrupt resources and register interrupt handlers.
--- .../staging/media/starfive/camss/stf-camss.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+)
drivers/staging/media/starfive/camss/stf-camss.c +21 -0
@@ -35,6 +35,12 @@ static const char * const stfcamss_resets[] = { "rst_isp_top_axi", }; +static const struct stf_isr_data stf_isrs[] = { + {"wr_irq" , stf_wr_irq_handler}, + {"isp_irq" , stf_isp_irq_handler}, + {"line_irq" , stf_line_irq_handler}, +}; +static int stfcamss_get_mem_res (struct stfcamss *stfcamss) {struct platform_device *pdev =to_platform_device (stfcamss->dev);
@@ -160,6 +166,21 @@ static int stfcamss_probe(struct platform_device *pdev) stfcamss->dev = dev; +for (i =0 ; i <ARRAY_SIZE (stf_isrs); ++i) { +int irq; + + irq =platform_get_irq (pdev, i); +if (irq <0 ) +return irq; + + ret =devm_request_irq (stfcamss->dev, irq, stf_isrs[i].isr,0 , + stf_isrs[i].name, stfcamss); +if (ret) { +dev_err (dev,"request irq failed: %d\n" , ret); +return ret; + } + } + stfcamss->nclks =ARRAY_SIZE (stfcamss->sys_clk);for (i =0 ; i < stfcamss->nclks; ++i) stfcamss->sys_clk[i].id = stfcamss_clocks[i];
Signature · 1 line
2.34.1
PATCH v9 8/8 media: staging: media: starfive: camss: Register devices
In reply to Jack ZhuRegister ISP sub-device and video devices for StarFive Camera Subsystem.
--- .../staging/media/starfive/camss/stf-camss.c | 97 ++++++++++++++++++- 1 file changed, 96 insertions(+), 1 deletion(-)
drivers/staging/media/starfive/camss/stf-camss.c +96 -1
@@ -123,6 +123,85 @@ static int stfcamss_of_parse_ports(struct stfcamss *stfcamss)return ret; } +static int stfcamss_register_devs (struct stfcamss *stfcamss) +{ +struct stf_capture *cap_yuv = &stfcamss->captures[STF_CAPTURE_YUV ]; +struct stf_isp_dev *isp_dev = &stfcamss->isp_dev; +int ret; + + ret =stf_isp_register (isp_dev, &stfcamss->v4l2_dev); +if (ret <0 ) { +dev_err (stfcamss->dev, +"failed to register stf isp%d entity: %d\n" ,0 , ret); +return ret; + } + + ret =stf_capture_register (stfcamss, &stfcamss->v4l2_dev); +if (ret <0 ) { +dev_err (stfcamss->dev, +"failed to register capture: %d\n" , ret); + goto err_isp_unregister; + } + + ret =media_create_pad_link (&isp_dev->subdev.entity,STF_ISP_PAD_SRC , + &cap_yuv->video.vdev.entity,0 ,0 ); +if (ret) + goto err_cap_unregister; + + cap_yuv->video.source_subdev = &isp_dev->subdev; + +return ret; + +err_cap_unregister: +stf_capture_unregister (stfcamss); +err_isp_unregister: +stf_isp_unregister (&stfcamss->isp_dev); + +return ret; +} + +static void stfcamss_unregister_devs (struct stfcamss *stfcamss) +{ +stf_isp_unregister (&stfcamss->isp_dev); +stf_capture_unregister (stfcamss); +} + +static int stfcamss_subdev_notifier_bound (struct v4l2_async_notifier *async, +struct v4l2_subdev *subdev, +struct v4l2_async_connection *asc) +{ +struct stfcamss *stfcamss = + container_of(async, struct stfcamss, notifier); +struct stfcamss_async_subdev *csd = + container_of(asc, struct stfcamss_async_subdev, asd); +enum stf_port_num port = csd->port; +struct stf_isp_dev *isp_dev = &stfcamss->isp_dev; +struct stf_capture *cap_raw = &stfcamss->captures[STF_CAPTURE_RAW ]; +struct media_pad *pad; +int ret; + +if (port ==STF_PORT_CSI2RX ) { + pad = &isp_dev->pads[STF_ISP_PAD_SINK ]; + }else { +dev_err (stfcamss->dev,"not support port %d\n" , port); +return -EPERM ; + } + + ret =v4l2_create_fwnode_links_to_pad (subdev, pad,0 ); +if (ret) +return ret; + + ret =media_create_pad_link (&subdev->entity,1 , + &cap_raw->video.vdev.entity,0 ,0 ); +if (ret) +return ret; + + isp_dev->source_subdev = subdev; + cap_raw->video.source_subdev = subdev; + +return 0 ; +} +static int stfcamss_subdev_notifier_complete (struct v4l2_async_notifier *ntf) { struct stfcamss *stfcamss =
@@ -133,6 +212,7 @@ static int stfcamss_subdev_notifier_complete(struct v4l2_async_notifier *ntf)static const struct v4l2_async_notifier_operations stfcamss_subdev_notifier_ops = { + .bound = stfcamss_subdev_notifier_bound, .complete = stfcamss_subdev_notifier_complete, };
@@ -217,6 +297,12 @@ static int stfcamss_probe(struct platform_device *pdev) goto err_cleanup_notifier; } + ret =stf_isp_init (stfcamss); +if (ret <0 ) { +dev_err (dev,"Failed to init isp: %d\n" , ret); + goto err_cleanup_notifier; + } +stfcamss_mc_init (pdev, stfcamss); ret =v4l2_device_register (stfcamss->dev, &stfcamss->v4l2_dev);
@@ -231,6 +317,12 @@ static int stfcamss_probe(struct platform_device *pdev) goto err_unregister_device; } + ret =stfcamss_register_devs (stfcamss); +if (ret <0 ) { +dev_err (dev,"Failed to register subdevice: %d\n" , ret); + goto err_unregister_media_dev; + } +pm_runtime_enable (dev); stfcamss->notifier.ops = &stfcamss_subdev_notifier_ops;
@@ -239,11 +331,13 @@ static int stfcamss_probe(struct platform_device *pdev)dev_err (dev,"Failed to register async subdev nodes: %d\n" , ret);pm_runtime_disable (dev); - goto err_unregister_media_dev; + goto err_unregister_subdevs; }return 0 ; +err_unregister_subdevs: +stfcamss_unregister_devs (stfcamss); err_unregister_media_dev:media_device_unregister (&stfcamss->media_dev); err_unregister_device:
@@ -265,6 +359,7 @@ static int stfcamss_remove(struct platform_device *pdev) {struct stfcamss *stfcamss =platform_get_drvdata (pdev); +stfcamss_unregister_devs (stfcamss);v4l2_device_unregister (&stfcamss->v4l2_dev);media_device_cleanup (&stfcamss->media_dev);v4l2_async_nf_cleanup (&stfcamss->notifier);
Signature · 1 line
2.34.1
Quoted 86 lines · Jack Zhu
Hi,
This series is the v9 series that attempts to support the Camera Subsystem found on StarFive JH7110 SoC.
This series is based on top of the master branch of
media_stagerepository.The following are the media graph for the device and the v4l2-compliance output.
===========================================================================
[the media graph]:digraph board { rankdir=TB n00000001 [label="{{<port0> 0} | stf_isp\n/dev/v4l-subdev0 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green] n00000001:port1 -> n00000008 [style=dashed] n00000004 [label="capture_raw\n/dev/video0", shape=box, style=filled, fillcolor=yellow] n00000008 [label="capture_yuv\n/dev/video1", shape=box, style=filled, fillcolor=yellow] n0000000e [label="{{<port0> 0} | cdns_csi2rx.19800000.csi-bridge\n | {<port1> 1 | <port2> 2 | <port3> 3 | <port4> 4}}", shape=Mrecord, style=filled, fillcolor=green] n0000000e:port1 -> n00000001:port0 [style=dashed] n0000000e:port1 -> n00000004 [style=dashed] n00000018 [label="{{} | imx219 6-0010\n/dev/v4l-subdev1 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green] n00000018:port0 -> n0000000e:port0 [style=bold] }[the device topology]:
Media controller API version 6.5.0
Media device information
------------------------
driver starfive-camss
model Starfive Camera Subsystem
serialbus info platform:19840000.camss hw revision 0x0 driver version 6.5.0Device topology
- entity 1:stf_isp(2 pads, 2 links)type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev0 pad0: Sink [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb crop.bounds:(0,0)/1920x1080 crop:(0,0)/1920x1080] <- "cdns_csi2rx.19800000.csi-bridge":1 [] pad1: Source [fmt:YUYV8_1_5X8/1920x1080 field:none colorspace:srgb crop.bounds:(0,0)/1920x1080 crop:(0,0)/1920x1080] -> "capture_yuv":0 []- entity 4:
capture_raw(1 pad, 1 link)
type Node subtype V4L flags 0
device node name/dev/video0
pad0: Sink
<- "cdns_csi2rx.19800000.csi-bridge":1 []- entity 8:
capture_yuv(1 pad, 1 link)
type Node subtype V4L flags 0
device node name/dev/video1
pad0: Sink
<- "stf_isp":1 []- entity 14: cdns_csi2rx.19800000.csi-bridge (5 pads, 3 links)
type V4L2 subdev subtype Unknown flags 0 pad0: Sink <- "imx219 6-0010":0 [ENABLED,IMMUTABLE] pad1: Source -> "stf_isp":0 [] -> "capture_raw":0 [] pad2: Source pad3: Source pad4: Source- entity 24: imx219 6-0010 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev1 pad0: Source [fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range crop.bounds:(8,8)/3280x2464 crop:(8,8)/3280x2464] -> "cdns_csi2rx.19800000.csi-bridge":0 [ENABLED,IMMUTABLE]
Quoted 4 lines
===========================================================================
[the v4l2-compliance output]:v4l2-compliance 1.24.1, 64 bits, 64-bit
time_t
This v4l2-compliance version is from a distro. For driver acceptance you
must test with a v4l2-compliance compiled from the git repo (git://linuxtv.org/v4l-utils.git).
Also, since this driver uses the media controller, you must run v4l2-compliance with the -m /dev/mediaX option. This will test the compliance of all devices reported by the media controller.
Quoted 5 lines
Compliance test for stf camss device
/dev/video1:Driver Info:
Driver name : stf camss
The module is called starfive-camss, so shouldn't the driver name reported here be the same?
Quoted 4 lines
Card type : Starfive Camera Subsystem Bus info : platform:19840000.camss Driver version : 6.5.0 Capabilities : 0x84200001
Quoted 10 lines
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps :0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : starfive-camss
It's correct in the media controller information.
Quoted 7 lines
Model : Starfive Camera Subsystem Serial : Bus info : platform:19840000.camss Media version : 6.5.0 Hardware revision: 0x00000000 (0) Driver version : 6.5.0Interface Info:
Quoted 8 lines
ID : 0x0300000a Type : V4L Video Entity Info: ID : 0x00000008 (8) Name : capture_yuv Function : V4L2 I/O Pad 0x01000009 : 0: Sink Link 0x0200000c: from remote pad 0x1000003 of entity 'stf_isp' (Unknown Function (00004009)): Data, Enabled
Hmm, this reports "Unknown Function". I bet that when you run v4l2-compliance with the -m option it will fail on this. If not, then that's likely a bug in the compliance test, please let me know if that's the case.
Regards,
Hans
Quoted 199 lines
Required ioctls:
test MC information (see 'Media Driver Info' above): OK testVIDIOC_QUERYCAP: OK
test invalid ioctls: OKAllow for multiple opens:
test second/dev/video1open: OK
testVIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OKDebug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported) testVIDIOC_LOG_STATUS: OK (Not Supported)Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) testVIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) testVIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported) test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) testVIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) testVIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported)Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported) testVIDIOC_QUERYCTRL: OK (Not Supported)
test VIDIOC_G/S_CTRL: OK (Not Supported)
test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported) test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported) test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 0 Private Controls: 0Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK test VIDIOC_G/S_PARM: OK (Not Supported) testVIDIOC_G_FBUF: OK (Not Supported) testVIDIOC_G_FMT: OK
testVIDIOC_TRY_FMT: OK
testVIDIOC_S_FMT: OK
testVIDIOC_G_SLICED_VBI_CAP: OK (Not Supported) test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OKCodec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) testVIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK testVIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)Test input 0:
Streaming ioctls:
test read/write: OK (Not Supported)
test blocking wait: OK
test MMAP (no poll): OK
test MMAP (select): OK
test MMAP (epoll): OK
test USERPTR (no poll): OK (Not Supported) test USERPTR (select): OK (Not Supported) test DMABUF: Cannot test, specify --expbuf-deviceTotal for stf camss device
/dev/video1: 53, Succeeded: 53, Failed: 0, Warnings: 0===========================================================================
Changes in v9:
- Rebased on top of the master branch ofmedia_stagerepository.
- Renamed file name.
- Addedof_node_put(node)in the error handling path ofstfcamss_of_parse_ports().v8 link: https://lore.kernel.org/all/[email protected]/
Changes in v8:
- Rebased on v6.5-rc7.
- Dropped VIN subdev.
- Created two new video devices:capture_rawandcapture_yuv, to replace the previous video devices.
- DroppedVB2_READio methods.
- Recursively called .s_stream() on subdevs.v7 link: https://lore.kernel.org/all/[email protected]/
Changes in v7:
-HAS_DMAis used instead ofDMA_CMAinKconfig.
- Dropped some non-essential member variables.
- Usedv4l2_async_nf_add_fwnode_remote()to simplify the relevant code.
- Modified some Local variable types in the function.
- Usedv4l2_create_fwnode_links_to_pad()to simplify the relevant code.
- Added error handling forclk_prepare_enable().
- Simplifiedstfcamss_format_infostruct and modified the relevant code.
- Droppedenum_input,g_inputands_input.
- Unifiedv4l2_ioctl_opsstruct.
- Used v4l2_fh_open()/vb2_fop_release to replace deprecated APIs.
- Added a camss directory under the starfive directory and modified the patch title.v6 link: https://lore.kernel.org/all/[email protected]/
Changes in v6:
- Added 'bus-type' in bindings example.
- Corrected spelling errors.
- As reviewed by Bryan, used 'nclks' and 'nrsts' variables.
- Added lccf config for ISP.v5 link: https://lore.kernel.org/all/[email protected]/
Changes in v5:
- Rebased on v6.4-rc1.
- Added new patch.
- Modified ISP driver.v4 link: https://lore.kernel.org/all/[email protected]/
Previous cover letter from v4:
This patch series adds support for the StarFive Camera Subsystem found on StarFive JH7110 SoC.
The driver implements V4L2, Media controller and V4L2 subdev interfaces. Camera sensor using V4L2 subdev interface in the kernel is supported.
The driver is tested on VisionFive V2 board with IMX219 camera sensor. GStreamer 1.18.5 with v4l2src plugin is supported.
Previous version link, missing v1 version:
v3: https://lore.kernel.org/all/[email protected]/
v2: https://lore.kernel.org/all/[email protected]/Jack Zhu (8):
media: dt-bindings: Add JH7110 Camera Subsystem
media: admin-guide: Addstarfive_camss.rstfor Starfive Camera
Subsystem
media: staging: media: starfive: camss: Add core driver
media: staging: media: starfive: camss: Add video driver
media: staging: media: starfive: camss: Add ISP driver
media: staging: media: starfive: camss: Add capture driver
media: staging: media: starfive: camss: Add interrupt handling
media: staging: media: starfive: camss: Register devices.../admin-guide/media/starfive_camss.rst | 72 +++ .../media/starfive_camss_graph.dot | 12 + .../admin-guide/media/v4l-drivers.rst | 1 + .../bindings/media/starfive,jh7110-camss.yaml | 180 ++++++ MAINTAINERS | 9 + drivers/staging/media/Kconfig | 2 + drivers/staging/media/Makefile | 1 + drivers/staging/media/starfive/Kconfig | 5 + drivers/staging/media/starfive/Makefile | 2 + drivers/staging/media/starfive/camss/Kconfig | 17 + drivers/staging/media/starfive/camss/Makefile | 13 + .../staging/media/starfive/camss/stf-camss.c | 436 +++++++++++++ .../staging/media/starfive/camss/stf-camss.h | 134 ++++ .../media/starfive/camss/stf-capture.c | 603 ++++++++++++++++++ .../media/starfive/camss/stf-capture.h | 87 +++ .../media/starfive/camss/stf-isp-hw-ops.c | 445 +++++++++++++ .../staging/media/starfive/camss/stf-isp.c | 407 ++++++++++++ .../staging/media/starfive/camss/stf-isp.h | 428 +++++++++++++ .../staging/media/starfive/camss/stf-video.c | 571 +++++++++++++++++ .../staging/media/starfive/camss/stf-video.h | 100 +++ 20 files changed, 3525 insertions(+) create mode 100644 Documentation/admin-guide/media/starfive_camss.rst create mode 100644 Documentation/admin-guide/media/starfive_camss_graph.dot create mode 100644 Documentation/devicetree/bindings/media/starfive,jh7110-camss.yaml create mode 100644 drivers/staging/media/starfive/Kconfig create mode 100644 drivers/staging/media/starfive/Makefile create mode 100644 drivers/staging/media/starfive/camss/Kconfig create mode 100644 drivers/staging/media/starfive/camss/Makefile create mode 100644 drivers/staging/media/starfive/camss/stf-camss.c create mode 100644 drivers/staging/media/starfive/camss/stf-camss.h create mode 100644 drivers/staging/media/starfive/camss/stf-capture.c create mode 100644 drivers/staging/media/starfive/camss/stf-capture.h create mode 100644 drivers/staging/media/starfive/camss/stf-isp-hw-ops.c create mode 100644 drivers/staging/media/starfive/camss/stf-isp.c create mode 100644 drivers/staging/media/starfive/camss/stf-isp.h create mode 100644 drivers/staging/media/starfive/camss/stf-video.c create mode 100644 drivers/staging/media/starfive/camss/stf-video.h
Hi Hans,
Thanks for your comment.
Quoted 87 lines · Hans Verkuil
Quoted 86 lines · Jack Zhu
Hi,
This series is the v9 series that attempts to support the Camera Subsystem found on StarFive JH7110 SoC.
This series is based on top of the master branch of
media_stagerepository.The following are the media graph for the device and the v4l2-compliance output.
===========================================================================
[the media graph]:digraph board { rankdir=TB n00000001 [label="{{<port0> 0} | stf_isp\n/dev/v4l-subdev0 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green] n00000001:port1 -> n00000008 [style=dashed] n00000004 [label="capture_raw\n/dev/video0", shape=box, style=filled, fillcolor=yellow] n00000008 [label="capture_yuv\n/dev/video1", shape=box, style=filled, fillcolor=yellow] n0000000e [label="{{<port0> 0} | cdns_csi2rx.19800000.csi-bridge\n | {<port1> 1 | <port2> 2 | <port3> 3 | <port4> 4}}", shape=Mrecord, style=filled, fillcolor=green] n0000000e:port1 -> n00000001:port0 [style=dashed] n0000000e:port1 -> n00000004 [style=dashed] n00000018 [label="{{} | imx219 6-0010\n/dev/v4l-subdev1 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green] n00000018:port0 -> n0000000e:port0 [style=bold] }[the device topology]:
Media controller API version 6.5.0
Media device information
------------------------
driver starfive-camss
model Starfive Camera Subsystem
serialbus info platform:19840000.camss hw revision 0x0 driver version 6.5.0Device topology
- entity 1:stf_isp(2 pads, 2 links)type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev0 pad0: Sink [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb crop.bounds:(0,0)/1920x1080 crop:(0,0)/1920x1080] <- "cdns_csi2rx.19800000.csi-bridge":1 [] pad1: Source [fmt:YUYV8_1_5X8/1920x1080 field:none colorspace:srgb crop.bounds:(0,0)/1920x1080 crop:(0,0)/1920x1080] -> "capture_yuv":0 []- entity 4:
capture_raw(1 pad, 1 link)
type Node subtype V4L flags 0
device node name/dev/video0
pad0: Sink
<- "cdns_csi2rx.19800000.csi-bridge":1 []- entity 8:
capture_yuv(1 pad, 1 link)
type Node subtype V4L flags 0
device node name/dev/video1
pad0: Sink
<- "stf_isp":1 []- entity 14: cdns_csi2rx.19800000.csi-bridge (5 pads, 3 links)
type V4L2 subdev subtype Unknown flags 0 pad0: Sink <- "imx219 6-0010":0 [ENABLED,IMMUTABLE] pad1: Source -> "stf_isp":0 [] -> "capture_raw":0 [] pad2: Source pad3: Source pad4: Source- entity 24: imx219 6-0010 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev1 pad0: Source [fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range crop.bounds:(8,8)/3280x2464 crop:(8,8)/3280x2464] -> "cdns_csi2rx.19800000.csi-bridge":0 [ENABLED,IMMUTABLE]
Quoted 8 lines
Quoted 4 lines
===========================================================================
[the v4l2-compliance output]:v4l2-compliance 1.24.1, 64 bits, 64-bit
time_tThis v4l2-compliance version is from a distro. For driver acceptance you
must test with a v4l2-compliance compiled from the git repo (git://linuxtv.org/v4l-utils.git).
It is compiled from buildroot, but its source code is also downloaded from the repo tag v4l-utils-1.24.1. Do you mean I should use the latest stable version (stable-1.24) on the repo?
Signature · 3 lines
Regards, Jack Zhu
Quoted 95 lines · Jack Zhu
Hi Hans,
Thanks for your comment.
Quoted 90 lines · Hans Verkuil
Quoted 89 lines · Jack Zhu
Hi,
This series is the v9 series that attempts to support the Camera Subsystem found on StarFive JH7110 SoC.
This series is based on top of the master branch of
media_stagerepository.The following are the media graph for the device and the v4l2-compliance output.
===========================================================================
[the media graph]:digraph board { rankdir=TB n00000001 [label="{{<port0> 0} | stf_isp\n/dev/v4l-subdev0 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green] n00000001:port1 -> n00000008 [style=dashed] n00000004 [label="capture_raw\n/dev/video0", shape=box, style=filled, fillcolor=yellow] n00000008 [label="capture_yuv\n/dev/video1", shape=box, style=filled, fillcolor=yellow] n0000000e [label="{{<port0> 0} | cdns_csi2rx.19800000.csi-bridge\n | {<port1> 1 | <port2> 2 | <port3> 3 | <port4> 4}}", shape=Mrecord, style=filled, fillcolor=green] n0000000e:port1 -> n00000001:port0 [style=dashed] n0000000e:port1 -> n00000004 [style=dashed] n00000018 [label="{{} | imx219 6-0010\n/dev/v4l-subdev1 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green] n00000018:port0 -> n0000000e:port0 [style=bold] }[the device topology]:
Media controller API version 6.5.0
Media device information
------------------------
driver starfive-camss
model Starfive Camera Subsystem
serialbus info platform:19840000.camss hw revision 0x0 driver version 6.5.0Device topology
- entity 1:stf_isp(2 pads, 2 links)type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev0 pad0: Sink [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb crop.bounds:(0,0)/1920x1080 crop:(0,0)/1920x1080] <- "cdns_csi2rx.19800000.csi-bridge":1 [] pad1: Source [fmt:YUYV8_1_5X8/1920x1080 field:none colorspace:srgb crop.bounds:(0,0)/1920x1080 crop:(0,0)/1920x1080] -> "capture_yuv":0 []- entity 4:
capture_raw(1 pad, 1 link)
type Node subtype V4L flags 0
device node name/dev/video0
pad0: Sink
<- "cdns_csi2rx.19800000.csi-bridge":1 []- entity 8:
capture_yuv(1 pad, 1 link)
type Node subtype V4L flags 0
device node name/dev/video1
pad0: Sink
<- "stf_isp":1 []- entity 14: cdns_csi2rx.19800000.csi-bridge (5 pads, 3 links)
type V4L2 subdev subtype Unknown flags 0 pad0: Sink <- "imx219 6-0010":0 [ENABLED,IMMUTABLE] pad1: Source -> "stf_isp":0 [] -> "capture_raw":0 [] pad2: Source pad3: Source pad4: Source- entity 24: imx219 6-0010 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev1 pad0: Source [fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range crop.bounds:(8,8)/3280x2464 crop:(8,8)/3280x2464] -> "cdns_csi2rx.19800000.csi-bridge":0 [ENABLED,IMMUTABLE]===========================================================================
[the v4l2-compliance output]:
Quoted 9 lines
Quoted 5 lines
Quoted 1 line
v4l2-compliance 1.24.1, 64 bits, 64-bit
time_tThis v4l2-compliance version is from a distro. For driver acceptance you
must test with a v4l2-compliance compiled from the git repo (git://linuxtv.org/v4l-utils.git).It is compiled from buildroot, but its source code is also downloaded from the repo tag v4l-utils-1.24.1. Do you mean I should use the latest stable version (stable-1.24) on the repo?
No, you want the latest version, period. So just the master branch of the v4l-utils git repo.
For the compliance tests you want the latest and greatest, since the stable tags are often fairly old.
Regards,
Hans
Quoted 141 lines · Hans Verkuil
Quoted 86 lines · Jack Zhu
Hi,
This series is the v9 series that attempts to support the Camera Subsystem found on StarFive JH7110 SoC.
This series is based on top of the master branch of
media_stagerepository.The following are the media graph for the device and the v4l2-compliance output.
===========================================================================
[the media graph]:digraph board { rankdir=TB n00000001 [label="{{<port0> 0} | stf_isp\n/dev/v4l-subdev0 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green] n00000001:port1 -> n00000008 [style=dashed] n00000004 [label="capture_raw\n/dev/video0", shape=box, style=filled, fillcolor=yellow] n00000008 [label="capture_yuv\n/dev/video1", shape=box, style=filled, fillcolor=yellow] n0000000e [label="{{<port0> 0} | cdns_csi2rx.19800000.csi-bridge\n | {<port1> 1 | <port2> 2 | <port3> 3 | <port4> 4}}", shape=Mrecord, style=filled, fillcolor=green] n0000000e:port1 -> n00000001:port0 [style=dashed] n0000000e:port1 -> n00000004 [style=dashed] n00000018 [label="{{} | imx219 6-0010\n/dev/v4l-subdev1 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green] n00000018:port0 -> n0000000e:port0 [style=bold] }[the device topology]:
Media controller API version 6.5.0
Media device information
------------------------
driver starfive-camss
model Starfive Camera Subsystem
serialbus info platform:19840000.camss hw revision 0x0 driver version 6.5.0Device topology
- entity 1:stf_isp(2 pads, 2 links)type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev0 pad0: Sink [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb crop.bounds:(0,0)/1920x1080 crop:(0,0)/1920x1080] <- "cdns_csi2rx.19800000.csi-bridge":1 [] pad1: Source [fmt:YUYV8_1_5X8/1920x1080 field:none colorspace:srgb crop.bounds:(0,0)/1920x1080 crop:(0,0)/1920x1080] -> "capture_yuv":0 []- entity 4:
capture_raw(1 pad, 1 link)
type Node subtype V4L flags 0
device node name/dev/video0
pad0: Sink
<- "cdns_csi2rx.19800000.csi-bridge":1 []- entity 8:
capture_yuv(1 pad, 1 link)
type Node subtype V4L flags 0
device node name/dev/video1
pad0: Sink
<- "stf_isp":1 []- entity 14: cdns_csi2rx.19800000.csi-bridge (5 pads, 3 links)
type V4L2 subdev subtype Unknown flags 0 pad0: Sink <- "imx219 6-0010":0 [ENABLED,IMMUTABLE] pad1: Source -> "stf_isp":0 [] -> "capture_raw":0 [] pad2: Source pad3: Source pad4: Source- entity 24: imx219 6-0010 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev1 pad0: Source [fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range crop.bounds:(8,8)/3280x2464 crop:(8,8)/3280x2464] -> "cdns_csi2rx.19800000.csi-bridge":0 [ENABLED,IMMUTABLE]Quoted 4 lines
===========================================================================
[the v4l2-compliance output]:v4l2-compliance 1.24.1, 64 bits, 64-bit
time_tThis v4l2-compliance version is from a distro. For driver acceptance you
must test with a v4l2-compliance compiled from the git repo (git://linuxtv.org/v4l-utils.git).Also, since this driver uses the media controller, you must run v4l2-compliance with the -m
/dev/mediaXoption. This will test the compliance of all devices reported by the media controller.Quoted 5 lines
Compliance test for stf camss device
/dev/video1:Driver Info:
Driver name : stf camssThe module is called starfive-camss, so shouldn't the driver name reported here be the same?
Quoted 4 lines
Card type : Starfive Camera Subsystem Bus info : platform:19840000.camss Driver version : 6.5.0 Capabilities : 0x84200001Quoted 10 lines
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps :0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : starfive-camssIt's correct in the media controller information.
Quoted 7 lines
Model : Starfive Camera Subsystem Serial : Bus info : platform:19840000.camss Media version : 6.5.0 Hardware revision: 0x00000000 (0) Driver version : 6.5.0Interface Info:
Quoted 8 lines
ID : 0x0300000a Type : V4L Video Entity Info: ID : 0x00000008 (8) Name : capture_yuv Function : V4L2 I/O Pad 0x01000009 : 0: Sink Link 0x0200000c: from remote pad 0x1000003 of entity 'stf_isp' (Unknown Function (00004009)): Data, Enabled
Quoted 4 lines
Hmm, this reports "Unknown Function". I bet that when you run v4l2-compliance with the -m option it will fail on this. If not, then that's likely a bug in the compliance test, please let me know if that's the case.
Hi Hans,
The following is the latest test log, which does not report a failure, but also reports "Unknown Function".
I make the following settings in the stf-isp.c file:
v4l2_subdev.entity.function = MEDIA_ENT_F_PROC_VIDEO_ISP;
#
# v4l2-compliance -m /dev/media0 v4l2-compliance 1.25.0, 64 bits, 64-bit time_t
Compliance test for starfive-camss device /dev/media0:
Media Driver Info:
Driver name : starfive-camss Model : Starfive Camera Subsystem Serial : Bus info : platform:19840000.camss Media version : 6.5.0 Hardware revision: 0x00000000 (0) Driver version : 6.5.0
Required ioctls:
test MEDIA_IOC_DEVICE_INFO: OK
test invalid ioctls: OK
Allow for multiple opens:
test second /dev/media0 open: OK
test MEDIA_IOC_DEVICE_INFO: OK
test for unlimited opens: OK
Media Controller ioctls:
test MEDIA_IOC_G_TOPOLOGY: OK
Entities: 5 Interfaces: 4 Pads: 10 Links: 8 test MEDIA_IOC_ENUM_ENTITIES/LINKS: OK test MEDIA_IOC_SETUP_LINK: OK
Total for starfive-camss device /dev/media0: 8, Succeeded: 8, Failed: 0, Warnings: 0
--------------------------------------------------------------------------------
Compliance test for starfive-camss device /dev/video0:
Driver Info:
Driver name : starfive-camss Card type : Starfive Camera Subsystem Bus info : platform:19840000.camss Driver version : 6.5.0 Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : starfive-camss Model : Starfive Camera Subsystem Serial : Bus info : platform:19840000.camss Media version : 6.5.0 Hardware revision: 0x00000000 (0) Driver version : 6.5.0 Interface Info: ID : 0x03000006 Type : V4L Video Entity Info: ID : 0x00000004 (4) Name : capture_raw Function : V4L2 I/O Pad 0x01000005 : 0: Sink Link 0x02000016: from remote pad 0x1000010 of entity 'cdns_csi2rx.19800000.csi-bridge' (Video Interface Bridge): Data
Required ioctls:
test MC information (see 'Media Driver Info' above): OK test VIDIOC_QUERYCAP: OK
test invalid ioctls: OK
Allow for multiple opens:
test second /dev/video0 open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK
Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported) test VIDIOC_LOG_STATUS: OK (Not Supported)
Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported) test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0
Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0
Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported)
Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported) test VIDIOC_QUERYCTRL: OK (Not Supported)
test VIDIOC_G/S_CTRL: OK (Not Supported)
test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported) test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported) test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 0 Private Controls: 0
Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK test VIDIOC_G/S_PARM: OK (Not Supported) test VIDIOC_G_FBUF: OK (Not Supported) test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported) test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK
Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test VIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)
Total for starfive-camss device /dev/video0: 46, Succeeded: 46, Failed: 0, Warnings: 0
--------------------------------------------------------------------------------
Compliance test for starfive-camss device /dev/video1:
Driver Info:
Driver name : starfive-camss Card type : Starfive Camera Subsystem Bus info : platform:19840000.camss Driver version : 6.5.0 Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : starfive-camss Model : Starfive Camera Subsystem Serial : Bus info : platform:19840000.camss Media version : 6.5.0 Hardware revision: 0x00000000 (0) Driver version : 6.5.0 Interface Info: ID : 0x0300000a Type : V4L Video Entity Info: ID : 0x00000008 (8) Name : capture_yuv Function : V4L2 I/O Pad 0x01000009 : 0: Sink Link 0x0200000c: from remote pad 0x1000003 of entity 'stf_isp' (Unknown Function (00004009)): Data, Enabled
Required ioctls:
test MC information (see 'Media Driver Info' above): OK test VIDIOC_QUERYCAP: OK
test invalid ioctls: OK
Allow for multiple opens:
test second /dev/video1 open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK
Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported) test VIDIOC_LOG_STATUS: OK (Not Supported)
Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported) test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0
Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0
Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported)
Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported) test VIDIOC_QUERYCTRL: OK (Not Supported)
test VIDIOC_G/S_CTRL: OK (Not Supported)
test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported) test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported) test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 0 Private Controls: 0
Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK test VIDIOC_G/S_PARM: OK (Not Supported) test VIDIOC_G_FBUF: OK (Not Supported) test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported) test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK
Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test VIDIOC_EXstf_isp: ================= START STATUS =================
PBUF: OKtf_isp: ================== END STATUS ================== m
test Requests: OK (Not Supported)
Total for starfive-camss device /dev/video1: 46, Succeeded: 46, Failed: 0, Warnings: 0
--------------------------------------------------------------------------------
Compliance test for starfive-camss device /dev/v4l-subdev0:
Driver Info:
Driver version : 6.5.0 Capabilities : 0x00000000 Media Driver Info: Driver name : starfive-camss Model : Starfive Camera Subsystem Serial : Bus info : platform:19840000.camss Media version : 6.5.0 Hardware revision: 0x00000000 (0) Driver version : 6.5.0 Interface Info: ID : 0x0300001c Type : V4L Sub-Device Entity Info: ID : 0x00000001 (1) Name : stf_isp Function : WARNING: Unknown Function (00004009), is v4l2-compliance out-of-date? Pad 0x01000002 : 0: Sink Link 0x02000014: from remote pad 0x1000010 of entity 'cdns_csi2rx.19800000.csi-bridge' (Video Interface Bridge): Data, Enabled Pad 0x01000003 : 1: Source Link 0x0200000c: to remote pad 0x1000009 of entity 'capture_yuv' (V4L2 I/O): Data, Enabled
Required ioctls:
test MC information (see 'Media Driver Info' above): OK test VIDIOC_SUDBEV_QUERYCAP: OK
test invalid ioctls: OK
Allow for multiple opens:
test second /dev/v4l-subdev0 open: OK
test VIDIOC_SUBDEV_QUERYCAP: OK
test for unlimited opens: OK
Debug ioctls:
test VIDIOC_LOG_STATUS: OK (Not Supported)
Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported) test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0
Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0
Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported)
Sub-Device ioctls (Sink Pad 0):
Try Stream 0
test Try VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK test Try VIDIOC_SUBDEV_G/S_FMT: OK
test Try VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK
Active Stream 0
test Active VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK test Active VIDIOC_SUBDEV_G/S_FMT: OK
test Active VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK
test VIDIOC_SUBDEV_G/S_FRAME_INTERVAL: OK (Not Supported)
Sub-Device ioctls (Source Pad 1):
Try Stream 0
test Try VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK test Try VIDIOC_SUBDEV_G/S_FMT: OK
test Try VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK
Active Stream 0
test Active VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK test Active VIDIOC_SUBDEV_G/S_FMT: OK
test Active VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK
test VIDIOC_SUBDEV_G/S_FRAME_INTERVAL: OK (Not Supported)
Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported)
test VIDIOC_QUERYCTRL: OK (Not Supported)
test VIDIOC_G/S_CTRL: OK (Not Supported)
test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEimx219 6-0010: ================= START STATUS =================
VENT: OKmx219 6-0010: ================== END STATUS ==================
m (Not Supported)
test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
Standard Controls: 0 Private Controls: 0
Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK (Not Supported) test VIDIOC_G/S_PARM: OK (Not Supported)
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK (Not Supported)
test VIDIOC_TRY_FMT: OK (Not Supported)
test VIDIOC_S_FMT: OK (Not Supported)
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK (Not Supported)
Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK (Not Supported) test VIDIOC_EXPBUF: OK (Not Supported)
test Requests: OK (Not Supported)
Total for starfive-camss device /dev/v4l-subdev0: 58, Succeeded: 58, Failed: 0, Warnings: 0
--------------------------------------------------------------------------------
Compliance test for device /dev/v4l-subdev1:
Driver Info:
Driver version : 6.5.0 Capabilities : 0x00000000
Required ioctls:
test VIDIOC_SUDBEV_QUERYCAP: OK
test invalid ioctls: OK
Allow for multiple opens:
test second /dev/v4l-subdev1 open: OK
test VIDIOC_SUBDEV_QUERYCAP: OK
test for unlimited opens: OK
Debug ioctls:
test VIDIOC_LOG_STATUS: OK (Not Supported)
Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported) test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0
Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0
Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported)
Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK test VIDIOC_QUERYCTRL: OK
test VIDIOC_G/S_CTRL: OK
test VIDIOC_G/S/TRY_EXT_CTRLS: OK test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 20 Private Controls: 0
Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK (Not Supported) test VIDIOC_G/S_PARM: OK (Not Supported)
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK (Not Supported)
test VIDIOC_TRY_FMT: OK (Not Supported)
test VIDIOC_S_FMT: OK (Not Supported)
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK (Not Supported)
Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK (Not Supported) test VIDIOC_EXPBUF: OK (Not Supported)
test Requests: OK (Not Supported)
Total for device /dev/v4l-subdev1: 43, Succeeded: 43, Failed: 0, Warnings: 0
Grand Total for starfive-camss device /dev/media0: 201, Succeeded: 201, Failed: 0, Warnings: 0 #
--
Regards,
Jack Zhu
Quoted 149 lines · Jack Zhu
Quoted 141 lines · Hans Verkuil
Quoted 86 lines · Jack Zhu
Hi,
This series is the v9 series that attempts to support the Camera Subsystem found on StarFive JH7110 SoC.
This series is based on top of the master branch of
media_stagerepository.The following are the media graph for the device and the v4l2-compliance output.
===========================================================================
[the media graph]:digraph board { rankdir=TB n00000001 [label="{{<port0> 0} | stf_isp\n/dev/v4l-subdev0 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green] n00000001:port1 -> n00000008 [style=dashed] n00000004 [label="capture_raw\n/dev/video0", shape=box, style=filled, fillcolor=yellow] n00000008 [label="capture_yuv\n/dev/video1", shape=box, style=filled, fillcolor=yellow] n0000000e [label="{{<port0> 0} | cdns_csi2rx.19800000.csi-bridge\n | {<port1> 1 | <port2> 2 | <port3> 3 | <port4> 4}}", shape=Mrecord, style=filled, fillcolor=green] n0000000e:port1 -> n00000001:port0 [style=dashed] n0000000e:port1 -> n00000004 [style=dashed] n00000018 [label="{{} | imx219 6-0010\n/dev/v4l-subdev1 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green] n00000018:port0 -> n0000000e:port0 [style=bold] }[the device topology]:
Media controller API version 6.5.0
Media device information
------------------------
driver starfive-camss
model Starfive Camera Subsystem
serialbus info platform:19840000.camss hw revision 0x0 driver version 6.5.0Device topology
- entity 1:stf_isp(2 pads, 2 links)type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev0 pad0: Sink [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb crop.bounds:(0,0)/1920x1080 crop:(0,0)/1920x1080] <- "cdns_csi2rx.19800000.csi-bridge":1 [] pad1: Source [fmt:YUYV8_1_5X8/1920x1080 field:none colorspace:srgb crop.bounds:(0,0)/1920x1080 crop:(0,0)/1920x1080] -> "capture_yuv":0 []- entity 4:
capture_raw(1 pad, 1 link)
type Node subtype V4L flags 0
device node name/dev/video0
pad0: Sink
<- "cdns_csi2rx.19800000.csi-bridge":1 []- entity 8:
capture_yuv(1 pad, 1 link)
type Node subtype V4L flags 0
device node name/dev/video1
pad0: Sink
<- "stf_isp":1 []- entity 14: cdns_csi2rx.19800000.csi-bridge (5 pads, 3 links)
type V4L2 subdev subtype Unknown flags 0 pad0: Sink <- "imx219 6-0010":0 [ENABLED,IMMUTABLE] pad1: Source -> "stf_isp":0 [] -> "capture_raw":0 [] pad2: Source pad3: Source pad4: Source- entity 24: imx219 6-0010 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev1 pad0: Source [fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range crop.bounds:(8,8)/3280x2464 crop:(8,8)/3280x2464] -> "cdns_csi2rx.19800000.csi-bridge":0 [ENABLED,IMMUTABLE]Quoted 4 lines
===========================================================================
[the v4l2-compliance output]:v4l2-compliance 1.24.1, 64 bits, 64-bit
time_tThis v4l2-compliance version is from a distro. For driver acceptance you
must test with a v4l2-compliance compiled from the git repo (git://linuxtv.org/v4l-utils.git).Also, since this driver uses the media controller, you must run v4l2-compliance with the -m
/dev/mediaXoption. This will test the compliance of all devices reported by the media controller.Quoted 5 lines
Compliance test for stf camss device
/dev/video1:Driver Info:
Driver name : stf camssThe module is called starfive-camss, so shouldn't the driver name reported here be the same?
Quoted 4 lines
Card type : Starfive Camera Subsystem Bus info : platform:19840000.camss Driver version : 6.5.0 Capabilities : 0x84200001Quoted 10 lines
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps :0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : starfive-camssIt's correct in the media controller information.
Quoted 7 lines
Model : Starfive Camera Subsystem Serial : Bus info : platform:19840000.camss Media version : 6.5.0 Hardware revision: 0x00000000 (0) Driver version : 6.5.0Interface Info:
Quoted 8 lines
ID : 0x0300000a Type : V4L Video Entity Info: ID : 0x00000008 (8) Name : capture_yuv Function : V4L2 I/O Pad 0x01000009 : 0: Sink Link 0x0200000c: from remote pad 0x1000003 of entity 'stf_isp' (Unknown Function (00004009)): Data, EnabledQuoted 4 lines
Hmm, this reports "Unknown Function". I bet that when you run v4l2-compliance with the -m option it will fail on this. If not, then that's likely a bug in the compliance test, please let me know if that's the case.
Quoted 8 lines
Hi Hans,
The following is the latest test log, which does not report a failure, but also reports "Unknown Function".
I make the following settings in the
stf-isp.cfile:
v4l2_subdev.entity.function =MEDIA_ENT_F_PROC_VIDEO_ISP;
Can you post the output of:
v4l2-compliance --verbose -M /dev/media0
I am beginning to suspect that utils/common/media-info.cpp is out-of-date:
it is missing MEDIA_ENT_F_PROC_VIDEO_ISP.
But I don't understand why v4l2-compliance didn't fail on this.
Regards,
Hans
Quoted 159 lines · Hans Verkuil
Quoted 149 lines · Jack Zhu
Quoted 141 lines · Hans Verkuil
Quoted 86 lines · Jack Zhu
Hi,
This series is the v9 series that attempts to support the Camera Subsystem found on StarFive JH7110 SoC.
This series is based on top of the master branch of
media_stagerepository.The following are the media graph for the device and the v4l2-compliance output.
===========================================================================
[the media graph]:digraph board { rankdir=TB n00000001 [label="{{<port0> 0} | stf_isp\n/dev/v4l-subdev0 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green] n00000001:port1 -> n00000008 [style=dashed] n00000004 [label="capture_raw\n/dev/video0", shape=box, style=filled, fillcolor=yellow] n00000008 [label="capture_yuv\n/dev/video1", shape=box, style=filled, fillcolor=yellow] n0000000e [label="{{<port0> 0} | cdns_csi2rx.19800000.csi-bridge\n | {<port1> 1 | <port2> 2 | <port3> 3 | <port4> 4}}", shape=Mrecord, style=filled, fillcolor=green] n0000000e:port1 -> n00000001:port0 [style=dashed] n0000000e:port1 -> n00000004 [style=dashed] n00000018 [label="{{} | imx219 6-0010\n/dev/v4l-subdev1 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green] n00000018:port0 -> n0000000e:port0 [style=bold] }[the device topology]:
Media controller API version 6.5.0
Media device information
------------------------
driver starfive-camss
model Starfive Camera Subsystem
serialbus info platform:19840000.camss hw revision 0x0 driver version 6.5.0Device topology
- entity 1:stf_isp(2 pads, 2 links)type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev0 pad0: Sink [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb crop.bounds:(0,0)/1920x1080 crop:(0,0)/1920x1080] <- "cdns_csi2rx.19800000.csi-bridge":1 [] pad1: Source [fmt:YUYV8_1_5X8/1920x1080 field:none colorspace:srgb crop.bounds:(0,0)/1920x1080 crop:(0,0)/1920x1080] -> "capture_yuv":0 []- entity 4:
capture_raw(1 pad, 1 link)
type Node subtype V4L flags 0
device node name/dev/video0
pad0: Sink
<- "cdns_csi2rx.19800000.csi-bridge":1 []- entity 8:
capture_yuv(1 pad, 1 link)
type Node subtype V4L flags 0
device node name/dev/video1
pad0: Sink
<- "stf_isp":1 []- entity 14: cdns_csi2rx.19800000.csi-bridge (5 pads, 3 links)
type V4L2 subdev subtype Unknown flags 0 pad0: Sink <- "imx219 6-0010":0 [ENABLED,IMMUTABLE] pad1: Source -> "stf_isp":0 [] -> "capture_raw":0 [] pad2: Source pad3: Source pad4: Source- entity 24: imx219 6-0010 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev1 pad0: Source [fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range crop.bounds:(8,8)/3280x2464 crop:(8,8)/3280x2464] -> "cdns_csi2rx.19800000.csi-bridge":0 [ENABLED,IMMUTABLE]Quoted 4 lines
===========================================================================
[the v4l2-compliance output]:v4l2-compliance 1.24.1, 64 bits, 64-bit
time_tThis v4l2-compliance version is from a distro. For driver acceptance you
must test with a v4l2-compliance compiled from the git repo (git://linuxtv.org/v4l-utils.git).Also, since this driver uses the media controller, you must run v4l2-compliance with the -m
/dev/mediaXoption. This will test the compliance of all devices reported by the media controller.Quoted 5 lines
Compliance test for stf camss device
/dev/video1:Driver Info:
Driver name : stf camssThe module is called starfive-camss, so shouldn't the driver name reported here be the same?
Quoted 4 lines
Card type : Starfive Camera Subsystem Bus info : platform:19840000.camss Driver version : 6.5.0 Capabilities : 0x84200001Quoted 10 lines
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps :0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : starfive-camssIt's correct in the media controller information.
Quoted 7 lines
Model : Starfive Camera Subsystem Serial : Bus info : platform:19840000.camss Media version : 6.5.0 Hardware revision: 0x00000000 (0) Driver version : 6.5.0Interface Info:
Quoted 8 lines
ID : 0x0300000a Type : V4L Video Entity Info: ID : 0x00000008 (8) Name : capture_yuv Function : V4L2 I/O Pad 0x01000009 : 0: Sink Link 0x0200000c: from remote pad 0x1000003 of entity 'stf_isp' (Unknown Function (00004009)): Data, EnabledQuoted 4 lines
Hmm, this reports "Unknown Function". I bet that when you run v4l2-compliance with the -m option it will fail on this. If not, then that's likely a bug in the compliance test, please let me know if that's the case.
Quoted 8 lines
Hi Hans,
The following is the latest test log, which does not report a failure, but also reports "Unknown Function".
I make the following settings in the
stf-isp.cfile:
v4l2_subdev.entity.function =MEDIA_ENT_F_PROC_VIDEO_ISP;
Quoted 6 lines
Can you post the output of:
v4l2-compliance --verbose -M
/dev/media0I am beginning to suspect that utils/common/media-info.cpp is out-of-date:
it is missingMEDIA_ENT_F_PROC_VIDEO_ISP.
Yes, this was missing. I've pushed a fix for this.
Regards,
Hans
Quoted 6 lines
But I don't understand why v4l2-compliance didn't fail on this.
Regards,
Hans
Quoted 155 lines · Hans Verkuil
Quoted 154 lines · Jack Zhu
Quoted 141 lines · Hans Verkuil
Quoted 86 lines · Jack Zhu
Hi,
This series is the v9 series that attempts to support the Camera Subsystem found on StarFive JH7110 SoC.
This series is based on top of the master branch of
media_stagerepository.The following are the media graph for the device and the v4l2-compliance output.
===========================================================================
[the media graph]:digraph board { rankdir=TB n00000001 [label="{{<port0> 0} | stf_isp\n/dev/v4l-subdev0 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green] n00000001:port1 -> n00000008 [style=dashed] n00000004 [label="capture_raw\n/dev/video0", shape=box, style=filled, fillcolor=yellow] n00000008 [label="capture_yuv\n/dev/video1", shape=box, style=filled, fillcolor=yellow] n0000000e [label="{{<port0> 0} | cdns_csi2rx.19800000.csi-bridge\n | {<port1> 1 | <port2> 2 | <port3> 3 | <port4> 4}}", shape=Mrecord, style=filled, fillcolor=green] n0000000e:port1 -> n00000001:port0 [style=dashed] n0000000e:port1 -> n00000004 [style=dashed] n00000018 [label="{{} | imx219 6-0010\n/dev/v4l-subdev1 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green] n00000018:port0 -> n0000000e:port0 [style=bold] }[the device topology]:
Media controller API version 6.5.0
Media device information
------------------------
driver starfive-camss
model Starfive Camera Subsystem
serialbus info platform:19840000.camss hw revision 0x0 driver version 6.5.0Device topology
- entity 1:stf_isp(2 pads, 2 links)type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev0 pad0: Sink [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb crop.bounds:(0,0)/1920x1080 crop:(0,0)/1920x1080] <- "cdns_csi2rx.19800000.csi-bridge":1 [] pad1: Source [fmt:YUYV8_1_5X8/1920x1080 field:none colorspace:srgb crop.bounds:(0,0)/1920x1080 crop:(0,0)/1920x1080] -> "capture_yuv":0 []- entity 4:
capture_raw(1 pad, 1 link)
type Node subtype V4L flags 0
device node name/dev/video0
pad0: Sink
<- "cdns_csi2rx.19800000.csi-bridge":1 []- entity 8:
capture_yuv(1 pad, 1 link)
type Node subtype V4L flags 0
device node name/dev/video1
pad0: Sink
<- "stf_isp":1 []- entity 14: cdns_csi2rx.19800000.csi-bridge (5 pads, 3 links)
type V4L2 subdev subtype Unknown flags 0 pad0: Sink <- "imx219 6-0010":0 [ENABLED,IMMUTABLE] pad1: Source -> "stf_isp":0 [] -> "capture_raw":0 [] pad2: Source pad3: Source pad4: Source- entity 24: imx219 6-0010 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev1 pad0: Source [fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range crop.bounds:(8,8)/3280x2464 crop:(8,8)/3280x2464] -> "cdns_csi2rx.19800000.csi-bridge":0 [ENABLED,IMMUTABLE]Quoted 4 lines
===========================================================================
[the v4l2-compliance output]:v4l2-compliance 1.24.1, 64 bits, 64-bit
time_tThis v4l2-compliance version is from a distro. For driver acceptance you
must test with a v4l2-compliance compiled from the git repo (git://linuxtv.org/v4l-utils.git).Also, since this driver uses the media controller, you must run v4l2-compliance with the -m
/dev/mediaXoption. This will test the compliance of all devices reported by the media controller.Quoted 5 lines
Compliance test for stf camss device
/dev/video1:Driver Info:
Driver name : stf camssThe module is called starfive-camss, so shouldn't the driver name reported here be the same?
Quoted 4 lines
Card type : Starfive Camera Subsystem Bus info : platform:19840000.camss Driver version : 6.5.0 Capabilities : 0x84200001Quoted 10 lines
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps :0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : starfive-camssIt's correct in the media controller information.
Quoted 7 lines
Model : Starfive Camera Subsystem Serial : Bus info : platform:19840000.camss Media version : 6.5.0 Hardware revision: 0x00000000 (0) Driver version : 6.5.0Interface Info:
Quoted 8 lines
ID : 0x0300000a Type : V4L Video Entity Info: ID : 0x00000008 (8) Name : capture_yuv Function : V4L2 I/O Pad 0x01000009 : 0: Sink Link 0x0200000c: from remote pad 0x1000003 of entity 'stf_isp' (Unknown Function (00004009)): Data, EnabledQuoted 4 lines
Hmm, this reports "Unknown Function". I bet that when you run v4l2-compliance with the -m option it will fail on this. If not, then that's likely a bug in the compliance test, please let me know if that's the case.
Hi Hans,
The following is the latest test log, which does not report a failure, but also reports "Unknown Function".
Quoted 8 lines
Quoted 3 lines
I make the following settings in the
stf-isp.cfile:
v4l2_subdev.entity.function =MEDIA_ENT_F_PROC_VIDEO_ISP;Can you post the output of:
v4l2-compliance --verbose -M
/dev/media0
Output log of the above command:
#
# v4l2-compliance --verbose -M /dev/media0 v4l2-compliance 1.25.0, 64 bits, 64-bit time_t
Compliance test for starfive-camss device /dev/media0:
Media Driver Info:
Driver name : starfive-camss Model : Starfive Camera Subsystem Serial : Bus info : platform:19840000.camss Media version : 6.5.0 Hardware revision: 0x00000000 (0) Driver version : 6.5.0
Required ioctls:
test MEDIA_IOC_DEVICE_INFO: OK
test invalid ioctls: OK
Allow for multiple opens:
test second /dev/media0 open: OK
test MEDIA_IOC_DEVICE_INFO: OK
test for unlimited opens: OK
Media Controller ioctls:
Entity: 0x00000001 (Name: 'stf_isp', Function: Unknown Function (00004009)) Entity: 0x00000004 (Name: 'capture_raw', Function: V4L2 I/O) Entity: 0x00000008 (Name: 'capture_yuv', Function: V4L2 I/O) Entity: 0x0000000e (Name: 'cdns_csi2rx.19800000.csi-bridge', Function: Video Interface Bridge) Entity: 0x00000018 (Name: 'imx219 6-0010', Function: Camera Sensor) Interface: 0x03000006 (Type: V4L Video, DevPath: /dev/video0) Interface: 0x0300000a (Type: V4L Video, DevPath: /dev/video1) Interface: 0x0300001c (Type: V4L Sub-Device, DevPath: /dev/v4l-subdev0) Interface: 0x0300001e (Type: V4L Sub-Device, DevPath: /dev/v4l-subdev1) Pad: 0x01000002 (0, stf_isp, Sink) Pad: 0x01000003 (1, stf_isp, Source) Pad: 0x01000005 (0, capture_raw, Sink) Pad: 0x01000009 (0, capture_yuv, Sink) Pad: 0x0100000f (0, cdns_csi2rx.19800000.csi-bridge, Sink) Pad: 0x01000010 (1, cdns_csi2rx.19800000.csi-bridge, Source) Pad: 0x01000011 (2, cdns_csi2rx.19800000.csi-bridge, Source) Pad: 0x01000012 (3, cdns_csi2rx.19800000.csi-bridge, Source) Pad: 0x01000013 (4, cdns_csi2rx.19800000.csi-bridge, Source) Pad: 0x01000019 (0, imx219 6-0010, Source) Interface Link: 0x02000007 (capture_raw to /dev/video0) Interface Link: 0x0200000b (capture_yuv to /dev/video1) Data Link: 0x0200000c (stf_isp:1 -> capture_yuv:0, Data, Enabled) Data Link: 0x02000014 (cdns_csi2rx.19800000.csi-bridge:1 -> stf_isp:0, Data, Enabled) Data Link: 0x02000016 (cdns_csi2rx.19800000.csi-bridge:1 -> capture_raw:0, Data) Data Link: 0x0200001a (imx219 6-0010:0 -> cdns_csi2rx.19800000.csi-bridge:0, Data, Enabled, Immutable) Interface Link: 0x0200001d (stf_isp to /dev/v4l-subdev0) Interface Link: 0x0200001f (imx219 6-0010 to /dev/v4l-subdev1) test MEDIA_IOC_G_TOPOLOGY: OK Entities: 5 Interfaces: 4 Pads: 10 Links: 8 Entity: 0x00000001 (Name: 'stf_isp', Type: Unknown V4L2 Sub-Device, DevPath: /dev/v4l-subdev0) Entity: 0x00000004 (Name: 'capture_raw', Type: V4L2 I/O, DevPath: /dev/video0) Entity: 0x00000008 (Name: 'capture_yuv', Type: V4L2 I/O, DevPath: /dev/video1) Entity: 0x0000000e (Name: 'cdns_csi2rx.19800000.csi-bridge', Type: Unknown V4L2 Sub-Device) Entity: 0x00000018 (Name: 'imx219 6-0010', Type: Camera Sensor, DevPath: /dev/v4l-subdev1) test MEDIA_IOC_ENUM_ENTITIES/LINKS: OK test MEDIA_IOC_SETUP_LINK: OK
Total for starfive-camss device /dev/media0: 8, Succeeded: 8, Failed: 0, Warnings: 0 #
--
Regards,
Jack Zhu
Hi Jack,
Quoted 231 lines · Jack Zhu
Quoted 155 lines · Hans Verkuil
Quoted 154 lines · Jack Zhu
Quoted 141 lines · Hans Verkuil
Quoted 86 lines · Jack Zhu
Hi,
This series is the v9 series that attempts to support the Camera Subsystem found on StarFive JH7110 SoC.
This series is based on top of the master branch of
media_stagerepository.The following are the media graph for the device and the v4l2-compliance output.
===========================================================================
[the media graph]:digraph board { rankdir=TB n00000001 [label="{{<port0> 0} | stf_isp\n/dev/v4l-subdev0 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green] n00000001:port1 -> n00000008 [style=dashed] n00000004 [label="capture_raw\n/dev/video0", shape=box, style=filled, fillcolor=yellow] n00000008 [label="capture_yuv\n/dev/video1", shape=box, style=filled, fillcolor=yellow] n0000000e [label="{{<port0> 0} | cdns_csi2rx.19800000.csi-bridge\n | {<port1> 1 | <port2> 2 | <port3> 3 | <port4> 4}}", shape=Mrecord, style=filled, fillcolor=green] n0000000e:port1 -> n00000001:port0 [style=dashed] n0000000e:port1 -> n00000004 [style=dashed] n00000018 [label="{{} | imx219 6-0010\n/dev/v4l-subdev1 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green] n00000018:port0 -> n0000000e:port0 [style=bold] }[the device topology]:
Media controller API version 6.5.0
Media device information
------------------------
driver starfive-camss
model Starfive Camera Subsystem
serialbus info platform:19840000.camss hw revision 0x0 driver version 6.5.0Device topology
- entity 1:stf_isp(2 pads, 2 links)type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev0 pad0: Sink [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb crop.bounds:(0,0)/1920x1080 crop:(0,0)/1920x1080] <- "cdns_csi2rx.19800000.csi-bridge":1 [] pad1: Source [fmt:YUYV8_1_5X8/1920x1080 field:none colorspace:srgb crop.bounds:(0,0)/1920x1080 crop:(0,0)/1920x1080] -> "capture_yuv":0 []- entity 4:
capture_raw(1 pad, 1 link)
type Node subtype V4L flags 0
device node name/dev/video0
pad0: Sink
<- "cdns_csi2rx.19800000.csi-bridge":1 []- entity 8:
capture_yuv(1 pad, 1 link)
type Node subtype V4L flags 0
device node name/dev/video1
pad0: Sink
<- "stf_isp":1 []- entity 14: cdns_csi2rx.19800000.csi-bridge (5 pads, 3 links)
type V4L2 subdev subtype Unknown flags 0 pad0: Sink <- "imx219 6-0010":0 [ENABLED,IMMUTABLE] pad1: Source -> "stf_isp":0 [] -> "capture_raw":0 [] pad2: Source pad3: Source pad4: Source- entity 24: imx219 6-0010 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev1 pad0: Source [fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range crop.bounds:(8,8)/3280x2464 crop:(8,8)/3280x2464] -> "cdns_csi2rx.19800000.csi-bridge":0 [ENABLED,IMMUTABLE]Quoted 4 lines
===========================================================================
[the v4l2-compliance output]:v4l2-compliance 1.24.1, 64 bits, 64-bit
time_tThis v4l2-compliance version is from a distro. For driver acceptance you
must test with a v4l2-compliance compiled from the git repo (git://linuxtv.org/v4l-utils.git).Also, since this driver uses the media controller, you must run v4l2-compliance with the -m
/dev/mediaXoption. This will test the compliance of all devices reported by the media controller.Quoted 5 lines
Compliance test for stf camss device
/dev/video1:Driver Info:
Driver name : stf camssThe module is called starfive-camss, so shouldn't the driver name reported here be the same?
Quoted 4 lines
Card type : Starfive Camera Subsystem Bus info : platform:19840000.camss Driver version : 6.5.0 Capabilities : 0x84200001Quoted 10 lines
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps :0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : starfive-camssIt's correct in the media controller information.
Quoted 7 lines
Model : Starfive Camera Subsystem Serial : Bus info : platform:19840000.camss Media version : 6.5.0 Hardware revision: 0x00000000 (0) Driver version : 6.5.0Interface Info:
Quoted 8 lines
ID : 0x0300000a Type : V4L Video Entity Info: ID : 0x00000008 (8) Name : capture_yuv Function : V4L2 I/O Pad 0x01000009 : 0: Sink Link 0x0200000c: from remote pad 0x1000003 of entity 'stf_isp' (Unknown Function (00004009)): Data, EnabledQuoted 4 lines
Hmm, this reports "Unknown Function". I bet that when you run v4l2-compliance with the -m option it will fail on this. If not, then that's likely a bug in the compliance test, please let me know if that's the case.
Hi Hans,
The following is the latest test log, which does not report a failure, but also reports "Unknown Function".
Quoted 8 lines
Quoted 3 lines
I make the following settings in the
stf-isp.cfile:
v4l2_subdev.entity.function =MEDIA_ENT_F_PROC_VIDEO_ISP;Can you post the output of:
v4l2-compliance --verbose -M
/dev/media0Output log of the above command:
#
# v4l2-compliance --verbose -M /dev/media0 v4l2-compliance 1.25.0, 64 bits, 64-bit time_tCompliance test for starfive-camss device
/dev/media0:Media Driver Info:
Driver name : starfive-camss Model : Starfive Camera Subsystem Serial : Bus info : platform:19840000.camss Media version : 6.5.0 Hardware revision: 0x00000000 (0) Driver version : 6.5.0Required ioctls:
testMEDIA_IOC_DEVICE_INFO: OK
test invalid ioctls: OKAllow for multiple opens:
test second/dev/media0open: OK
testMEDIA_IOC_DEVICE_INFO: OK
test for unlimited opens: OKMedia Controller ioctls:
Entity: 0x00000001 (Name: 'stf_isp', Function: Unknown Function (00004009)) Entity: 0x00000004 (Name: 'capture_raw', Function: V4L2 I/O) Entity: 0x00000008 (Name: 'capture_yuv', Function: V4L2 I/O) Entity: 0x0000000e (Name: 'cdns_csi2rx.19800000.csi-bridge', Function: Video Interface Bridge) Entity: 0x00000018 (Name: 'imx219 6-0010', Function: Camera Sensor) Interface: 0x03000006 (Type: V4L Video, DevPath: /dev/video0) Interface: 0x0300000a (Type: V4L Video, DevPath: /dev/video1) Interface: 0x0300001c (Type: V4L Sub-Device, DevPath: /dev/v4l-subdev0) Interface: 0x0300001e (Type: V4L Sub-Device, DevPath: /dev/v4l-subdev1) Pad: 0x01000002 (0, stf_isp, Sink) Pad: 0x01000003 (1, stf_isp, Source) Pad: 0x01000005 (0, capture_raw, Sink) Pad: 0x01000009 (0, capture_yuv, Sink) Pad: 0x0100000f (0, cdns_csi2rx.19800000.csi-bridge, Sink) Pad: 0x01000010 (1, cdns_csi2rx.19800000.csi-bridge, Source) Pad: 0x01000011 (2, cdns_csi2rx.19800000.csi-bridge, Source) Pad: 0x01000012 (3, cdns_csi2rx.19800000.csi-bridge, Source) Pad: 0x01000013 (4, cdns_csi2rx.19800000.csi-bridge, Source) Pad: 0x01000019 (0, imx219 6-0010, Source) Interface Link: 0x02000007 (capture_raw to /dev/video0) Interface Link: 0x0200000b (capture_yuv to /dev/video1) Data Link: 0x0200000c (stf_isp:1 -> capture_yuv:0, Data, Enabled) Data Link: 0x02000014 (cdns_csi2rx.19800000.csi-bridge:1 -> stf_isp:0, Data, Enabled) Data Link: 0x02000016 (cdns_csi2rx.19800000.csi-bridge:1 -> capture_raw:0, Data) Data Link: 0x0200001a (imx219 6-0010:0 -> cdns_csi2rx.19800000.csi-bridge:0, Data, Enabled, Immutable) Interface Link: 0x0200001d (stf_isp to /dev/v4l-subdev0) Interface Link: 0x0200001f (imx219 6-0010 to /dev/v4l-subdev1) test MEDIA_IOC_G_TOPOLOGY: OK Entities: 5 Interfaces: 4 Pads: 10 Links: 8 Entity: 0x00000001 (Name: 'stf_isp', Type: Unknown V4L2 Sub-Device, DevPath: /dev/v4l-subdev0) Entity: 0x00000004 (Name: 'capture_raw', Type: V4L2 I/O, DevPath: /dev/video0) Entity: 0x00000008 (Name: 'capture_yuv', Type: V4L2 I/O, DevPath: /dev/video1) Entity: 0x0000000e (Name: 'cdns_csi2rx.19800000.csi-bridge', Type: Unknown V4L2 Sub-Device) Entity: 0x00000018 (Name: 'imx219 6-0010', Type: Camera Sensor, DevPath: /dev/v4l-subdev1) test MEDIA_IOC_ENUM_ENTITIES/LINKS: OK test MEDIA_IOC_SETUP_LINK: OK
Quoted 1 line
Total for starfive-camss device
/dev/media0: 8, Succeeded: 8, Failed: 0, Warnings: 0
Much appreciated. I found several logic bugs in v4l-utils that hid this failure.
It is now fixed in the v4l-utils git repo: https://git.linuxtv.org/v4l-utils.git/log/
This also adds the missing support for MEDIA_ENT_F_PROC_VIDEO_ISP.
If you compile v4l2-compliance from the git repo, then this should now work fine.
Regards,
Hans