From: Changhuang Liang <changhuang.liang@starfivetech.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>,
Benjamin Gaignard <benjamin.gaignard@collabora.com>,
Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
Mingjia Zhang <mingjia.zhang@mediatek.com>
Cc: Jack Zhu <jack.zhu@starfivetech.com>,
Keith Zhao <keith.zhao@starfivetech.com>,
Changhuang Liang <changhuang.liang@starfivetech.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-staging@lists.linux.dev
Subject: [PATCH v5 00/14] Add ISP 3A for StarFive
Date: Tue, 9 Jul 2024 01:38:10 -0700 [thread overview]
Message-ID: <20240709083824.430473-1-changhuang.liang@starfivetech.com> (raw)
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
next reply other threads:[~2024-07-09 8:38 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-09 8:38 Changhuang Liang [this message]
2024-07-09 8:38 ` [PATCH v5 01/14] media: starfive: Add JH7110 ISP module definitions Changhuang Liang
2024-07-10 9:11 ` Jacopo Mondi
2024-07-22 14:27 ` Laurent Pinchart
2024-07-22 14:33 ` Laurent Pinchart
2024-07-24 2:20 ` 回复: " Changhuang Liang
2024-07-26 23:46 ` Laurent Pinchart
2024-09-14 11:53 ` 回复: " Changhuang Liang
2024-09-15 9:47 ` Laurent Pinchart
2024-09-18 1:56 ` 回复: " Changhuang Liang
2024-07-09 8:38 ` [PATCH v5 02/14] media: Documentation: Add description for StarFive ISP metadata formats Changhuang Liang
2024-07-10 9:22 ` Jacopo Mondi
2024-07-16 12:31 ` 回复: " Changhuang Liang
2024-07-16 14:25 ` Jacopo Mondi
2024-07-17 2:37 ` 回复: " Changhuang Liang
2024-07-17 7:11 ` Jacopo Mondi
2024-07-09 8:38 ` [PATCH v5 03/14] media: videodev2.h, v4l2-ioctl: Add StarFive ISP meta buffer format Changhuang Liang
2024-07-22 14:35 ` Laurent Pinchart
2024-07-09 8:38 ` [PATCH v5 04/14] staging: media: starfive: Add a params sink pad and a scd source pad for ISP Changhuang Liang
2024-07-10 9:51 ` Jacopo Mondi
2024-07-10 13:04 ` 回复: " Changhuang Liang
2024-07-22 14:51 ` Laurent Pinchart
2024-07-09 8:38 ` [PATCH v5 05/14] staging: media: starfive: Separate buffer from ISP hardware operation Changhuang Liang
2024-07-09 8:38 ` [PATCH v5 06/14] staging: media: starfive: Separate buffer be a common file Changhuang Liang
2024-07-09 8:38 ` [PATCH v5 07/14] staging: media: starfive: Separate ISP hardware from capture device Changhuang Liang
2024-07-09 8:38 ` [PATCH v5 08/14] staging: media: starfive: Add for StarFive ISP 3A SC Changhuang Liang
2024-07-10 11:57 ` Jacopo Mondi
2024-07-11 6:48 ` 回复: " Changhuang Liang
2024-07-11 8:26 ` Jacopo Mondi
2024-07-12 8:36 ` 回复: " Changhuang Liang
2024-07-12 11:37 ` Jacopo Mondi
2024-07-12 13:00 ` 回复: " Changhuang Liang
2024-07-12 13:27 ` Jacopo Mondi
2024-07-12 13:37 ` 回复: " Changhuang Liang
2024-07-12 16:25 ` Jacopo Mondi
2024-07-12 16:33 ` Jacopo Mondi
2024-07-15 1:52 ` 回复: " Changhuang Liang
2024-07-09 8:38 ` [PATCH v5 09/14] staging: media: starfive: Update ISP initialise config for 3A Changhuang Liang
2024-07-22 14:53 ` Laurent Pinchart
2024-07-09 8:38 ` [PATCH v5 10/14] staging: media: starfive: Add V4L2_CAP_IO_MC capability Changhuang Liang
2024-07-10 12:18 ` Jacopo Mondi
2024-07-10 13:10 ` 回复: " Changhuang Liang
2024-07-09 8:38 ` [PATCH v5 11/14] staging: media: starfive: Add ISP params video device Changhuang Liang
2024-07-10 13:07 ` Jacopo Mondi
2024-07-15 7:12 ` Hans Verkuil
2024-07-09 8:38 ` [PATCH v5 12/14] staging: media: starfive: Add ISP parameters hardware configure Changhuang Liang
2024-07-10 13:17 ` Jacopo Mondi
2024-07-12 13:14 ` 回复: " Changhuang Liang
2024-07-09 8:38 ` [PATCH v5 13/14] staging: media: starfive: Drop read support for video capture devices Changhuang Liang
2024-07-22 14:54 ` Laurent Pinchart
2024-07-09 8:38 ` [PATCH v5 14/14] admin-guide: media: Update documents for StarFive Camera Subsystem Changhuang Liang
2024-07-22 14:56 ` Laurent Pinchart
2024-07-24 1:40 ` 回复: " Changhuang Liang
2024-07-10 13:22 ` [PATCH v5 00/14] Add ISP 3A for StarFive Jacopo Mondi
2024-07-11 1:42 ` 回复: " Changhuang Liang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240709083824.430473-1-changhuang.liang@starfivetech.com \
--to=changhuang.liang@starfivetech.com \
--cc=benjamin.gaignard@collabora.com \
--cc=gregkh@linuxfoundation.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=jack.zhu@starfivetech.com \
--cc=jeanmichel.hautbois@ideasonboard.com \
--cc=keith.zhao@starfivetech.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=mingjia.zhang@mediatek.com \
--cc=sakari.ailus@linux.intel.com \
--cc=tomi.valkeinen+renesas@ideasonboard.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox