* [PATCH v1 0/6] media: rkisp1: Add YUV bypass support for rkisp1
@ 2026-02-04 11:25 Isaac Scott
2026-02-04 11:25 ` [PATCH v1 1/6] media: rkisp1-resizer: Add YUV source formats to resizer Isaac Scott
` (5 more replies)
0 siblings, 6 replies; 14+ messages in thread
From: Isaac Scott @ 2026-02-04 11:25 UTC (permalink / raw)
To: linux-media
Cc: dafna, laurent.pinchart, mchehab, heiko, linux-rockchip,
linux-arm-kernel, linux-kernel, Isaac Scott
Hi all,
"Smart" cameras that do all image processing on the camera module itself
may not have the ability to output image data in RAW formats. These
cameras would require the use of the ISI, which is sometimes not
included in the hardware.
In hotplug systems, it is also impossible to switch between the ISP and
ISI at runtime, meaning if a media pipeline was set up between the
sensor and the rkisp1 ISP capture device, it would not be possible to
switch from a sensor supporting RAW formats to one outputting only YUV.
Thankfully, the ISP can be configured to allow the incoming YUV stream
to "bypass" the ISP blocks, allowing these sensors to be used. It
bypasses all ISP blocks and passes through the resizer, with the input
image data being presented at the output of the ISP to be captured.
In bypass mode, stats buffers are not provided by the ISP.
This series adds support for "YUV bypass", allowing sensors which only
output YUV streams to be used through the rkisp1.
Tested on: v6.18
Compile-tested on: media/next
Isaac Scott (6):
media: rkisp1-resizer: Add YUV source formats to resizer
media: rkisp1-isp: Add in_bypass flag for YUV bypass
media: rkisp1-isp: Add target_format
media: rkisp1-isp: Propagate sink -> source format in YUV passthough
media: rkisp1: Give buffers back instead of dropping in bypass mode
media: rkisp1: Treat 8 bus width and 16 bus width formats the same
.../platform/rockchip/rkisp1/rkisp1-capture.c | 5 ++++
.../platform/rockchip/rkisp1/rkisp1-common.h | 1 +
.../platform/rockchip/rkisp1/rkisp1-isp.c | 26 ++++++++++++++-----
.../platform/rockchip/rkisp1/rkisp1-resizer.c | 15 +++++++++++
4 files changed, 40 insertions(+), 7 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v1 1/6] media: rkisp1-resizer: Add YUV source formats to resizer
2026-02-04 11:25 [PATCH v1 0/6] media: rkisp1: Add YUV bypass support for rkisp1 Isaac Scott
@ 2026-02-04 11:25 ` Isaac Scott
2026-02-04 16:43 ` Laurent Pinchart
2026-02-04 11:25 ` [PATCH v1 2/6] media: rkisp1-isp: Add in_bypass flag for YUV bypass Isaac Scott
` (4 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Isaac Scott @ 2026-02-04 11:25 UTC (permalink / raw)
To: linux-media
Cc: dafna, laurent.pinchart, mchehab, heiko, linux-rockchip,
linux-arm-kernel, linux-kernel, Isaac Scott
To be able to use YUV bypass, YUV formats need to be available on the
source pad of the rkisp1 resizer. Add them.
Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>
---
.../platform/rockchip/rkisp1/rkisp1-resizer.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c
index 8e6b753d3081..e72b76ab078c 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c
@@ -23,11 +23,26 @@ struct rkisp1_rsz_yuv_mbus_info {
};
static const struct rkisp1_rsz_yuv_mbus_info rkisp1_rsz_yuv_src_formats[] = {
+ {
+ .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8, /* YUV422 */
+ .hdiv = 1,
+ .vdiv = 1,
+ },
+ {
+ .mbus_code = MEDIA_BUS_FMT_VYUY8_2X8, /* YUV422 */
+ .hdiv = 1,
+ .vdiv = 1,
+ },
{
.mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, /* YUV422 */
.hdiv = 2,
.vdiv = 1,
},
+ {
+ .mbus_code = MEDIA_BUS_FMT_YVYU8_2X8, /* YUV422 */
+ .hdiv = 1,
+ .vdiv = 1,
+ },
{
.mbus_code = MEDIA_BUS_FMT_YUYV8_1_5X8, /* YUV420 */
.hdiv = 2,
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v1 2/6] media: rkisp1-isp: Add in_bypass flag for YUV bypass
2026-02-04 11:25 [PATCH v1 0/6] media: rkisp1: Add YUV bypass support for rkisp1 Isaac Scott
2026-02-04 11:25 ` [PATCH v1 1/6] media: rkisp1-resizer: Add YUV source formats to resizer Isaac Scott
@ 2026-02-04 11:25 ` Isaac Scott
2026-02-04 17:04 ` Laurent Pinchart
2026-02-04 11:25 ` [PATCH v1 3/6] media: rkisp1-isp: Add target_format Isaac Scott
` (3 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Isaac Scott @ 2026-02-04 11:25 UTC (permalink / raw)
To: linux-media
Cc: dafna, laurent.pinchart, mchehab, heiko, linux-rockchip,
linux-arm-kernel, linux-kernel, Isaac Scott
The rkisp1 features a 'bypass' mode for RAW and YUV formats. This
disables all ISP blocks, and makes the rkisp1 display input data from
the mipi csi receiver at the output, unmodified.
To determine whether we can activate bypass, we can detect whether both
the source and sink formats are YUV. If they are, we can set a new
in_bypass flag.
For YUV bypass, we should configure the ISP input to interpret incoming
H/VSYNC signals as data enable / disable. Add this.
Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>
---
drivers/media/platform/rockchip/rkisp1/rkisp1-common.h | 1 +
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
index 5e6a4d5f6fd1..d90233e31ad3 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
@@ -532,6 +532,7 @@ struct rkisp1_device {
struct rkisp1_debug debug;
const struct rkisp1_info *info;
int irqs[RKISP1_NUM_IRQS];
+ bool in_bypass;
bool irqs_enabled;
};
diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
index 2311672cedb1..f636d738b7e8 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
@@ -212,6 +212,8 @@ static int rkisp1_config_isp(struct rkisp1_isp *isp,
const struct v4l2_mbus_framefmt *sink_frm;
const struct v4l2_rect *sink_crop;
+ rkisp1->in_bypass = false;
+
sink_frm = v4l2_subdev_state_get_format(sd_state,
RKISP1_ISP_PAD_SINK_VIDEO);
sink_crop = v4l2_subdev_state_get_crop(sd_state,
@@ -240,7 +242,10 @@ static int rkisp1_config_isp(struct rkisp1_isp *isp,
}
} else if (sink_fmt->pixel_enc == V4L2_PIXEL_ENC_YUV) {
acq_mult = 2;
- if (mbus_type == V4L2_MBUS_CSI2_DPHY) {
+ if (src_fmt->pixel_enc == V4L2_PIXEL_ENC_YUV) {
+ isp_ctrl = RKISP1_CIF_ISP_CTRL_ISP_MODE_DATA_MODE;
+ rkisp1->in_bypass = true;
+ } else if (mbus_type == V4L2_MBUS_CSI2_DPHY) {
isp_ctrl = RKISP1_CIF_ISP_CTRL_ISP_MODE_ITU601;
} else {
if (mbus_type == V4L2_MBUS_BT656)
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v1 3/6] media: rkisp1-isp: Add target_format
2026-02-04 11:25 [PATCH v1 0/6] media: rkisp1: Add YUV bypass support for rkisp1 Isaac Scott
2026-02-04 11:25 ` [PATCH v1 1/6] media: rkisp1-resizer: Add YUV source formats to resizer Isaac Scott
2026-02-04 11:25 ` [PATCH v1 2/6] media: rkisp1-isp: Add in_bypass flag for YUV bypass Isaac Scott
@ 2026-02-04 11:25 ` Isaac Scott
2026-02-04 11:37 ` Laurent Pinchart
2026-02-04 11:25 ` [PATCH v1 4/6] media: rkisp1-isp: Propagate sink -> source format in YUV passthough Isaac Scott
` (2 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Isaac Scott @ 2026-02-04 11:25 UTC (permalink / raw)
To: linux-media
Cc: dafna, laurent.pinchart, mchehab, heiko, linux-rockchip,
linux-arm-kernel, linux-kernel, Isaac Scott
In passthough mode, we want to make sure the output format of the ISP is
identical to the input format. Add logic to ensure the format we
configure the output of the ISP with is the sink format when we are in
bypass, and the source format if we are not.
Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>
---
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
index f636d738b7e8..716bd7f3c66d 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
@@ -175,9 +175,10 @@ static void rkisp1_gasket_disable(struct rkisp1_device *rkisp1)
static void rkisp1_config_ism(struct rkisp1_isp *isp,
const struct v4l2_subdev_state *sd_state)
{
- const struct v4l2_rect *src_crop =
+ const struct v4l2_rect *target_crop =
v4l2_subdev_state_get_crop(sd_state,
- RKISP1_ISP_PAD_SOURCE_VIDEO);
+ (isp->rkisp1->in_bypass ?
+ RKISP1_ISP_PAD_SINK_VIDEO : RKISP1_ISP_PAD_SOURCE_VIDEO));
struct rkisp1_device *rkisp1 = isp->rkisp1;
u32 val;
@@ -185,10 +186,10 @@ static void rkisp1_config_ism(struct rkisp1_isp *isp,
rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_MAX_DX, 0);
rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_MAX_DY, 0);
rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_DISPLACE, 0);
- rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_H_OFFS, src_crop->left);
- rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_V_OFFS, src_crop->top);
- rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_H_SIZE, src_crop->width);
- rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_V_SIZE, src_crop->height);
+ rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_H_OFFS, target_crop->left);
+ rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_V_OFFS, target_crop->top);
+ rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_H_SIZE, target_crop->width);
+ rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_V_SIZE, target_crop->height);
/* IS(Image Stabilization) is always on, working as output crop */
rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_CTRL, 1);
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v1 4/6] media: rkisp1-isp: Propagate sink -> source format in YUV passthough
2026-02-04 11:25 [PATCH v1 0/6] media: rkisp1: Add YUV bypass support for rkisp1 Isaac Scott
` (2 preceding siblings ...)
2026-02-04 11:25 ` [PATCH v1 3/6] media: rkisp1-isp: Add target_format Isaac Scott
@ 2026-02-04 11:25 ` Isaac Scott
2026-02-04 15:28 ` Laurent Pinchart
2026-02-04 11:25 ` [PATCH v1 5/6] media: rkisp1: Give buffers back instead of dropping in bypass mode Isaac Scott
2026-02-04 11:25 ` [PATCH v1 6/6] media: rkisp1: Treat 8 bus width and 16 bus width formats the same Isaac Scott
5 siblings, 1 reply; 14+ messages in thread
From: Isaac Scott @ 2026-02-04 11:25 UTC (permalink / raw)
To: linux-media
Cc: dafna, laurent.pinchart, mchehab, heiko, linux-rockchip,
linux-arm-kernel, linux-kernel, Isaac Scott
If we are in bypass mode, we should propagate the sink format of the ISP
to the source format to ensure the pipeline is valid. Ensure the source
pad format of the ISP is configured to the same format as the sink pad.
Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>
---
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
index 716bd7f3c66d..c457593526c5 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
@@ -630,6 +630,11 @@ static void rkisp1_isp_set_src_fmt(struct rkisp1_isp *isp,
*/
sink_info = rkisp1_mbus_info_get_by_code(sink_fmt->code);
+ if (sink_info->pixel_enc == V4L2_PIXEL_ENC_YUV) {
+ format->code = sink_fmt->code;
+ dev_dbg(isp->rkisp1->dev, "ISP sink pad is YUV");
+ }
+
src_fmt->code = format->code;
src_info = rkisp1_mbus_info_get_by_code(src_fmt->code);
if (!src_info || !(src_info->direction & RKISP1_ISP_SD_SRC)) {
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v1 5/6] media: rkisp1: Give buffers back instead of dropping in bypass mode
2026-02-04 11:25 [PATCH v1 0/6] media: rkisp1: Add YUV bypass support for rkisp1 Isaac Scott
` (3 preceding siblings ...)
2026-02-04 11:25 ` [PATCH v1 4/6] media: rkisp1-isp: Propagate sink -> source format in YUV passthough Isaac Scott
@ 2026-02-04 11:25 ` Isaac Scott
2026-02-04 15:40 ` Laurent Pinchart
2026-02-04 11:25 ` [PATCH v1 6/6] media: rkisp1: Treat 8 bus width and 16 bus width formats the same Isaac Scott
5 siblings, 1 reply; 14+ messages in thread
From: Isaac Scott @ 2026-02-04 11:25 UTC (permalink / raw)
To: linux-media
Cc: dafna, laurent.pinchart, mchehab, heiko, linux-rockchip,
linux-arm-kernel, linux-kernel, Isaac Scott
In the data mode used for YUV passthrough, falling VSYNC events are used
to determine when a buffer is complete. This means there is no 'Frame
End' signal.
Previously, all buffers would be dropped when bypass mode was active.
Instead of dropping every frame, we should return the buffer to user
space if it is marked as complete by a falling VSYNC signal.
Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>
---
drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
index 867cdddf9f89..2753be39ab33 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
@@ -832,6 +832,11 @@ irqreturn_t rkisp1_capture_isr(int irq, void *ctx)
for (i = 0; i < dev_count; ++i) {
struct rkisp1_capture *cap = &rkisp1->capture_devs[i];
+ if (rkisp1->in_bypass) {
+ rkisp1_handle_buffer(cap);
+ continue;
+ }
+
if (!(status & RKISP1_CIF_MI_FRAME(cap)))
continue;
if (!cap->is_stopping) {
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v1 6/6] media: rkisp1: Treat 8 bus width and 16 bus width formats the same
2026-02-04 11:25 [PATCH v1 0/6] media: rkisp1: Add YUV bypass support for rkisp1 Isaac Scott
` (4 preceding siblings ...)
2026-02-04 11:25 ` [PATCH v1 5/6] media: rkisp1: Give buffers back instead of dropping in bypass mode Isaac Scott
@ 2026-02-04 11:25 ` Isaac Scott
5 siblings, 0 replies; 14+ messages in thread
From: Isaac Scott @ 2026-02-04 11:25 UTC (permalink / raw)
To: linux-media
Cc: dafna, laurent.pinchart, mchehab, heiko, linux-rockchip,
linux-arm-kernel, linux-kernel, Isaac Scott
As MIPI CSI is a serial interface, we should be able to use a bit depth
of 16 in the same way as 8 bit depth. Add a fallthrough case to ensure
we don't reject 16 bit depth formats.
Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>
---
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
index c457593526c5..722ebcfbddbb 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
@@ -265,6 +265,7 @@ static int rkisp1_config_isp(struct rkisp1_isp *isp,
switch (sink_fmt->bus_width) {
case 8:
+ case 16:
acq_prop |= RKISP1_CIF_ISP_ACQ_PROP_IN_SEL_8B_ZERO;
break;
case 10:
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v1 3/6] media: rkisp1-isp: Add target_format
2026-02-04 11:25 ` [PATCH v1 3/6] media: rkisp1-isp: Add target_format Isaac Scott
@ 2026-02-04 11:37 ` Laurent Pinchart
2026-02-04 13:28 ` Isaac Scott
0 siblings, 1 reply; 14+ messages in thread
From: Laurent Pinchart @ 2026-02-04 11:37 UTC (permalink / raw)
To: Isaac Scott
Cc: linux-media, dafna, mchehab, heiko, linux-rockchip,
linux-arm-kernel, linux-kernel
On Wed, Feb 04, 2026 at 11:25:03AM +0000, Isaac Scott wrote:
> In passthough mode, we want to make sure the output format of the ISP is
> identical to the input format. Add logic to ensure the format we
> configure the output of the ISP with is the sink format when we are in
> bypass, and the source format if we are not.
I don't think that's right. In bypass mode, userspace needs to configure
the same format on the image sink and image source pads of the ISP, and
not set any cropping. The crop rectangle on the source pad should
contain the information you need.
> Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>
> ---
> drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> index f636d738b7e8..716bd7f3c66d 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> @@ -175,9 +175,10 @@ static void rkisp1_gasket_disable(struct rkisp1_device *rkisp1)
> static void rkisp1_config_ism(struct rkisp1_isp *isp,
> const struct v4l2_subdev_state *sd_state)
> {
> - const struct v4l2_rect *src_crop =
> + const struct v4l2_rect *target_crop =
> v4l2_subdev_state_get_crop(sd_state,
> - RKISP1_ISP_PAD_SOURCE_VIDEO);
> + (isp->rkisp1->in_bypass ?
> + RKISP1_ISP_PAD_SINK_VIDEO : RKISP1_ISP_PAD_SOURCE_VIDEO));
> struct rkisp1_device *rkisp1 = isp->rkisp1;
> u32 val;
>
> @@ -185,10 +186,10 @@ static void rkisp1_config_ism(struct rkisp1_isp *isp,
> rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_MAX_DX, 0);
> rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_MAX_DY, 0);
> rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_DISPLACE, 0);
> - rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_H_OFFS, src_crop->left);
> - rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_V_OFFS, src_crop->top);
> - rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_H_SIZE, src_crop->width);
> - rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_V_SIZE, src_crop->height);
> + rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_H_OFFS, target_crop->left);
> + rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_V_OFFS, target_crop->top);
> + rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_H_SIZE, target_crop->width);
> + rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_V_SIZE, target_crop->height);
>
> /* IS(Image Stabilization) is always on, working as output crop */
> rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_CTRL, 1);
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v1 3/6] media: rkisp1-isp: Add target_format
2026-02-04 11:37 ` Laurent Pinchart
@ 2026-02-04 13:28 ` Isaac Scott
0 siblings, 0 replies; 14+ messages in thread
From: Isaac Scott @ 2026-02-04 13:28 UTC (permalink / raw)
To: Laurent Pinchart
Cc: linux-media, dafna, mchehab, heiko, linux-rockchip,
linux-arm-kernel, linux-kernel
Hi Laurent,
Thank you for the review!
Quoting Laurent Pinchart (2026-02-04 11:37:10)
> On Wed, Feb 04, 2026 at 11:25:03AM +0000, Isaac Scott wrote:
> > In passthough mode, we want to make sure the output format of the ISP is
> > identical to the input format. Add logic to ensure the format we
> > configure the output of the ISP with is the sink format when we are in
> > bypass, and the source format if we are not.
>
> I don't think that's right. In bypass mode, userspace needs to configure
> the same format on the image sink and image source pads of the ISP, and
> not set any cropping. The crop rectangle on the source pad should
> contain the information you need.
>
Yes, that makes sense. I suppose the idea here was to "enforce" it, but
perhaps we shouldn't be potentially overwriting a format userspace is
setting. I'll take another look for v2.
Best wishes,
Isaac
> > Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>
> > ---
> > drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 13 +++++++------
> > 1 file changed, 7 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> > index f636d738b7e8..716bd7f3c66d 100644
> > --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> > +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> > @@ -175,9 +175,10 @@ static void rkisp1_gasket_disable(struct rkisp1_device *rkisp1)
> > static void rkisp1_config_ism(struct rkisp1_isp *isp,
> > const struct v4l2_subdev_state *sd_state)
> > {
> > - const struct v4l2_rect *src_crop =
> > + const struct v4l2_rect *target_crop =
> > v4l2_subdev_state_get_crop(sd_state,
> > - RKISP1_ISP_PAD_SOURCE_VIDEO);
> > + (isp->rkisp1->in_bypass ?
> > + RKISP1_ISP_PAD_SINK_VIDEO : RKISP1_ISP_PAD_SOURCE_VIDEO));
> > struct rkisp1_device *rkisp1 = isp->rkisp1;
> > u32 val;
> >
> > @@ -185,10 +186,10 @@ static void rkisp1_config_ism(struct rkisp1_isp *isp,
> > rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_MAX_DX, 0);
> > rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_MAX_DY, 0);
> > rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_DISPLACE, 0);
> > - rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_H_OFFS, src_crop->left);
> > - rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_V_OFFS, src_crop->top);
> > - rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_H_SIZE, src_crop->width);
> > - rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_V_SIZE, src_crop->height);
> > + rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_H_OFFS, target_crop->left);
> > + rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_V_OFFS, target_crop->top);
> > + rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_H_SIZE, target_crop->width);
> > + rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_V_SIZE, target_crop->height);
> >
> > /* IS(Image Stabilization) is always on, working as output crop */
> > rkisp1_write(rkisp1, RKISP1_CIF_ISP_IS_CTRL, 1);
>
> --
> Regards,
>
> Laurent Pinchart
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v1 4/6] media: rkisp1-isp: Propagate sink -> source format in YUV passthough
2026-02-04 11:25 ` [PATCH v1 4/6] media: rkisp1-isp: Propagate sink -> source format in YUV passthough Isaac Scott
@ 2026-02-04 15:28 ` Laurent Pinchart
0 siblings, 0 replies; 14+ messages in thread
From: Laurent Pinchart @ 2026-02-04 15:28 UTC (permalink / raw)
To: Isaac Scott
Cc: linux-media, dafna, mchehab, heiko, linux-rockchip,
linux-arm-kernel, linux-kernel
On Wed, Feb 04, 2026 at 11:25:04AM +0000, Isaac Scott wrote:
> If we are in bypass mode, we should propagate the sink format of the ISP
> to the source format to ensure the pipeline is valid. Ensure the source
> pad format of the ISP is configured to the same format as the sink pad.
>
> Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>
> ---
> drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> index 716bd7f3c66d..c457593526c5 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> @@ -630,6 +630,11 @@ static void rkisp1_isp_set_src_fmt(struct rkisp1_isp *isp,
> */
> sink_info = rkisp1_mbus_info_get_by_code(sink_fmt->code);
>
A comment would be useful here, or maybe better a rework of the comment
block just above.
> + if (sink_info->pixel_enc == V4L2_PIXEL_ENC_YUV) {
> + format->code = sink_fmt->code;
> + dev_dbg(isp->rkisp1->dev, "ISP sink pad is YUV");
Drop the debug message.
> + }
> +
> src_fmt->code = format->code;
> src_info = rkisp1_mbus_info_get_by_code(src_fmt->code);
> if (!src_info || !(src_info->direction & RKISP1_ISP_SD_SRC)) {
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v1 5/6] media: rkisp1: Give buffers back instead of dropping in bypass mode
2026-02-04 11:25 ` [PATCH v1 5/6] media: rkisp1: Give buffers back instead of dropping in bypass mode Isaac Scott
@ 2026-02-04 15:40 ` Laurent Pinchart
2026-02-04 16:36 ` Isaac Scott
0 siblings, 1 reply; 14+ messages in thread
From: Laurent Pinchart @ 2026-02-04 15:40 UTC (permalink / raw)
To: Isaac Scott
Cc: linux-media, dafna, mchehab, heiko, linux-rockchip,
linux-arm-kernel, linux-kernel
On Wed, Feb 04, 2026 at 11:25:05AM +0000, Isaac Scott wrote:
> In the data mode used for YUV passthrough, falling VSYNC events are used
> to determine when a buffer is complete. This means there is no 'Frame
> End' signal.
>
> Previously, all buffers would be dropped when bypass mode was active.
> Instead of dropping every frame, we should return the buffer to user
> space if it is marked as complete by a falling VSYNC signal.
>
> Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>
> ---
> drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> index 867cdddf9f89..2753be39ab33 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> @@ -832,6 +832,11 @@ irqreturn_t rkisp1_capture_isr(int irq, void *ctx)
> for (i = 0; i < dev_count; ++i) {
> struct rkisp1_capture *cap = &rkisp1->capture_devs[i];
>
> + if (rkisp1->in_bypass) {
> + rkisp1_handle_buffer(cap);
> + continue;
> + }
> +
You're completing the buffer if *any* interrupt bit is set, this doesn't
seem right. At the moment we may not enable interrupts other than the
one you expect, but that may change later, and this will misbehave.
You're also not handling the stopping logic, which also seems wrong.
Finally, what interrupt bit do you expect to see ? There's no VSYNC
interrupt in the RKISP1_CIF_MI_MIS register. Are you relying on the fact
that your platform has a single interrupt line for the three interrupt
sources (CSI2, ISP and MI), and react to the VSYNC interrupt from the
ISP interrupt here ? That's not right either, not only will it not work
on platforms that have three separate interrupt lines, but it will also
cause rkisp1_handle_buffer() to be called for *any* ISP interrupt.
I'm surprised that the frame end interrupt doesn't fire. It's part of
the MI, not the ISP, so it shouldn't be affected by bypass mode. You
should investigate that.
> if (!(status & RKISP1_CIF_MI_FRAME(cap)))
> continue;
> if (!cap->is_stopping) {
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v1 5/6] media: rkisp1: Give buffers back instead of dropping in bypass mode
2026-02-04 15:40 ` Laurent Pinchart
@ 2026-02-04 16:36 ` Isaac Scott
0 siblings, 0 replies; 14+ messages in thread
From: Isaac Scott @ 2026-02-04 16:36 UTC (permalink / raw)
To: Laurent Pinchart
Cc: linux-media, dafna, mchehab, heiko, linux-rockchip,
linux-arm-kernel, linux-kernel
Hi Laurent,
Quoting Laurent Pinchart (2026-02-04 15:40:04)
> On Wed, Feb 04, 2026 at 11:25:05AM +0000, Isaac Scott wrote:
> > In the data mode used for YUV passthrough, falling VSYNC events are used
> > to determine when a buffer is complete. This means there is no 'Frame
> > End' signal.
> >
> > Previously, all buffers would be dropped when bypass mode was active.
> > Instead of dropping every frame, we should return the buffer to user
> > space if it is marked as complete by a falling VSYNC signal.
> >
> > Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>
> > ---
> > drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> > index 867cdddf9f89..2753be39ab33 100644
> > --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> > +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> > @@ -832,6 +832,11 @@ irqreturn_t rkisp1_capture_isr(int irq, void *ctx)
> > for (i = 0; i < dev_count; ++i) {
> > struct rkisp1_capture *cap = &rkisp1->capture_devs[i];
> >
> > + if (rkisp1->in_bypass) {
> > + rkisp1_handle_buffer(cap);
> > + continue;
> > + }
> > +
>
> You're completing the buffer if *any* interrupt bit is set, this doesn't
> seem right. At the moment we may not enable interrupts other than the
> one you expect, but that may change later, and this will misbehave.
> You're also not handling the stopping logic, which also seems wrong.
>
> Finally, what interrupt bit do you expect to see ? There's no VSYNC
> interrupt in the RKISP1_CIF_MI_MIS register. Are you relying on the fact
> that your platform has a single interrupt line for the three interrupt
> sources (CSI2, ISP and MI), and react to the VSYNC interrupt from the
> ISP interrupt here ? That's not right either, not only will it not work
> on platforms that have three separate interrupt lines, but it will also
> cause rkisp1_handle_buffer() to be called for *any* ISP interrupt.
>
> I'm surprised that the frame end interrupt doesn't fire. It's part of
> the MI, not the ISP, so it shouldn't be affected by bypass mode. You
> should investigate that.
You're right, I think I should get a frame end interrupt. I think what
has happened is during development part I was getting no frame end
interrupts, so I made this change, but it actually turned out to be an
inform_size_err if I recall correctly.
Although it may also be incorrect, I have checked whether I actually do
not get a frame end interrupt by dropping this patch, and it seems I do.
(I must have had my FPGA configured to output the wrong width / height
at the time).
I'll drop this in v2 as it doesn't seem necessary.
Thanks very much,
Isaac
>
> > if (!(status & RKISP1_CIF_MI_FRAME(cap)))
> > continue;
> > if (!cap->is_stopping) {
>
> --
> Regards,
>
> Laurent Pinchart
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v1 1/6] media: rkisp1-resizer: Add YUV source formats to resizer
2026-02-04 11:25 ` [PATCH v1 1/6] media: rkisp1-resizer: Add YUV source formats to resizer Isaac Scott
@ 2026-02-04 16:43 ` Laurent Pinchart
0 siblings, 0 replies; 14+ messages in thread
From: Laurent Pinchart @ 2026-02-04 16:43 UTC (permalink / raw)
To: Isaac Scott
Cc: linux-media, dafna, mchehab, heiko, linux-rockchip,
linux-arm-kernel, linux-kernel
On Wed, Feb 04, 2026 at 11:25:01AM +0000, Isaac Scott wrote:
> To be able to use YUV bypass, YUV formats need to be available on the
> source pad of the rkisp1 resizer. Add them.
>
> Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>
> ---
> .../platform/rockchip/rkisp1/rkisp1-resizer.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c
> index 8e6b753d3081..e72b76ab078c 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c
> @@ -23,11 +23,26 @@ struct rkisp1_rsz_yuv_mbus_info {
> };
>
> static const struct rkisp1_rsz_yuv_mbus_info rkisp1_rsz_yuv_src_formats[] = {
> + {
> + .mbus_code = MEDIA_BUS_FMT_UYVY8_2X8, /* YUV422 */
> + .hdiv = 1,
> + .vdiv = 1,
> + },
> + {
> + .mbus_code = MEDIA_BUS_FMT_VYUY8_2X8, /* YUV422 */
> + .hdiv = 1,
> + .vdiv = 1,
> + },
> {
> .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, /* YUV422 */
> .hdiv = 2,
> .vdiv = 1,
> },
> + {
> + .mbus_code = MEDIA_BUS_FMT_YVYU8_2X8, /* YUV422 */
> + .hdiv = 1,
Shouldn't hdiv be 2 for all those new formats ?
But overall, I don't think those formats are needed. I would be very
surprised if the resizer used different YUV orders on its output bus.
Can't you use MEDIA_BUS_FMT_YUYV8_2X8 unconditionally ?
> + .vdiv = 1,
> + },
> {
> .mbus_code = MEDIA_BUS_FMT_YUYV8_1_5X8, /* YUV420 */
> .hdiv = 2,
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v1 2/6] media: rkisp1-isp: Add in_bypass flag for YUV bypass
2026-02-04 11:25 ` [PATCH v1 2/6] media: rkisp1-isp: Add in_bypass flag for YUV bypass Isaac Scott
@ 2026-02-04 17:04 ` Laurent Pinchart
0 siblings, 0 replies; 14+ messages in thread
From: Laurent Pinchart @ 2026-02-04 17:04 UTC (permalink / raw)
To: Isaac Scott
Cc: linux-media, dafna, mchehab, heiko, linux-rockchip,
linux-arm-kernel, linux-kernel
Hi Isaac,
Thank you for the patch.
On Wed, Feb 04, 2026 at 11:25:02AM +0000, Isaac Scott wrote:
> The rkisp1 features a 'bypass' mode for RAW and YUV formats. This
> disables all ISP blocks, and makes the rkisp1 display input data from
> the mipi csi receiver at the output, unmodified.
>
> To determine whether we can activate bypass, we can detect whether both
> the source and sink formats are YUV. If they are, we can set a new
> in_bypass flag.
>
> For YUV bypass, we should configure the ISP input to interpret incoming
> H/VSYNC signals as data enable / disable. Add this.
>
> Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>
> ---
> drivers/media/platform/rockchip/rkisp1/rkisp1-common.h | 1 +
> drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 7 ++++++-
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
> index 5e6a4d5f6fd1..d90233e31ad3 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
> @@ -532,6 +532,7 @@ struct rkisp1_device {
> struct rkisp1_debug debug;
> const struct rkisp1_info *info;
> int irqs[RKISP1_NUM_IRQS];
> + bool in_bypass;
> bool irqs_enabled;
> };
>
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> index 2311672cedb1..f636d738b7e8 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> @@ -212,6 +212,8 @@ static int rkisp1_config_isp(struct rkisp1_isp *isp,
> const struct v4l2_mbus_framefmt *sink_frm;
> const struct v4l2_rect *sink_crop;
>
> + rkisp1->in_bypass = false;
> +
> sink_frm = v4l2_subdev_state_get_format(sd_state,
> RKISP1_ISP_PAD_SINK_VIDEO);
> sink_crop = v4l2_subdev_state_get_crop(sd_state,
> @@ -240,7 +242,10 @@ static int rkisp1_config_isp(struct rkisp1_isp *isp,
> }
> } else if (sink_fmt->pixel_enc == V4L2_PIXEL_ENC_YUV) {
> acq_mult = 2;
> - if (mbus_type == V4L2_MBUS_CSI2_DPHY) {
> + if (src_fmt->pixel_enc == V4L2_PIXEL_ENC_YUV) {
> + isp_ctrl = RKISP1_CIF_ISP_CTRL_ISP_MODE_DATA_MODE;
> + rkisp1->in_bypass = true;
Based on the review of patches 3/6 and 5/6 I think this flag will
become unused, so you can probably drop this patch too.
> + } else if (mbus_type == V4L2_MBUS_CSI2_DPHY) {
> isp_ctrl = RKISP1_CIF_ISP_CTRL_ISP_MODE_ITU601;
> } else {
> if (mbus_type == V4L2_MBUS_BT656)
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2026-02-04 17:04 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-04 11:25 [PATCH v1 0/6] media: rkisp1: Add YUV bypass support for rkisp1 Isaac Scott
2026-02-04 11:25 ` [PATCH v1 1/6] media: rkisp1-resizer: Add YUV source formats to resizer Isaac Scott
2026-02-04 16:43 ` Laurent Pinchart
2026-02-04 11:25 ` [PATCH v1 2/6] media: rkisp1-isp: Add in_bypass flag for YUV bypass Isaac Scott
2026-02-04 17:04 ` Laurent Pinchart
2026-02-04 11:25 ` [PATCH v1 3/6] media: rkisp1-isp: Add target_format Isaac Scott
2026-02-04 11:37 ` Laurent Pinchart
2026-02-04 13:28 ` Isaac Scott
2026-02-04 11:25 ` [PATCH v1 4/6] media: rkisp1-isp: Propagate sink -> source format in YUV passthough Isaac Scott
2026-02-04 15:28 ` Laurent Pinchart
2026-02-04 11:25 ` [PATCH v1 5/6] media: rkisp1: Give buffers back instead of dropping in bypass mode Isaac Scott
2026-02-04 15:40 ` Laurent Pinchart
2026-02-04 16:36 ` Isaac Scott
2026-02-04 11:25 ` [PATCH v1 6/6] media: rkisp1: Treat 8 bus width and 16 bus width formats the same Isaac Scott
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox