mbox series

[v5,00/14] Add ISP 3A for StarFive

Message ID 20240709083824.430473-1-changhuang.liang@starfivetech.com
Headers show
Series Add ISP 3A for StarFive | expand

Message

Changhuang Liang July 9, 2024, 8:38 a.m. UTC
This series implements the ISP 3A function to the Camera Subsystem on StarFive
JH7110 SoC. The series has been tested on the VisionFive 2 board.

This series is based on top of the master branch of media_stage repository,
which is tested with a v4l2-compliance compiled from the git repo
(git://linuxtv.org/v4l-utils.git).

changes since v4:
- Rebase on top of the master branch of media_stage repository.
- Insert a new PATCH 13
- PATCH 1:
1. Fix spelling error:
	- corsstakl -> crosstalk
	- balck -> black
	- magbitude -> magnitude
	- FALG -> FLAG
2. Exchange of the values of JH7110_ISP_SC_FLAG_AE_AF and JH7110_ISP_SC_FLAG_AWB

- PATCH 8:
1. Synchronous spelling error: FALG -> FLAG
2. Add:

if (*num_planes)
	return sizes[0] < sizeof(struct jh7110_isp_sc_buffer) ? -EINVAL : 0;

- PATCH 11:
1. Drop read hook.
2. Add:

if (*num_planes)
	return sizes[0] < sizeof(struct jh7110_isp_params_buffer) ? -EINVAL : 0;

- PATCH 12:
1. Add:

ready_buf->vb.vb2_buf.timestamp = ktime_get_ns();
ready_buf->vb.sequence = output->buffers.sequence++;

to fix "v4l2-compliance -s" Failed.

v4: https://lore.kernel.org/all/20240402100011.13480-1-changhuang.liang@starfivetech.com/

changes since v3:
- Rebased on top of the master branch of media_stage repository and patch [1][2].
- Replaced "stf_get_isp_scd_type" with "stf_isp_get_scd_type" in PATCH 8.

v3: https://lore.kernel.org/all/20240205090424.40302-1-changhuang.liang@starfivetech.com/

changes since v2:
- Rebased on top of the master branch of media_stage repository.
- Added helper function "media_entity_remove_links" in PATCH 8 and PATCH 11 to cleanup links.

v2: https://lore.kernel.org/all/20240111084120.16685-1-changhuang.liang@starfivetech.com/

changes since v1:
- Rebased on top of the master branch of media_stage repository.
- Documentated ISP submodule.
- Added new ISP parameters format and document it.
- Added a meta output video device and link to ISP subdev.
- Replaced control with meta output video buffer for write ISP parameters.
- Separated buffer operation which can use for capture and output device.
- Droped ISP frame sync event.

v1: https://lore.kernel.org/all/20231214065027.28564-1-changhuang.liang@starfivetech.com/

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 | <port1> 1} | stf_isp\n/dev/v4l-subdev0 | {<port2> 2 | <port3> 3}}", shape=Mrecord, style=filled, fillcolor=green]
	n00000001:port2 -> n0000000e
	n00000001:port3 -> n00000012 [style=dashed]
	n00000006 [label="output_params\n/dev/video0", shape=box, style=filled, fillcolor=yellow]
	n00000006 -> n00000001:port1 [style=dashed]
	n0000000a [label="capture_raw\n/dev/video1", shape=box, style=filled, fillcolor=yellow]
	n0000000e [label="capture_yuv\n/dev/video2", shape=box, style=filled, fillcolor=yellow]
	n00000012 [label="capture_scd\n/dev/video3", shape=box, style=filled, fillcolor=yellow]
	n0000001c [label="{{<port0> 0} | cdns_csi2rx.19800000.csi-bridge\n/dev/v4l-subdev1 | {<port1> 1 | <port2> 2 | <port3> 3 | <port4> 4}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000001c:port1 -> n00000001:port0 [style=dashed]
	n0000001c:port1 -> n0000000a [style=dashed]
	n00000026 [label="{{} | imx219 6-0010\n/dev/v4l-subdev2 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green]
	n00000026:port0 -> n0000001c:port0 [style=bold]
}

[v4l2-compliance test]:

# ./v4l2-compliance -s -d /dev/video0
v4l2-compliance 1.27.0-5220, 64 bits, 64-bit time_t
v4l2-compliance SHA: 8387e3673837 2024-07-01 11:09:32

Compliance test for starfive-camss device /dev/video0:

Driver Info:
        Driver name      : starfive-camss
        Card type        : Starfive Camera Subsystem
        Bus info         : platform:19840000.isp
        Driver version   : 6.10.0
        Capabilities     : 0xac200000
                Metadata Output
                I/O MC
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x2c200000
                Metadata Output
                I/O MC
                Streaming
                Extended Pix Format
Media Driver Info:
        Driver name      : starfive-camss
        Model            : Starfive Camera Subsystem
        Serial           :
        Bus info         : platform:19840000.isp
        Media version    : 6.10.0
        Hardware revision: 0x00000000 (0)
        Driver version   : 6.10.0
Interface Info:
        ID               : 0x03000008
        Type             : V4L Video
Entity Info:
        ID               : 0x00000006 (6)
        Name             : output_params
        Function         : V4L2 I/O
        Pad 0x01000007   : 0: Source
          Link 0x0200001a: to remote pad 0x1000003 of entity 'stf_isp' (Image Signal Processor): 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
        test VIDIOC_G/S_AUDOUT: OK (Not Supported)
        Outputs: 1 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 (Output 0):
        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 (Output 0):
        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 (Not Supported)

Codec ioctls (Output 0):
        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 (Output 0):
        test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
        test CREATE_BUFS maximum buffers: OK
        test VIDIOC_REMOVE_BUFS: OK
        test VIDIOC_EXPBUF: OK
        test Requests: OK (Not Supported)

Test output 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 starfive-camss device /dev/video0: 55, Succeeded: 55, Failed: 0, Warnings: 0

# ./v4l2-compliance -s -d /dev/video3
v4l2-compliance 1.27.0-5220, 64 bits, 64-bit time_t
v4l2-compliance SHA: 8387e3673837 2024-07-01 11:09:32

Compliance test for starfive-camss device /dev/video3:

Driver Info:
        Driver name      : starfive-camss
        Card type        : Starfive Camera Subsystem
        Bus info         : platform:19840000.isp
        Driver version   : 6.10.0
        Capabilities     : 0xa4a00000
                Metadata Capture
                I/O MC
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x24a00000
                Metadata Capture
                I/O MC
                Streaming
                Extended Pix Format
Media Driver Info:
        Driver name      : starfive-camss
        Model            : Starfive Camera Subsystem
        Serial           :
        Bus info         : platform:19840000.isp
        Media version    : 6.10.0
        Hardware revision: 0x00000000 (0)
        Driver version   : 6.10.0
Interface Info:
        ID               : 0x03000014
        Type             : V4L Video
Entity Info:
        ID               : 0x00000012 (18)
        Name             : capture_scd
        Function         : V4L2 I/O
        Pad 0x01000013   : 0: Sink
          Link 0x02000018: from remote pad 0x1000005 of entity 'stf_isp' (Image Signal Processor): 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/video3 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
        test VIDIOC_G/S_AUDIO: OK (Not Supported)
        Inputs: 1 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 (Input 0):
        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 (Input 0):
        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 (Not Supported)

Codec ioctls (Input 0):
        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 (Input 0):
        test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
        test CREATE_BUFS maximum buffers: OK
        test VIDIOC_REMOVE_BUFS: 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 starfive-camss device /dev/video3: 55, Succeeded: 55, Failed: 0, Warnings: 0

Changhuang Liang (14):
  media: starfive: Add JH7110 ISP module definitions
  media: Documentation: Add description for StarFive ISP metadata
    formats
  media: videodev2.h, v4l2-ioctl: Add StarFive ISP meta buffer format
  staging: media: starfive: Add a params sink pad and a scd source pad
    for ISP
  staging: media: starfive: Separate buffer from ISP hardware operation
  staging: media: starfive: Separate buffer be a common file
  staging: media: starfive: Separate ISP hardware from capture device
  staging: media: starfive: Add for StarFive ISP 3A SC
  staging: media: starfive: Update ISP initialise config for 3A
  staging: media: starfive: Add V4L2_CAP_IO_MC capability
  staging: media: starfive: Add ISP params video device
  staging: media: starfive: Add ISP parameters hardware configure
  staging: media: starfive: Drop read support for video capture devices
  admin-guide: media: Update documents for StarFive Camera Subsystem

 .../admin-guide/media/starfive_camss.rst      |  11 +-
 .../media/starfive_camss_graph.dot            |  22 +-
 .../media/v4l/metafmt-starfive-isp.rst        |  75 ++
 MAINTAINERS                                   |   2 +
 drivers/media/v4l2-core/v4l2-ioctl.c          |   2 +
 drivers/staging/media/starfive/camss/Makefile |   3 +
 .../staging/media/starfive/camss/stf-buffer.c | 166 ++++
 .../staging/media/starfive/camss/stf-buffer.h |  53 ++
 .../staging/media/starfive/camss/stf-camss.c  |  38 +-
 .../staging/media/starfive/camss/stf-camss.h  |  12 +
 .../media/starfive/camss/stf-capture.c        | 248 +-----
 .../media/starfive/camss/stf-capture.h        |  22 -
 .../media/starfive/camss/stf-isp-hw-ops.c     | 722 +++++++++++++++++
 .../media/starfive/camss/stf-isp-params.c     | 240 ++++++
 .../staging/media/starfive/camss/stf-isp.c    |  77 +-
 .../staging/media/starfive/camss/stf-isp.h    | 188 +++++
 .../staging/media/starfive/camss/stf-output.c |  83 ++
 .../staging/media/starfive/camss/stf-output.h |  22 +
 .../staging/media/starfive/camss/stf-video.c  | 147 +++-
 .../staging/media/starfive/camss/stf-video.h  |  11 +-
 include/uapi/linux/jh7110-isp.h               | 739 ++++++++++++++++++
 include/uapi/linux/videodev2.h                |   4 +
 22 files changed, 2608 insertions(+), 279 deletions(-)
 create mode 100644 Documentation/userspace-api/media/v4l/metafmt-starfive-isp.rst
 create mode 100644 drivers/staging/media/starfive/camss/stf-buffer.c
 create mode 100644 drivers/staging/media/starfive/camss/stf-buffer.h
 create mode 100644 drivers/staging/media/starfive/camss/stf-isp-params.c
 create mode 100644 drivers/staging/media/starfive/camss/stf-output.c
 create mode 100644 drivers/staging/media/starfive/camss/stf-output.h
 create mode 100644 include/uapi/linux/jh7110-isp.h

--
2.25.1

Comments

Jacopo Mondi July 10, 2024, 9:22 a.m. UTC | #1
Hi Changhuang

On Tue, Jul 09, 2024 at 01:38:12AM GMT, Changhuang Liang wrote:
> Add description for V4L2_META_FMT_STF_ISP_PARAMS and
> V4L2_META_FMT_STF_ISP_STAT_3A meta data formats.
>
> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>

I get this warnings when compiling documentation

Please fix these in the uapi header

../include/uapi/linux/jh7110-isp.h:17: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
 * ISP Module Diagram
../include/uapi/linux/jh7110-isp.h:152: warning: expecting prototype for struct jh7110_isp_cfa_params. Prototype was for struct jh7110_isp_cfa_setting instead
../include/uapi/linux/jh7110-isp.h:178: warning: expecting prototype for struct jh7110_isp_ctc_params. Prototype was for struct jh7110_isp_ctc_setting instead
../include/uapi/linux/jh7110-isp.h:200: warning: expecting prototype for struct jh7110_isp_dbc_params. Prototype was for struct jh7110_isp_dbc_setting instead
../include/uapi/linux/jh7110-isp.h:226: warning: expecting prototype for struct jh7110_isp_dnyuv_params. Prototype was for struct jh7110_isp_dnyuv_setting instead
../include/uapi/linux/jh7110-isp.h:707: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
 * Statistics Collection Meta Data Flag

and this in the documentation here below:

Documentation/userspace-api/media/v4l/metafmt-starfive-isp.rst:73: WARNING: Title underline too short.

JH7110 ISP uAPI data types
======================

Documentation/userspace-api/media/v4l/metafmt-starfive-isp.rst: WARNING: document isn't included in any toctree

(You should  add this file to
Documentation/userspace-api/media/v4l/meta-formats.rst)

> ---
>  .../media/v4l/metafmt-starfive-isp.rst        | 75 +++++++++++++++++++
>  MAINTAINERS                                   |  1 +
>  2 files changed, 76 insertions(+)
>  create mode 100644 Documentation/userspace-api/media/v4l/metafmt-starfive-isp.rst
>
> diff --git a/Documentation/userspace-api/media/v4l/metafmt-starfive-isp.rst b/Documentation/userspace-api/media/v4l/metafmt-starfive-isp.rst
> new file mode 100644
> index 000000000000..ebb4291833d6
> --- /dev/null
> +++ b/Documentation/userspace-api/media/v4l/metafmt-starfive-isp.rst
> @@ -0,0 +1,75 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +
> +.. _v4l2-meta-fmt-stf-isp-params:
> +
> +.. _v4l2-meta-fmt-stf-isp-stat-3a:
> +
> +*****************************************************************************
> +V4L2_META_FMT_STF_ISP_PARAMS ('stfp'), V4L2_META_FMT_STF_ISP_STAT_3A ('stfs')
> +*****************************************************************************
> +
> +.. jh7110_isp_params_buffer
> +
> +Configuration parameters
> +========================
> +
> +The configuration parameters are passed to the "output_params" metadata output
> +video node, using the :c:type:`v4l2_meta_format` interface. They are formatted
> +as described by the :c:type:`jh7110_isp_params_buffer` structure.
> +
> +.. code-block:: c
> +
> +	struct jh7110_isp_params_buffer {
> +		__u32 enable_setting;
> +		struct jh7110_isp_wb_setting wb_setting;
> +		struct jh7110_isp_car_setting car_setting;
> +		struct jh7110_isp_ccm_setting ccm_setting;
> +		struct jh7110_isp_cfa_setting cfa_setting;
> +		struct jh7110_isp_ctc_setting ctc_setting;
> +		struct jh7110_isp_dbc_setting dbc_setting;
> +		struct jh7110_isp_dnyuv_setting dnyuv_setting;
> +		struct jh7110_isp_gmargb_setting gmargb_setting;
> +		struct jh7110_isp_lccf_setting lccf_setting;
> +		struct jh7110_isp_obc_setting obc_setting;
> +		struct jh7110_isp_oecf_setting oecf_setting;
> +		struct jh7110_isp_r2y_setting r2y_setting;
> +		struct jh7110_isp_sat_setting sat_setting;
> +		struct jh7110_isp_sharp_setting sharp_setting;
> +		struct jh7110_isp_ycrv_setting ycrv_setting;
> +		struct jh7110_isp_sc_setting sc_setting;
> +	};
> +
> +.. jh7110_isp_sc_buffer

Is this used ?

> +
> +3A and histogram statistics
> +===========================
> +
> +The ISP device collects different statistics over an input Bayer frame.
> +Those statistics are obtained from the "capture_scd" metadata capture video
> +node, using the :c:type:`v4l2_meta_format` interface. They are formatted as
> +described by the :c:type:`jh7110_isp_sc_buffer` structure.
> +
> +.. code-block:: c
> +
> +	struct jh7110_isp_sc_buffer {
> +		__u32 y_histogram[64];
> +		__u32 reserv0[33];
> +		__u32 bright_sc[4096];
> +		__u32 reserv1[96];
> +		__u32 ae_hist_y[128];
> +		__u32 reserv2[511];
> +		__u16 flag;
> +	};
> +
> +The statistics collected are Auto Exposure, AWB (Auto-white balance), Histogram
> +and AF (Auto-focus). See :c:type:`jh7110_isp_sc_buffer` for details of the
> +statistics.
> +
> +The 3A statistics and configuration parameters described here are usually
> +consumed and produced by dedicated user space libraries that comprise the
> +important tuning tools using software control loop.
> +
> +JH7110 ISP uAPI data types
> +======================
> +
> +.. kernel-doc:: include/uapi/linux/jh7110-isp.h
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 890604eb0d64..8fd613c93e62 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -21304,6 +21304,7 @@ L:	linux-media@vger.kernel.org
>  S:	Maintained
>  F:	Documentation/admin-guide/media/starfive_camss.rst
>  F:	Documentation/devicetree/bindings/media/starfive,jh7110-camss.yaml
> +F:	Documentation/userspace-api/media/v4l/metafmt-starfive-isp.rst
>  F:	drivers/staging/media/starfive/camss
>  F:	include/uapi/linux/jh7110-isp.h
>
> --
> 2.25.1
>
>
Changhuang Liang July 10, 2024, 1:10 p.m. UTC | #2
Hi Jacopo

Thanks for your comments.

> 
> Hi Changhuang
> 
> On Tue, Jul 09, 2024 at 01:38:20AM GMT, Changhuang Liang wrote:
> > Add V4L2_CAP_IO_MC capabality for video device. User space can
> > enumerate formats by mbus code.
> >
> > Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
> > ---
> >  drivers/staging/media/starfive/camss/stf-video.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/media/starfive/camss/stf-video.c
> > b/drivers/staging/media/starfive/camss/stf-video.c
> > index 2203605ec9c7..8c6c45d8b7a1 100644
> > --- a/drivers/staging/media/starfive/camss/stf-video.c
> > +++ b/drivers/staging/media/starfive/camss/stf-video.c
> > @@ -668,7 +668,7 @@ int stf_video_register(struct stfcamss_video *video,
> >  	}
> >
> >  	vdev->fops = &stf_vid_fops;
> > -	vdev->device_caps |= V4L2_CAP_STREAMING;
> > +	vdev->device_caps |= V4L2_CAP_STREAMING | V4L2_CAP_IO_MC;
> 
> Does this set the flag for the stat node as well ? Not that it hurts but filtering
> on mbus code where only METADATA_FIXED is allowed doesn't make much
> sense ?
> 
> Same for the parameters node
> 

Yes, I will drop this flag from stat node and parameters node.

> >  	vdev->entity.ops = &stf_media_ops;
> >  	vdev->vfl_dir = VFL_DIR_RX;
> >  	vdev->release = stf_video_release;
> > --

Regards,
Changhuang
Jacopo Mondi July 10, 2024, 1:22 p.m. UTC | #3
Hi Changhuang

I've passed the series through the media-staging CI
https://gitlab.freedesktop.org/linux-media/users/jmondi/-/pipelines/1220920
Could you check the errors reported there ?


On Tue, Jul 09, 2024 at 01:38:10AM GMT, Changhuang Liang wrote:
> This series implements the ISP 3A function to the Camera Subsystem on StarFive
> JH7110 SoC. The series has been tested on the VisionFive 2 board.
>
> This series is based on top of the master branch of media_stage repository,
> which is tested with a v4l2-compliance compiled from the git repo
> (git://linuxtv.org/v4l-utils.git).
>
> changes since v4:
> - Rebase on top of the master branch of media_stage repository.
> - Insert a new PATCH 13
> - PATCH 1:
> 1. Fix spelling error:
> 	- corsstakl -> crosstalk
> 	- balck -> black
> 	- magbitude -> magnitude
> 	- FALG -> FLAG
> 2. Exchange of the values of JH7110_ISP_SC_FLAG_AE_AF and JH7110_ISP_SC_FLAG_AWB
>
> - PATCH 8:
> 1. Synchronous spelling error: FALG -> FLAG
> 2. Add:
>
> if (*num_planes)
> 	return sizes[0] < sizeof(struct jh7110_isp_sc_buffer) ? -EINVAL : 0;
>
> - PATCH 11:
> 1. Drop read hook.
> 2. Add:
>
> if (*num_planes)
> 	return sizes[0] < sizeof(struct jh7110_isp_params_buffer) ? -EINVAL : 0;
>
> - PATCH 12:
> 1. Add:
>
> ready_buf->vb.vb2_buf.timestamp = ktime_get_ns();
> ready_buf->vb.sequence = output->buffers.sequence++;
>
> to fix "v4l2-compliance -s" Failed.
>
> v4: https://lore.kernel.org/all/20240402100011.13480-1-changhuang.liang@starfivetech.com/
>
> changes since v3:
> - Rebased on top of the master branch of media_stage repository and patch [1][2].
> - Replaced "stf_get_isp_scd_type" with "stf_isp_get_scd_type" in PATCH 8.
>
> v3: https://lore.kernel.org/all/20240205090424.40302-1-changhuang.liang@starfivetech.com/
>
> changes since v2:
> - Rebased on top of the master branch of media_stage repository.
> - Added helper function "media_entity_remove_links" in PATCH 8 and PATCH 11 to cleanup links.
>
> v2: https://lore.kernel.org/all/20240111084120.16685-1-changhuang.liang@starfivetech.com/
>
> changes since v1:
> - Rebased on top of the master branch of media_stage repository.
> - Documentated ISP submodule.
> - Added new ISP parameters format and document it.
> - Added a meta output video device and link to ISP subdev.
> - Replaced control with meta output video buffer for write ISP parameters.
> - Separated buffer operation which can use for capture and output device.
> - Droped ISP frame sync event.
>
> v1: https://lore.kernel.org/all/20231214065027.28564-1-changhuang.liang@starfivetech.com/
>
> 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 | <port1> 1} | stf_isp\n/dev/v4l-subdev0 | {<port2> 2 | <port3> 3}}", shape=Mrecord, style=filled, fillcolor=green]
> 	n00000001:port2 -> n0000000e
> 	n00000001:port3 -> n00000012 [style=dashed]
> 	n00000006 [label="output_params\n/dev/video0", shape=box, style=filled, fillcolor=yellow]
> 	n00000006 -> n00000001:port1 [style=dashed]
> 	n0000000a [label="capture_raw\n/dev/video1", shape=box, style=filled, fillcolor=yellow]
> 	n0000000e [label="capture_yuv\n/dev/video2", shape=box, style=filled, fillcolor=yellow]
> 	n00000012 [label="capture_scd\n/dev/video3", shape=box, style=filled, fillcolor=yellow]
> 	n0000001c [label="{{<port0> 0} | cdns_csi2rx.19800000.csi-bridge\n/dev/v4l-subdev1 | {<port1> 1 | <port2> 2 | <port3> 3 | <port4> 4}}", shape=Mrecord, style=filled, fillcolor=green]
> 	n0000001c:port1 -> n00000001:port0 [style=dashed]
> 	n0000001c:port1 -> n0000000a [style=dashed]
> 	n00000026 [label="{{} | imx219 6-0010\n/dev/v4l-subdev2 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green]
> 	n00000026:port0 -> n0000001c:port0 [style=bold]
> }
>
> [v4l2-compliance test]:
>
> # ./v4l2-compliance -s -d /dev/video0
> v4l2-compliance 1.27.0-5220, 64 bits, 64-bit time_t
> v4l2-compliance SHA: 8387e3673837 2024-07-01 11:09:32
>
> Compliance test for starfive-camss device /dev/video0:
>
> Driver Info:
>         Driver name      : starfive-camss
>         Card type        : Starfive Camera Subsystem
>         Bus info         : platform:19840000.isp
>         Driver version   : 6.10.0
>         Capabilities     : 0xac200000
>                 Metadata Output
>                 I/O MC
>                 Streaming
>                 Extended Pix Format
>                 Device Capabilities
>         Device Caps      : 0x2c200000
>                 Metadata Output
>                 I/O MC
>                 Streaming
>                 Extended Pix Format
> Media Driver Info:
>         Driver name      : starfive-camss
>         Model            : Starfive Camera Subsystem
>         Serial           :
>         Bus info         : platform:19840000.isp
>         Media version    : 6.10.0
>         Hardware revision: 0x00000000 (0)
>         Driver version   : 6.10.0
> Interface Info:
>         ID               : 0x03000008
>         Type             : V4L Video
> Entity Info:
>         ID               : 0x00000006 (6)
>         Name             : output_params
>         Function         : V4L2 I/O
>         Pad 0x01000007   : 0: Source
>           Link 0x0200001a: to remote pad 0x1000003 of entity 'stf_isp' (Image Signal Processor): 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
>         test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>         Outputs: 1 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 (Output 0):
>         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 (Output 0):
>         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 (Not Supported)
>
> Codec ioctls (Output 0):
>         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 (Output 0):
>         test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>         test CREATE_BUFS maximum buffers: OK
>         test VIDIOC_REMOVE_BUFS: OK
>         test VIDIOC_EXPBUF: OK
>         test Requests: OK (Not Supported)
>
> Test output 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 starfive-camss device /dev/video0: 55, Succeeded: 55, Failed: 0, Warnings: 0
>
> # ./v4l2-compliance -s -d /dev/video3
> v4l2-compliance 1.27.0-5220, 64 bits, 64-bit time_t
> v4l2-compliance SHA: 8387e3673837 2024-07-01 11:09:32
>
> Compliance test for starfive-camss device /dev/video3:
>
> Driver Info:
>         Driver name      : starfive-camss
>         Card type        : Starfive Camera Subsystem
>         Bus info         : platform:19840000.isp
>         Driver version   : 6.10.0
>         Capabilities     : 0xa4a00000
>                 Metadata Capture
>                 I/O MC
>                 Streaming
>                 Extended Pix Format
>                 Device Capabilities
>         Device Caps      : 0x24a00000
>                 Metadata Capture
>                 I/O MC
>                 Streaming
>                 Extended Pix Format
> Media Driver Info:
>         Driver name      : starfive-camss
>         Model            : Starfive Camera Subsystem
>         Serial           :
>         Bus info         : platform:19840000.isp
>         Media version    : 6.10.0
>         Hardware revision: 0x00000000 (0)
>         Driver version   : 6.10.0
> Interface Info:
>         ID               : 0x03000014
>         Type             : V4L Video
> Entity Info:
>         ID               : 0x00000012 (18)
>         Name             : capture_scd
>         Function         : V4L2 I/O
>         Pad 0x01000013   : 0: Sink
>           Link 0x02000018: from remote pad 0x1000005 of entity 'stf_isp' (Image Signal Processor): 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/video3 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
>         test VIDIOC_G/S_AUDIO: OK (Not Supported)
>         Inputs: 1 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 (Input 0):
>         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 (Input 0):
>         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 (Not Supported)
>
> Codec ioctls (Input 0):
>         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 (Input 0):
>         test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>         test CREATE_BUFS maximum buffers: OK
>         test VIDIOC_REMOVE_BUFS: 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 starfive-camss device /dev/video3: 55, Succeeded: 55, Failed: 0, Warnings: 0
>
> Changhuang Liang (14):
>   media: starfive: Add JH7110 ISP module definitions
>   media: Documentation: Add description for StarFive ISP metadata
>     formats
>   media: videodev2.h, v4l2-ioctl: Add StarFive ISP meta buffer format
>   staging: media: starfive: Add a params sink pad and a scd source pad
>     for ISP
>   staging: media: starfive: Separate buffer from ISP hardware operation
>   staging: media: starfive: Separate buffer be a common file
>   staging: media: starfive: Separate ISP hardware from capture device
>   staging: media: starfive: Add for StarFive ISP 3A SC
>   staging: media: starfive: Update ISP initialise config for 3A
>   staging: media: starfive: Add V4L2_CAP_IO_MC capability
>   staging: media: starfive: Add ISP params video device
>   staging: media: starfive: Add ISP parameters hardware configure
>   staging: media: starfive: Drop read support for video capture devices
>   admin-guide: media: Update documents for StarFive Camera Subsystem
>
>  .../admin-guide/media/starfive_camss.rst      |  11 +-
>  .../media/starfive_camss_graph.dot            |  22 +-
>  .../media/v4l/metafmt-starfive-isp.rst        |  75 ++
>  MAINTAINERS                                   |   2 +
>  drivers/media/v4l2-core/v4l2-ioctl.c          |   2 +
>  drivers/staging/media/starfive/camss/Makefile |   3 +
>  .../staging/media/starfive/camss/stf-buffer.c | 166 ++++
>  .../staging/media/starfive/camss/stf-buffer.h |  53 ++
>  .../staging/media/starfive/camss/stf-camss.c  |  38 +-
>  .../staging/media/starfive/camss/stf-camss.h  |  12 +
>  .../media/starfive/camss/stf-capture.c        | 248 +-----
>  .../media/starfive/camss/stf-capture.h        |  22 -
>  .../media/starfive/camss/stf-isp-hw-ops.c     | 722 +++++++++++++++++
>  .../media/starfive/camss/stf-isp-params.c     | 240 ++++++
>  .../staging/media/starfive/camss/stf-isp.c    |  77 +-
>  .../staging/media/starfive/camss/stf-isp.h    | 188 +++++
>  .../staging/media/starfive/camss/stf-output.c |  83 ++
>  .../staging/media/starfive/camss/stf-output.h |  22 +
>  .../staging/media/starfive/camss/stf-video.c  | 147 +++-
>  .../staging/media/starfive/camss/stf-video.h  |  11 +-
>  include/uapi/linux/jh7110-isp.h               | 739 ++++++++++++++++++
>  include/uapi/linux/videodev2.h                |   4 +
>  22 files changed, 2608 insertions(+), 279 deletions(-)
>  create mode 100644 Documentation/userspace-api/media/v4l/metafmt-starfive-isp.rst
>  create mode 100644 drivers/staging/media/starfive/camss/stf-buffer.c
>  create mode 100644 drivers/staging/media/starfive/camss/stf-buffer.h
>  create mode 100644 drivers/staging/media/starfive/camss/stf-isp-params.c
>  create mode 100644 drivers/staging/media/starfive/camss/stf-output.c
>  create mode 100644 drivers/staging/media/starfive/camss/stf-output.h
>  create mode 100644 include/uapi/linux/jh7110-isp.h
>
> --
> 2.25.1
>
Changhuang Liang July 11, 2024, 1:42 a.m. UTC | #4
Hi, Jacopo

Thanks for your comments.

> 
> Hi Changhuang
> 
> I've passed the series through the media-staging CI
> https://gitlab.freedesktop.org/linux-media/users/jmondi/-/pipelines/122092
> 0
> Could you check the errors reported there ?
> 

Sorry, my bad, I pulled the branch too early, forget the rebase the newest, there is a conflict in PATCH 3:

<<<<<<< HEAD
/* Vendor specific - used for RaspberryPi PiSP */
#define V4L2_META_FMT_RPI_BE_CFG	v4l2_fourcc('R', 'P', 'B', 'C') /* PiSP BE configuration */
=======
/* Vendor specific - used for StarFive JH7110 ISP camera sub-system */
#define V4L2_META_FMT_STF_ISP_PARAMS	v4l2_fourcc('S', 'T', 'F', 'P') /* StarFive ISP 3A Parameters */
#define V4L2_META_FMT_STF_ISP_STAT_3A	v4l2_fourcc('S', 'T', 'F', 'S') /* StarFive ISP 3A Statistics */
>>>>>>> 0ef1c3eb85f5 (media: videodev2.h, v4l2-ioctl: Add StarFive ISP meta buffer format)

So you didn't apply the PATCH 3.

Regards,
Changhuang
Changhuang Liang July 16, 2024, 12:31 p.m. UTC | #5
Hi, Jacopo

> 
> Hi Changhuang
> 
> On Tue, Jul 09, 2024 at 01:38:12AM GMT, Changhuang Liang wrote:
> > Add description for V4L2_META_FMT_STF_ISP_PARAMS and
> > V4L2_META_FMT_STF_ISP_STAT_3A meta data formats.
> >
> > Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
> 
> I get this warnings when compiling documentation
> 

Can you share the steps about compiling documentation?

Regards,
Changhuang
Jacopo Mondi July 16, 2024, 2:25 p.m. UTC | #6
Hi Changhuang

On Tue, Jul 16, 2024 at 12:31:31PM GMT, Changhuang Liang wrote:
> Hi, Jacopo
>
> >
> > Hi Changhuang
> >
> > On Tue, Jul 09, 2024 at 01:38:12AM GMT, Changhuang Liang wrote:
> > > Add description for V4L2_META_FMT_STF_ISP_PARAMS and
> > > V4L2_META_FMT_STF_ISP_STAT_3A meta data formats.
> > >
> > > Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
> >
> > I get this warnings when compiling documentation
> >
>
> Can you share the steps about compiling documentation?
>
Changhuang Liang July 17, 2024, 2:37 a.m. UTC | #7
Hi, Jacopo

> 
> Hi Changhuang
> 
> On Tue, Jul 16, 2024 at 12:31:31PM GMT, Changhuang Liang wrote:
> > Hi, Jacopo
> >
> > >
> > > Hi Changhuang
> > >
> > > On Tue, Jul 09, 2024 at 01:38:12AM GMT, Changhuang Liang wrote:
> > > > Add description for V4L2_META_FMT_STF_ISP_PARAMS and
> > > > V4L2_META_FMT_STF_ISP_STAT_3A meta data formats.
> > > >
> > > > Signed-off-by: Changhuang Liang
> > > > <changhuang.liang@starfivetech.com>
> > >
> > > I get this warnings when compiling documentation
> > >
> >
> > Can you share the steps about compiling documentation?
> >
> 
> From `make help`
> 
> -------------------------------------------------------------------------------
> Documentation targets:
>  Linux kernel internal documentation in different formats from ReST:
>   htmldocs        - HTML
>   texinfodocs     - Texinfo
>   infodocs        - Info
>   latexdocs       - LaTeX
>   pdfdocs         - PDF
>   epubdocs        - EPUB
>   xmldocs         - XML
>   linkcheckdocs   - check for broken external links
>                     (will connect to external hosts)
>   refcheckdocs    - check for references to non-existing files under
>                     Documentation
>   cleandocs       - clean all generated files
> 
>   make SPHINXDIRS="s1 s2" [target] Generate only docs of folder s1, s2
>   valid values for SPHINXDIRS are: PCI RCU accel accounting admin-guide
> arch block bpf cdrom core-api cpu-freq crypto dev-tools devicetree doc-guide
> driver-api fault-injection fb filesystems firmware-guide fpga gpu hid hwmon
> i2c iio infiniband input isdn kbuild kernel-hacking leds livepatch locking
> maintainer mhi misc-devices mm netlabel networking pcmcia peci power
> powerpc process riscv rust scheduler scsi security sound spi staging target tee
> timers tools trace translations usb userspace-api virt w1 watchdog wmi
> -------------------------------------------------------------------------------
> 
> To compile, in example, the userspace documentation in html:
> 
> `make $your-usual-args-here SPHINXDIRS="userspace-api" htmldocs`
> 

