Skip to contentSkip to conversation

media: rockchip: rkcif: ENUM_FMT and bytesperline fixes

PATCH Superseded Faizel K B 3 participants 10 messages Nov 5 – Nov 16

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Faizel K B

author
#0 lore raw

cover media: rockchip: rkcif: ENUM_FMT and bytesperline fixes

This series fixes two issues in the rkcif MIPI capture path, found while using the libcamera simple pipeline handler with a Sony IMX415 on a Radxa ROCK 5B+ (RK3588).

Patch 1 makes VIDIOC_ENUM_FMT honour the mbus_code field, as required for V4L2_CAP_IO_MC devices. Without it, userspace can select a pixel format that doesn't match the media bus format, e.g. a different Bayer order, and the captured images have wrong colours.

Patch 2 aligns bytesperline to 8 bytes, as required by the MIPI DMA, and honours a larger value requested by userspace. This allows the capture buffers to be imported as DMA-BUFs by the libcamera GPU software ISP on Panfrost, which needs a 64-byte stride alignment, instead of copying every frame.

Tested on ROCK 5B+ with IMX415 (SGBRG10, 3864x2192): correct colours without any userspace workaround, and a stride of 7936 bytes accepted and used for zero-copy import. The corresponding libcamera change is under review at:
https://patchwork.libcamera.org/patch/28662/

Faizel K B (2):
media: rockchip: rkcif: Filter enumerated formats by media bus code
media: rockchip: rkcif: Honour the requested bytesperline on MIPI

 .../platform/rockchip/rkcif/rkcif-stream.c    | 37 ++++++++++++++++---
 1 file changed, 32 insertions(+), 5 deletions(-)

base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4

Signature · 1 line
2.43.0
author
#1 lore raw

PATCH 1/2 media: rockchip: rkcif: Filter enumerated formats by media bus code

VIDIOC_ENUM_FMT ignores the mbus_code field and returns all formats, although the video devices set V4L2_CAP_IO_MC. Return only the formats that match the requested media bus code.

Otherwise userspace can pick a pixel format that doesn't match the media bus format, and then interprets the captured data in the wrong format.

---
 .../media/platform/rockchip/rkcif/rkcif-stream.c  | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +11 -4
