* [PATCH] media: i2c: vd55g1: fix VD55G0 streaming below 900 Mbps
@ 2026-10-16 6:37 ` George Neacsu
0 siblings, 0 replies; 4+ messages in thread
From: George Neacsu via B4 Relay @ 2026-10-16 6:37 UTC (permalink / raw)
To: Benjamin Mugnier, Peter Marshall, Sylvain Petinot
Cc: linux-kernel, linux-media, Jizhou Tong, Sakari Ailus,
Mauro Carvalho Chehab, Sergey Lebedev, George Neacsu
From: George Neacsu <geocausa@gmail.com>
On a Surface Pro 11 (Snapdragon X Elite, CAMSS) the VD55G0 IR sensor
(cut 1, revision 0x1111) runs one D-PHY lane at 840 Mbps. With the
VD55G0 support as posted, the sensor accepts the start command and
reports STREAMING, but it never sends a frame and the stop command
never completes.
Two settings cause this:
- The minimum line length is the VD55G1 value, 1128 pixels. ST's
reference vd55g0 driver uses 1200 below 900 Mbps and 1128 above.
At 840 Mbps the sensor stalls with 1128 and streams with 1200.
- Writing 0 to 0x0329, mapped as ISL_ENABLE for the VD55G0, also stops
frame output, even with the longer line. The register reads 0x01
after boot, and the ST reference driver never writes it. Drop it from
the VD55G0 map and only write ISL_ENABLE on models that have it.
With both changes the sensor streams 644x604 Y10 at 61.6 fps, the
diagonal grey-scale test pattern comes out correct, and stop completes.
The built-in 2.11 cut1 patch is used unchanged.
Link: https://github.com/STMicroelectronics/vd55g0-linux-driver/blob/a05627b0f6d8775aa54b6fa306e91f425f2cbf9e/vd55g0.c
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: George Neacsu <geocausa@gmail.com>
---
This is an incremental fix for Peter's unmerged VD55G0 support (v2,
patch 11/11), on top of Jizhou's register-width fix (v2). It does not
apply to media-next on its own.
Prerequisites:
https://lore.kernel.org/all/20260918221705.323510-1-pm@petermarshall.ca/
(and Jizhou Tong's "[PATCH v2] media: i2c: vd55g1: correct VD55G0
register access widths", 12 October)
Benjamin, I know you'd rather see a separate vd55g0 driver (Sergey's).
ST's downstream driver already uses a 1200-pixel line below 900 Mbps
and never writes 0x0329, so this is also a data point for that driver:
these are the two settings this hardware needs. I can test Sergey's
driver on the Snapdragon Surface Pro 11 when it is posted.
Tested on mainline (62f482ff73bf) with Peter's v2 01 and 04-11 plus
Jizhou's fix. 02 and 03 did not apply to that tree, and neither touches
the driver. The receiver is qcom CAMSS (CSIPHY0 -> CSID0 -> VFE0 RDI0)
with out-of-tree Surface Pro 11 board support.
---
drivers/media/i2c/vd55g1.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/media/i2c/vd55g1.c b/drivers/media/i2c/vd55g1.c
index ba70447..4471c5a 100644
--- a/drivers/media/i2c/vd55g1.c
+++ b/drivers/media/i2c/vd55g1.c
@@ -76,6 +76,8 @@
#define VD55G1_XCLK_FREQ_MAX (27 * HZ_PER_MHZ)
#define VD55G0_MIPI_RATE_MIN (750 * MEGA)
#define VD55G0_MIPI_RATE_MAX (1200 * MEGA)
+#define VD55G0_LINE_LENGTH_LOW_RATE 1200
+#define VD55G0_LOW_MIPI_RATE_LIMIT (900 * MEGA)
#define VD55G1_MIPI_RATE_MIN (250 * MEGA)
#define VD55G1_MIPI_RATE_MAX (1200 * MEGA)
@@ -169,7 +171,6 @@ static const int vd55g0_reg_map[REG_MAX_INDEX] = {
[REG_OIF_IMG_CTRL] = CCI_REG8(0x030f),
[REG_MIPI_DATA_RATE] = CCI_REG32_LE(0x0224),
[REG_SYSTEM_FSM] = CCI_REG8(0x002c),
- [REG_ISL_ENABLE] = CCI_REG8(0x0329),
[REG_FWPATCH_REVISION] = CCI_REG16_LE(0x0022),
[REG_PATGEN_CTRL] = CCI_REG16_LE(0x0400),
[REG_READOUT_CTRL] = CCI_REG8(0x047a),
@@ -1245,6 +1246,8 @@ struct vd55g1_model {
u16 num_modes;
u32 mipi_rate_min;
u32 mipi_rate_max;
+ u32 low_mipi_rate_limit;
+ u16 line_length_low_rate;
u16 width;
u16 height;
bool bayer;
@@ -1323,6 +1326,8 @@ static const struct vd55g1_model vd55g0_model = {
.num_modes = ARRAY_SIZE(vd55g0_supported_modes),
.mipi_rate_min = VD55G0_MIPI_RATE_MIN,
.mipi_rate_max = VD55G0_MIPI_RATE_MAX,
+ .low_mipi_rate_limit = VD55G0_LOW_MIPI_RATE_LIMIT,
+ .line_length_low_rate = VD55G0_LINE_LENGTH_LOW_RATE,
.width = VD55G0_WIDTH,
.height = VD55G0_HEIGHT,
.bayer = false,
@@ -1542,6 +1547,8 @@ static unsigned int vd55g1_get_hblank_min(struct vd55g1 *sensor,
/* Absolute time required for ADCs to convert pixels */
min_line_length = VD55G1_LINE_LENGTH_MIN;
+ if (sensor->mipi_rate < sensor->model->low_mipi_rate_limit)
+ min_line_length = sensor->model->line_length_low_rate;
if (sensor->model->hdr &&
sensor->hdr_ctrl->val == VD55G1_HDR_SUB)
min_line_length = VD55G1_LINE_LENGTH_SUB_MIN;
@@ -2117,7 +2124,8 @@ static int vd55g1_enable_streams(struct v4l2_subdev *sd,
/* Configure output */
vd55g1_write(sensor, REG_MIPI_DATA_RATE, sensor->mipi_rate, &ret);
vd55g1_write(sensor, REG_OIF_CTRL, sensor->oif_ctrl, &ret);
- vd55g1_write(sensor, REG_ISL_ENABLE, 0, &ret);
+ if (sensor->model->reg_map[REG_ISL_ENABLE])
+ vd55g1_write(sensor, REG_ISL_ENABLE, 0, &ret);
if (ret)
goto err_rpm_put;
---
base-commit: 62f482ff73bf3ae88b0c899115527752cf9cbf13
change-id: 20261016-vd55g0-sp11-fix-60bc64a59b1d
prerequisite-patch-id: d4474f51d7a10cfd10a316ec2b09936490b14a79
prerequisite-patch-id: 0017cc56bf769ab00e67bdc0c5214951447cb716
prerequisite-patch-id: 95a2d9ff8168eb17010538d80f4b5428e2b7b798
prerequisite-patch-id: e717e32eac916ccafccf9e7a552ca0030085daa3
prerequisite-patch-id: 8fc4f7595aac33a2164adb41c139dc3218be5bc6
prerequisite-patch-id: 52bde56940b545c0e5f44d12811f9b9676bc311c
prerequisite-patch-id: c0b93409e330d4b874b3702d67b57e2c4b0bde32
prerequisite-patch-id: dbc6f65015852bbaf31e5f4efbee52c60bafb79f
prerequisite-patch-id: d5c9bb074014a20938df8b55bb9088aa7b26d37b
prerequisite-patch-id: d1ce44a3f9104aeead2c18d58a1470d1bd1ae531
Best regards,
--
George Neacsu <geocausa@gmail.com>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] media: i2c: vd55g1: fix VD55G0 streaming below 900 Mbps
@ 2026-10-16 6:37 ` George Neacsu
0 siblings, 0 replies; 4+ messages in thread
From: George Neacsu @ 2026-10-16 6:37 UTC (permalink / raw)
To: Benjamin Mugnier, Peter Marshall, Sylvain Petinot
Cc: linux-kernel, linux-media, Jizhou Tong, Sakari Ailus,
Mauro Carvalho Chehab, Sergey Lebedev, George Neacsu
On a Surface Pro 11 (Snapdragon X Elite, CAMSS) the VD55G0 IR sensor
(cut 1, revision 0x1111) runs one D-PHY lane at 840 Mbps. With the
VD55G0 support as posted, the sensor accepts the start command and
reports STREAMING, but it never sends a frame and the stop command
never completes.
Two settings cause this:
- The minimum line length is the VD55G1 value, 1128 pixels. ST's
reference vd55g0 driver uses 1200 below 900 Mbps and 1128 above.
At 840 Mbps the sensor stalls with 1128 and streams with 1200.
- Writing 0 to 0x0329, mapped as ISL_ENABLE for the VD55G0, also stops
frame output, even with the longer line. The register reads 0x01
after boot, and the ST reference driver never writes it. Drop it from
the VD55G0 map and only write ISL_ENABLE on models that have it.
With both changes the sensor streams 644x604 Y10 at 61.6 fps, the
diagonal grey-scale test pattern comes out correct, and stop completes.
The built-in 2.11 cut1 patch is used unchanged.
Link: https://github.com/STMicroelectronics/vd55g0-linux-driver/blob/a05627b0f6d8775aa54b6fa306e91f425f2cbf9e/vd55g0.c
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: George Neacsu <geocausa@gmail.com>
---
This is an incremental fix for Peter's unmerged VD55G0 support (v2,
patch 11/11), on top of Jizhou's register-width fix (v2). It does not
apply to media-next on its own.
Prerequisites:
https://lore.kernel.org/all/20260918221705.323510-1-pm@petermarshall.ca/
(and Jizhou Tong's "[PATCH v2] media: i2c: vd55g1: correct VD55G0
register access widths", 12 October)
Benjamin, I know you'd rather see a separate vd55g0 driver (Sergey's).
ST's downstream driver already uses a 1200-pixel line below 900 Mbps
and never writes 0x0329, so this is also a data point for that driver:
these are the two settings this hardware needs. I can test Sergey's
driver on the Snapdragon Surface Pro 11 when it is posted.
Tested on mainline (62f482ff73bf) with Peter's v2 01 and 04-11 plus
Jizhou's fix. 02 and 03 did not apply to that tree, and neither touches
the driver. The receiver is qcom CAMSS (CSIPHY0 -> CSID0 -> VFE0 RDI0)
with out-of-tree Surface Pro 11 board support.
---
drivers/media/i2c/vd55g1.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/media/i2c/vd55g1.c b/drivers/media/i2c/vd55g1.c
index ba70447..4471c5a 100644
--- a/drivers/media/i2c/vd55g1.c
+++ b/drivers/media/i2c/vd55g1.c
@@ -76,6 +76,8 @@
#define VD55G1_XCLK_FREQ_MAX (27 * HZ_PER_MHZ)
#define VD55G0_MIPI_RATE_MIN (750 * MEGA)
#define VD55G0_MIPI_RATE_MAX (1200 * MEGA)
+#define VD55G0_LINE_LENGTH_LOW_RATE 1200
+#define VD55G0_LOW_MIPI_RATE_LIMIT (900 * MEGA)
#define VD55G1_MIPI_RATE_MIN (250 * MEGA)
#define VD55G1_MIPI_RATE_MAX (1200 * MEGA)
@@ -169,7 +171,6 @@ static const int vd55g0_reg_map[REG_MAX_INDEX] = {
[REG_OIF_IMG_CTRL] = CCI_REG8(0x030f),
[REG_MIPI_DATA_RATE] = CCI_REG32_LE(0x0224),
[REG_SYSTEM_FSM] = CCI_REG8(0x002c),
- [REG_ISL_ENABLE] = CCI_REG8(0x0329),
[REG_FWPATCH_REVISION] = CCI_REG16_LE(0x0022),
[REG_PATGEN_CTRL] = CCI_REG16_LE(0x0400),
[REG_READOUT_CTRL] = CCI_REG8(0x047a),
@@ -1245,6 +1246,8 @@ struct vd55g1_model {
u16 num_modes;
u32 mipi_rate_min;
u32 mipi_rate_max;
+ u32 low_mipi_rate_limit;
+ u16 line_length_low_rate;
u16 width;
u16 height;
bool bayer;
@@ -1323,6 +1326,8 @@ static const struct vd55g1_model vd55g0_model = {
.num_modes = ARRAY_SIZE(vd55g0_supported_modes),
.mipi_rate_min = VD55G0_MIPI_RATE_MIN,
.mipi_rate_max = VD55G0_MIPI_RATE_MAX,
+ .low_mipi_rate_limit = VD55G0_LOW_MIPI_RATE_LIMIT,
+ .line_length_low_rate = VD55G0_LINE_LENGTH_LOW_RATE,
.width = VD55G0_WIDTH,
.height = VD55G0_HEIGHT,
.bayer = false,
@@ -1542,6 +1547,8 @@ static unsigned int vd55g1_get_hblank_min(struct vd55g1 *sensor,
/* Absolute time required for ADCs to convert pixels */
min_line_length = VD55G1_LINE_LENGTH_MIN;
+ if (sensor->mipi_rate < sensor->model->low_mipi_rate_limit)
+ min_line_length = sensor->model->line_length_low_rate;
if (sensor->model->hdr &&
sensor->hdr_ctrl->val == VD55G1_HDR_SUB)
min_line_length = VD55G1_LINE_LENGTH_SUB_MIN;
@@ -2117,7 +2124,8 @@ static int vd55g1_enable_streams(struct v4l2_subdev *sd,
/* Configure output */
vd55g1_write(sensor, REG_MIPI_DATA_RATE, sensor->mipi_rate, &ret);
vd55g1_write(sensor, REG_OIF_CTRL, sensor->oif_ctrl, &ret);
- vd55g1_write(sensor, REG_ISL_ENABLE, 0, &ret);
+ if (sensor->model->reg_map[REG_ISL_ENABLE])
+ vd55g1_write(sensor, REG_ISL_ENABLE, 0, &ret);
if (ret)
goto err_rpm_put;
---
base-commit: 62f482ff73bf3ae88b0c899115527752cf9cbf13
change-id: 20261016-vd55g0-sp11-fix-60bc64a59b1d
prerequisite-patch-id: d4474f51d7a10cfd10a316ec2b09936490b14a79
prerequisite-patch-id: 0017cc56bf769ab00e67bdc0c5214951447cb716
prerequisite-patch-id: 95a2d9ff8168eb17010538d80f4b5428e2b7b798
prerequisite-patch-id: e717e32eac916ccafccf9e7a552ca0030085daa3
prerequisite-patch-id: 8fc4f7595aac33a2164adb41c139dc3218be5bc6
prerequisite-patch-id: 52bde56940b545c0e5f44d12811f9b9676bc311c
prerequisite-patch-id: c0b93409e330d4b874b3702d67b57e2c4b0bde32
prerequisite-patch-id: dbc6f65015852bbaf31e5f4efbee52c60bafb79f
prerequisite-patch-id: d5c9bb074014a20938df8b55bb9088aa7b26d37b
prerequisite-patch-id: d1ce44a3f9104aeead2c18d58a1470d1bd1ae531
Best regards,
--
George Neacsu <geocausa@gmail.com>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] media: i2c: vd55g1: fix VD55G0 streaming below 900 Mbps
2026-10-16 6:37 ` George Neacsu
(?)
@ 2026-10-16 7:02 ` Sergey Lebedev
2026-10-16 10:27 ` George Neacsu
-1 siblings, 1 reply; 4+ messages in thread
From: Sergey Lebedev @ 2026-10-16 7:02 UTC (permalink / raw)
To: George Neacsu
Cc: Benjamin Mugnier, Peter Marshall, Sylvain Petinot, Jizhou Tong,
Sakari Ailus, Mauro Carvalho Chehab, linux-media, linux-kernel
Hi George,
A data point from the Intel model, which has the same sensor: revision
0x1111, firmware patch 2.11, and 0x0329 reads 0x01 after power-on there
too. My vd55g0 driver writes ISL_ENABLE = 0 once per power-on, in
software standby right after boot, together with the clock and output
settings, and with LINE_LENGTH 1200 the sensor then streams Y8 and Y10 in
every mode. So here, writing 0 there does not stop the output by
itself. vd55g1 writes it at every stream start instead, which may be the
difference.
Thank you for offering to test my driver on the Snapdragon model. I will
Cc you when it is posted.
Sergey
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] media: i2c: vd55g1: fix VD55G0 streaming below 900 Mbps
2026-10-16 7:02 ` Sergey Lebedev
@ 2026-10-16 10:27 ` George Neacsu
0 siblings, 0 replies; 4+ messages in thread
From: George Neacsu @ 2026-10-16 10:27 UTC (permalink / raw)
To: Sergey Lebedev
Cc: Benjamin Mugnier, Peter Marshall, Sylvain Petinot, Jizhou Tong,
Sakari Ailus, Mauro Carvalho Chehab, linux-media, linux-kernel
Hi Sergey,
On 16/10/2026 08:02, Sergey Lebedev wrote:
> So here, writing 0 there does not stop the output by itself. vd55g1
> writes it at every stream start instead, which may be the difference.
Thanks, you are right, and it is not the place either. I retested on the
Snapdragon model with the line length change applied and 0x0329 handled
three ways:
ISL_ENABLE = 0 at every stream start (as in Peter's v2) 6/6 captures
ISL_ENABLE = 0 once per power-on, after boot 2/2
never written 2/2
All at 840 Mbps on one lane, 644x604 Y10, with real images in every run,
including a stream-start write on the first capture after loading the
module. 0x0329 reads 0x01 after power-on here too and 0x00 once
written.
The failure I based the ISL change on came from a debug build where the
line length was forced by a register write just before stream start
rather than coming from the driver, so it was not a clean test. I will
send a v2 with only the line length change.
Thanks,
George
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-10-16 10:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-16 6:37 [PATCH] media: i2c: vd55g1: fix VD55G0 streaming below 900 Mbps George Neacsu via B4 Relay
2026-10-16 6:37 ` George Neacsu
2026-10-16 7:02 ` Sergey Lebedev
2026-10-16 10:27 ` George Neacsu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.