What should $your-usual-args-here fill? Can you share your specific commands?

This is the result of my side run here:

# make SPHINXDIRS="userspace-api" htmldocs
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/rt_link.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/rt_link.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/netdev.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/netdev.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/ovs_vport.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/ovs_vport.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/handshake.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/handshake.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/fou.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/fou.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/nftables.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/nftables.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/ovs_datapath.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/ovs_datapath.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/nfsd.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/nfsd.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/dpll.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/dpll.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/nlctrl.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/nlctrl.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/ethtool.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/ethtool.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/mptcp_pm.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/mptcp_pm.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/rt_route.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/rt_route.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/team.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/team.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/devlink.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/devlink.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/rt_addr.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/rt_addr.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/ovs_flow.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/ovs_flow.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/tc.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/tc.rst
/home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/index.rst -x
make: *** empty variable name.  Stop.
make: *** [Makefile:122: htmldocs] Error 2

Is there any special environment configuration present?

Regards,
Changhuang
Jacopo Mondi July 17, 2024, 7:11 a.m. UTC | #8
Hi Changhuang

On Wed, Jul 17, 2024 at 02:37:00AM GMT, Changhuang Liang wrote:
> Hi, Jacopo
>
> >
> > Hi Changhuang
> >
> > On Tue, Jul 16, 2024 at 12:31:31PM GMT, Changhuang Liang wrote:
> > > Hi, Jacopo
> > >
> > > >
> > > > Hi Changhuang
> > > >
> > > > On Tue, Jul 09, 2024 at 01:38:12AM GMT, Changhuang Liang wrote:
> > > > > Add description for V4L2_META_FMT_STF_ISP_PARAMS and
> > > > > V4L2_META_FMT_STF_ISP_STAT_3A meta data formats.
> > > > >
> > > > > Signed-off-by: Changhuang Liang
> > > > > <changhuang.liang@starfivetech.com>
> > > >
> > > > I get this warnings when compiling documentation
> > > >
> > >
> > > Can you share the steps about compiling documentation?
> > >
> >
> > From `make help`
> >
> > -------------------------------------------------------------------------------
> > Documentation targets:
> >  Linux kernel internal documentation in different formats from ReST:
> >   htmldocs        - HTML
> >   texinfodocs     - Texinfo
> >   infodocs        - Info
> >   latexdocs       - LaTeX
> >   pdfdocs         - PDF
> >   epubdocs        - EPUB
> >   xmldocs         - XML
> >   linkcheckdocs   - check for broken external links
> >                     (will connect to external hosts)
> >   refcheckdocs    - check for references to non-existing files under
> >                     Documentation
> >   cleandocs       - clean all generated files
> >
> >   make SPHINXDIRS="s1 s2" [target] Generate only docs of folder s1, s2
> >   valid values for SPHINXDIRS are: PCI RCU accel accounting admin-guide
> > arch block bpf cdrom core-api cpu-freq crypto dev-tools devicetree doc-guide
> > driver-api fault-injection fb filesystems firmware-guide fpga gpu hid hwmon
> > i2c iio infiniband input isdn kbuild kernel-hacking leds livepatch locking
> > maintainer mhi misc-devices mm netlabel networking pcmcia peci power
> > powerpc process riscv rust scheduler scsi security sound spi staging target tee
> > timers tools trace translations usb userspace-api virt w1 watchdog wmi
> > -------------------------------------------------------------------------------
> >
> > To compile, in example, the userspace documentation in html:
> >
> > `make $your-usual-args-here SPHINXDIRS="userspace-api" htmldocs`
> >
>
> What should $your-usual-args-here fill? Can you share your specific commands?

make -j24 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- O=./linux-build SPHINXDIRS="userspace-api" htmldocs

Make sure to adapt it to your environment

>
> This is the result of my side run here:
>
> # make SPHINXDIRS="userspace-api" htmldocs
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/rt_link.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/rt_link.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/netdev.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/netdev.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/ovs_vport.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/ovs_vport.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/handshake.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/handshake.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/fou.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/fou.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/nftables.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/nftables.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/ovs_datapath.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/ovs_datapath.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/nfsd.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/nfsd.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/dpll.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/dpll.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/nlctrl.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/nlctrl.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/ethtool.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/ethtool.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/mptcp_pm.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/mptcp_pm.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/rt_route.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/rt_route.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/team.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/team.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/devlink.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/devlink.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/rt_addr.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/rt_addr.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/ovs_flow.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/ovs_flow.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -i /home/huang/workspace/upstream/linux/Documentation/netlink/specs/tc.yaml -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/tc.rst
> /home/huang/workspace/upstream/linux/tools/net/ynl/ynl-gen-rst.py -o /home/huang/workspace/upstream/linux/Documentation/networking/netlink_spec/index.rst -x
> make: *** empty variable name.  Stop.
> make: *** [Makefile:122: htmldocs] Error 2
>
> Is there any special environment configuration present?
>
> Regards,
> Changhuang