Re: [PATCH v2] media: i2c: vd55g1: fix VD55G0 streaming below 900 Mbps
From: Benjamin Mugnier
Date: Fri Oct 16 2026 - 07:05:38 EST
Hi George,
Le 16/10/2026 à 12:28, George Neacsu via B4 Relay a écrit :
> From: George Neacsu <geocausa@xxxxxxxxx>
>
> 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.
>
> 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, so use 1200
> for the VD55G0 below 900 Mbps.
Yes, the downstream driver was designed to work with specific parameters.
>
> With this change 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@xxxxxxxxx>
> ---
> 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@xxxxxxxxxxxxxxxx/
> (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 also uses a 1200-pixel line below 900 Mbps, so
> this is a data point for that driver too. I can test Sergey's driver on
> the Snapdragon Surface Pro 11 when it is posted.
We reworked the clock tree with Sergey so it may fix your issue too.
Please test it once it hits the mailing list and we will make required
adjustments.
>
> 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.
> ---
> Changes in v2:
> - Drop the ISL_ENABLE (0x0329) change. Sergey found that writing it
> does not stop the output on the Intel model, and a retest here agrees:
> with the 1200-pixel line the sensor streams whether 0x0329 is written
> at stream start, once per power-on, or not at all.
> - Link to v1: https://lore.kernel.org/r/20261016-vd55g0-sp11-fix-v1-1-eb14bd80d8f8@xxxxxxxxx
> ---
> drivers/media/i2c/vd55g1.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/media/i2c/vd55g1.c b/drivers/media/i2c/vd55g1.c
> index ba70447..4e23e88 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)
>
> @@ -1245,6 +1247,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 +1327,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 +1548,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;
>
> ---
> 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,
--
Regards,
Benjamin