index 3130d420ad55..f2a24832a8cf 100644
@@ -395,13 +395,20 @@ static int rkcif_stream_enum_formats(struct file *file, void *priv,
 				     struct v4l2_fmtdesc *f)
 {
 	struct rkcif_stream *stream = video_drvdata(file);
+	unsigned int i, n = 0;
 
-	if (f->index >= stream->out_fmts_num)
-		return -EINVAL;
+	for (i = 0; i < stream->out_fmts_num; i++) {
+		if (f->mbus_code &&
+		    stream->out_fmts[i].mbus_code != f->mbus_code)
+			continue;
 
-	f->pixelformat = stream->out_fmts[f->index].fourcc;
+		if (n++ == f->index) {
+			f->pixelformat = stream->out_fmts[i].fourcc;
+			return 0;
+		}
+	}
 
-	return 0;
+	return -EINVAL;
 }
 
 static int rkcif_stream_enum_framesizes(struct file *file, void *fh,
Signature · 1 line
2.43.0
maintainer
#2 lore raw

Re: [PATCH 1/2] media: rockchip: rkcif: Filter enumerated formats by media bus code

Hello,

Quoted 18 lines · Faizel K B

VIDIOC_ENUM_FMT ignores the mbus_code field and returns all formats, although the video devices set V4L2_CAP_IO_MC. Return only the formats that match the requested media bus code.

Otherwise userspace can pick a pixel format that doesn't match the media bus format, and then interprets the captured data in the wrong format.

---
 .../media/platform/rockchip/rkcif/rkcif-stream.c  | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +0 -0
index 3130d420ad55..f2a24832a8cf 100644

drivers/media/platform/rockchip/rkcif/rkcif-stream.c static int rkcif_stream_enum_formats(struct file *file, void *priv, · line 402

Quoted 10 lines
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +4 -2
@@ -395,13 +395,20 @@ static int rkcif_stream_enum_formats(struct file *file, void *priv,
 				     struct v4l2_fmtdesc *f)
 {
 	struct rkcif_stream *stream = video_drvdata(file);
+	unsigned int i, n = 0;
 
-	if (f->index >= stream->out_fmts_num)
-		return -EINVAL;
+	for (i = 0; i < stream->out_fmts_num; i++) {
+		if (f->mbus_code &&
+		    stream->out_fmts[i].mbus_code != f->mbus_code)

what about dvp capture. The dvp_out_fmts[] does not have the mbus_code set.

drivers/media/platform/rockchip/rkcif/rkcif-stream.c static int rkcif_stream_enum_formats(struct file *file, void *priv, · line 403

Quoted 1 line
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +1 -0
+			continue;

--
Kind Regards
Mehdi Djait

author
#3 lore raw

Re: [PATCH 1/2] media: rockchip: rkcif: Filter enumerated formats by media bus code

Hi Mehdi,

Quoted 8 lines · Mehdi Djait
Quoted 8 lines
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +1 -0
@@ -395,13 +395,20 @@ static int rkcif_stream_enum_formats(struct file *file, void *priv,
 				     struct v4l2_fmtdesc *f)
 {
 	struct rkcif_stream *stream = video_drvdata(file);
+	unsigned int i, n = 0;
 
Quoted 9 lines

drivers/media/platform/rockchip/rkcif/rkcif-stream.c static int rkcif_stream_enum_formats(struct file *file, void *priv, · line 402

Quoted 5 lines
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +3 -2
-	if (f->index >= stream->out_fmts_num)
-		return -EINVAL;
+	for (i = 0; i < stream->out_fmts_num; i++) {
+		if (f->mbus_code &&
+		    stream->out_fmts[i].mbus_code != f->mbus_code)

what about dvp capture. The dvp_out_fmts[] does not have the mbus_code set.

Thanks for the review. Yes, the DVP case is missing. How about only filtering the formats that have a media bus code, so DVP behaves as
before (see the change).

       const struct rkcif_output_fmt *fmt = &stream->out_fmts[i];

       if (f->mbus_code && fmt->mbus_code &&
           fmt->mbus_code != f->mbus_code)
               continue;

I don't have DVP hardware to test with. I can submit a v2 if that's ok.

Regards,
Faizel

maintainer
#4 lore raw

Re: [PATCH 1/2] media: rockchip: rkcif: Filter enumerated formats by media bus code

Hi there,

Quoted 23 lines · Faizel K B

Hi Mehdi,

Quoted 9 lines · Mehdi Djait
Quoted 9 lines
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +1 -0
@@ -395,13 +395,20 @@ static int rkcif_stream_enum_formats(struct
 file *file, void *priv,
                       struct v4l2_fmtdesc *f)
  {
      struct rkcif_stream *stream = video_drvdata(file);
+    unsigned int i, n = 0;
 
Quoted 9 lines

drivers/media/platform/rockchip/rkcif/rkcif-stream.c static int rkcif_stream_enum_formats(struct file *file, void *priv, · line 402

Quoted 5 lines
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +3 -2
-    if (f->index >= stream->out_fmts_num)
-        return -EINVAL;
+    for (i = 0; i < stream->out_fmts_num; i++) {
+        if (f->mbus_code &&
+            stream->out_fmts[i].mbus_code != f->mbus_code)

what about dvp capture. The dvp_out_fmts[] does not have the mbus_code set.

Quoted 3 lines

Thanks for the review. Yes, the DVP case is missing. How about only filtering the formats that have a media bus code, so DVP behaves as before (see the change).

This sounds reasonable.

Quoted 8 lines

       const struct rkcif_output_fmt *fmt = &stream->out_fmts[i];

       if (f->mbus_code && fmt->mbus_code &&
           fmt->mbus_code != f->mbus_code)
               continue;

I don't have DVP hardware to test with. I can submit a v2 if that's ok.

Looking forward to the v2.

Best regards,
Michael

Quoted 5 lines

Regards,
Faizel

author
#5 lore raw

PATCH 2/2 media: rockchip: rkcif: Honour the requested bytesperline on MIPI

In reply to Faizel K B

The MIPI DMA uses bytesperline as the line stride, which must be a multiple of 8 bytes, but v4l2_fill_pixfmt_mp() doesn't align it. Any larger bytesperline requested by userspace is also replaced with the minimum.

Align bytesperline to 8 bytes and honour a larger requested value, up to the limit of the line width register. This allows DMA-BUF importers that need a larger stride alignment to use the buffers directly.

---
 .../platform/rockchip/rkcif/rkcif-stream.c    | 22 ++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +21 -1
index f2a24832a8cf..e50f20e40f7a 100644
@@ -23,6 +23,7 @@
 #define CIF_MIN_HEIGHT	 64
 #define CIF_MAX_WIDTH	 8192
 #define CIF_MAX_HEIGHT	 8192
+#define CIF_MAX_BYTESPERLINE 0xffff8 /* VLW: 20 bits, 8-byte aligned */
 
 static inline struct rkcif_buffer *to_rkcif_buffer(struct vb2_v4l2_buffer *vb)
 {
@@ -334,20 +335,39 @@ static const struct vb2_ops rkcif_stream_vb2_ops = {
 	.stop_streaming = rkcif_stream_stop_streaming,
 };
 
+static void rkcif_stream_set_bytesperline(struct v4l2_pix_format_mplane *pix,
+					  u32 req_bpl)
+{
+	u32 min_bpl = ALIGN(pix->plane_fmt[0].bytesperline, 8);
+	u32 max_bpl = min_t(u32, CIF_MAX_BYTESPERLINE,
+			    ALIGN_DOWN(U32_MAX / pix->height, 8));
+	u32 bpl = min_bpl;
+
+	if (req_bpl > min_bpl && req_bpl <= max_bpl)
+		bpl = ALIGN(req_bpl, 8);
+
+	pix->plane_fmt[0].bytesperline = bpl;
+	pix->plane_fmt[0].sizeimage = bpl * pix->height;
+}
+
 static int rkcif_stream_fill_format(struct rkcif_stream *stream,
 				    struct v4l2_pix_format_mplane *pix)
 {
 	const struct rkcif_output_fmt *fmt;
-	u32 height, width;
+	u32 height, width, req_bpl;
 	int ret;
 
 	fmt = rkcif_stream_find_output_fmt(stream, true, pix->pixelformat);
 	height = clamp_t(u32, pix->height, CIF_MIN_HEIGHT, CIF_MAX_HEIGHT);
 	width = clamp_t(u32, pix->width, CIF_MIN_WIDTH, CIF_MAX_WIDTH);
+	req_bpl = pix->plane_fmt[0].bytesperline;
 	ret = v4l2_fill_pixfmt_mp(pix, fmt->fourcc, width, height);
 	if (ret)
 		return ret;
 
+	if (stream->interface->type == RKCIF_IF_MIPI)
+		rkcif_stream_set_bytesperline(pix, req_bpl);
+
 	pix->field = V4L2_FIELD_NONE;
 
 	return 0;
Signature · 1 line
2.43.0
maintainer
#6 lore raw

Re: [PATCH 2/2] media: rockchip: rkcif: Honour the requested bytesperline on MIPI

Hi there,

Thanks for the patch!

Quoted 2 lines · Faizel K B

The MIPI DMA uses bytesperline as the line stride, which must be a multiple of 8 bytes, but v4l2_fill_pixfmt_mp() doesn't align it.

Come to think of it, TRM p. 2111 says for e.g. VICAP_MIPI0_VLW_ID0:
"Virtual line width of even frame for ID0 path(must be aligned to double word)." which I would interpret as "it must be a multiple of four bytes". What do you think?

Quoted 25 lines

Any larger bytesperline requested by userspace is also replaced with the minimum.

Align bytesperline to 8 bytes and honour a larger requested value, up to the limit of the line width register. This allows DMA-BUF importers that need a larger stride alignment to use the buffers directly.

---
 .../platform/rockchip/rkcif/rkcif-stream.c    | 22 ++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +1 -0
index f2a24832a8cf..e50f20e40f7a 100644
@@ -23,6 +23,7 @@
 #define CIF_MIN_HEIGHT	 64
 #define CIF_MAX_WIDTH	 8192
 #define CIF_MAX_HEIGHT	 8192
+#define CIF_MAX_BYTESPERLINE 0xffff8 /* VLW: 20 bits, 8-byte aligned */
 
 static inline struct rkcif_buffer *to_rkcif_buffer(struct vb2_v4l2_buffer *vb)
 {

drivers/media/platform/rockchip/rkcif/rkcif-stream.c static const struct vb2_ops rkcif_stream_vb2_ops = { · line 341

Quoted 7 lines
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +4 -0
@@ -334,20 +335,39 @@ static const struct vb2_ops rkcif_stream_vb2_ops = {
 	.stop_streaming = rkcif_stream_stop_streaming,
 };
 
+static void rkcif_stream_set_bytesperline(struct v4l2_pix_format_mplane *pix,
+					  u32 req_bpl)
+{
+	u32 min_bpl = ALIGN(pix->plane_fmt[0].bytesperline, 8);

Please add support for the bytesperline field in all the plane_fmt entries here...

Quoted 13 lines
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +11 -0
+	u32 max_bpl = min_t(u32, CIF_MAX_BYTESPERLINE,
+			    ALIGN_DOWN(U32_MAX / pix->height, 8));
+	u32 bpl = min_bpl;
+
+	if (req_bpl > min_bpl && req_bpl <= max_bpl)
+		bpl = ALIGN(req_bpl, 8);
+
+	pix->plane_fmt[0].bytesperline = bpl;
+	pix->plane_fmt[0].sizeimage = bpl * pix->height;
+}
+
 static int rkcif_stream_fill_format(struct rkcif_stream *stream,
 				    struct v4l2_pix_format_mplane *pix)

drivers/media/platform/rockchip/rkcif/rkcif-stream.c static const struct vb2_ops rkcif_stream_vb2_ops = { · line 363

Quoted 10 lines
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +2 -1
 {
 	const struct rkcif_output_fmt *fmt;
-	u32 height, width;
+	u32 height, width, req_bpl;
 	int ret;
 
 	fmt = rkcif_stream_find_output_fmt(stream, true, pix->pixelformat);
 	height = clamp_t(u32, pix->height, CIF_MIN_HEIGHT, CIF_MAX_HEIGHT);
 	width = clamp_t(u32, pix->width, CIF_MIN_WIDTH, CIF_MAX_WIDTH);
+	req_bpl = pix->plane_fmt[0].bytesperline;

... and here.

drivers/media/platform/rockchip/rkcif/rkcif-stream.c static const struct vb2_ops rkcif_stream_vb2_ops = { · line 369

Quoted 6 lines
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +2 -0
 	ret = v4l2_fill_pixfmt_mp(pix, fmt->fourcc, width, height);
 	if (ret)
 		return ret;
 
+	if (stream->interface->type == RKCIF_IF_MIPI)
+		rkcif_stream_set_bytesperline(pix, req_bpl);

Why is this restricted to the MIPI interfaces?

Best regards,
Michael

Quoted 4 lines
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +1 -0
+
 	pix->field = V4L2_FIELD_NONE;
 
 	return 0;
author
#7 lore raw

Re: [PATCH 2/2] media: rockchip: rkcif: Honour the requested bytesperline on MIPI

Hi Michael,

Quoted 6 lines · Michael Riesch

Come to think of it, TRM p. 2111 says for e.g. VICAP_MIPI0_VLW_ID0:
"Virtual line width of even frame for ID0 path(must be aligned to double word)." which I would interpret as "it must be a multiple of four bytes". What do you think?

The VICAP register summary defines it.TRM part 1 (V1.0, page 2081) "DW - Double WORD (64 bits) access". So 8 bytes.

Quoted 13 lines

drivers/media/platform/rockchip/rkcif/rkcif-stream.c static const struct vb2_ops rkcif_stream_vb2_ops = { · line 341

Quoted 4 lines
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +4 -0
+static void rkcif_stream_set_bytesperline(struct v4l2_pix_format_mplane *pix,
+					  u32 req_bpl)
+{
+	u32 min_bpl = ALIGN(pix->plane_fmt[0].bytesperline, 8);

Please add support for the bytesperline field in all the plane_fmt entries here...

drivers/media/platform/rockchip/rkcif/rkcif-stream.c static const struct vb2_ops rkcif_stream_vb2_ops = { · line 363

Quoted 2 lines
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +1 -0
 	width = clamp_t(u32, pix->width, CIF_MIN_WIDTH, CIF_MAX_WIDTH);
+	req_bpl = pix->plane_fmt[0].bytesperline;

... and here.

Quoted 9 lines

drivers/media/platform/rockchip/rkcif/rkcif-stream.c static const struct vb2_ops rkcif_stream_vb2_ops = { · line 369

Quoted 6 lines
drivers/media/platform/rockchip/rkcif/rkcif-stream.c +2 -0
 	ret = v4l2_fill_pixfmt_mp(pix, fmt->fourcc, width, height);
 	if (ret)
 		return ret;
 
+	if (stream->interface->type == RKCIF_IF_MIPI)
+		rkcif_stream_set_bytesperline(pix, req_bpl);

Why is this restricted to the MIPI interfaces?

The MIPI formats all have a single plane, and the MIPI path already programs the line width from bytesperline. The DVP path uses the width, and I can't test it. But I agree it should not depend on the interface.

For v2 I would:

- take the requested bytesperline of all planes into account, and use the largest for all planes, as the DVP has one line width register for Y and UV
- compute the sizeimage of each plane from it
- limit it to the line width field (20 bits MIPI, 15 bits DVP)
- program RKCIF_DVP_VIR_LINE_WIDTH from bytesperline, with the current value as the minimum

Does that sound ok?

A question on the DVP: the PX30 TRM (Part 2, 5.3) says raw data is stored as 16 bits per pixel, even from an 8-bit source. This matches the width * 2 in the driver. But for V4L2_PIX_FMT_S*8 (e.g. V4L2_PIX_FMT_SRGGB8) bytesperline is the width, so the buffer is half the size the hardware writes. Am I missing something?

I can only test the MIPI path, on RK3588 (Radxa ROCK 5B+). Could you test the DVP part on PX30 or RK3568?

Regards,
Faizel

maintainer
#8 lore raw

Re: [PATCH 2/2] media: rockchip: rkcif: Honour the requested bytesperline on MIPI

Hi Faizel,

Quoted 4 lines · Faizel K B

Hi Michael,

Quoted 1 line · Michael Riesch
Quoted 8 lines
Quoted 5 lines

Come to think of it, TRM p. 2111 says for e.g. VICAP_MIPI0_VLW_ID0:
"Virtual line width of even frame for ID0 path(must be aligned to double word)." which I would interpret as "it must be a multiple of four bytes". What do you think?

The VICAP register summary defines it.TRM part 1 (V1.0, page 2081) "DW - Double WORD (64 bits) access". So 8 bytes.

Ack.

Quoted 38 lines
Quoted 14 lines
Quoted 5 lines

+static void rkcif_stream_set_bytesperline(struct v4l2_pix_format_mplane *pix,
+                      u32 req_bpl)
+{
+    u32 min_bpl = ALIGN(pix->plane_fmt[0].bytesperline, 8);

Please add support for the bytesperline field in all the plane_fmt entries here...

Quoted 2 lines

     width = clamp_t(u32, pix->width, CIF_MIN_WIDTH, CIF_MAX_WIDTH); +    req_bpl = pix->plane_fmt[0].bytesperline;

... and here.

Quoted 9 lines
Quoted 6 lines

     ret = v4l2_fill_pixfmt_mp(pix, fmt->fourcc, width, height); if (ret)
         return ret;

+    if (stream->interface->type == RKCIF_IF_MIPI) +        rkcif_stream_set_bytesperline(pix, req_bpl);

Why is this restricted to the MIPI interfaces?

The MIPI formats all have a single plane, and the MIPI path already programs the line width from bytesperline. The DVP path uses the width, and I can't test it. But I agree it should not depend on the interface.

For v2 I would:

- take the requested bytesperline of all planes into account, and use the largest for all planes, as the DVP has one line width register for Y and UV
- compute the sizeimage of each plane from it
- limit it to the line width field (20 bits MIPI, 15 bits DVP)
- program RKCIF_DVP_VIR_LINE_WIDTH from bytesperline, with the current value as the minimum

Quoted 1 line

Does that sound ok?

That does sound reasonable, yes.

Quoted 5 lines

A question on the DVP: the PX30 TRM (Part 2, 5.3) says raw data is stored as 16 bits per pixel, even from an 8-bit source. This matches the width * 2 in the driver. But for V4L2_PIX_FMT_S*8 (e.g. V4L2_PIX_FMT_SRGGB8) bytesperline is the width, so the buffer is half the size the hardware writes. Am I missing something?

I don't have any PX30 board, and actually it is the first time I hear about that. Maybe Mehdi can chime in?

Quoted 2 lines

I can only test the MIPI path, on RK3588 (Radxa ROCK 5B+). Could you test the DVP part on PX30 or RK3568?

Currently, I don't have any active DVP setup, but when you send the updated patches I'll ask around.

Thanks and best regards,
Michael

Quoted 3 lines

Regards,
Faizel

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

maintainer
#9 lore raw

Re: [PATCH 2/2] media: rockchip: rkcif: Honour the requested bytesperline on MIPI

Hello,

Quoted 60 lines · Michael Riesch

Hi Faizel,

Quoted 4 lines · Faizel K B

Hi Michael,

Quoted 1 line · Michael Riesch
Quoted 8 lines
Quoted 5 lines

Come to think of it, TRM p. 2111 says for e.g. VICAP_MIPI0_VLW_ID0:
"Virtual line width of even frame for ID0 path(must be aligned to double word)." which I would interpret as "it must be a multiple of four bytes". What do you think?

The VICAP register summary defines it.TRM part 1 (V1.0, page 2081) "DW - Double WORD (64 bits) access". So 8 bytes.

Ack.

Quoted 38 lines
Quoted 14 lines
Quoted 5 lines

+static void rkcif_stream_set_bytesperline(struct v4l2_pix_format_mplane *pix,
+                      u32 req_bpl)
+{
+    u32 min_bpl = ALIGN(pix->plane_fmt[0].bytesperline, 8);

Please add support for the bytesperline field in all the plane_fmt entries here...

Quoted 2 lines

     width = clamp_t(u32, pix->width, CIF_MIN_WIDTH, CIF_MAX_WIDTH); +    req_bpl = pix->plane_fmt[0].bytesperline;

... and here.

Quoted 9 lines
Quoted 6 lines

     ret = v4l2_fill_pixfmt_mp(pix, fmt->fourcc, width, height); if (ret)
         return ret;

+    if (stream->interface->type == RKCIF_IF_MIPI) +        rkcif_stream_set_bytesperline(pix, req_bpl);

Why is this restricted to the MIPI interfaces?

The MIPI formats all have a single plane, and the MIPI path already programs the line width from bytesperline. The DVP path uses the width, and I can't test it. But I agree it should not depend on the interface.

For v2 I would:

- take the requested bytesperline of all planes into account, and use the largest for all planes, as the DVP has one line width register for Y and UV
- compute the sizeimage of each plane from it
- limit it to the line width field (20 bits MIPI, 15 bits DVP)
- program RKCIF_DVP_VIR_LINE_WIDTH from bytesperline, with the current value as the minimum

Quoted 1 line

Does that sound ok?

That does sound reasonable, yes.

Quoted 8 lines
Quoted 5 lines

A question on the DVP: the PX30 TRM (Part 2, 5.3) says raw data is stored as 16 bits per pixel, even from an 8-bit source. This matches the width * 2 in the driver. But for V4L2_PIX_FMT_S*8 (e.g. V4L2_PIX_FMT_SRGGB8) bytesperline is the width, so the buffer is half the size the hardware writes. Am I missing something?

I don't have any PX30 board, and actually it is the first time I hear about that. Maybe Mehdi can chime in?

Unfortunately I also don't have hw with DVP and the one time I did look online, it is really not that easy to find.

The PX30 board I used to delevop the rkcif is a custom hw that I don't have access to anymore.

--
Kind Regards
Mehdi Djait