* [PATCH] media: i2c: ov13858: Set the colorspace in the pad format
@ 2026-10-16 11:33 George Neacsu via B4 Relay
2026-10-16 13:00 ` Sergey Lebedev
0 siblings, 1 reply; 3+ messages in thread
From: George Neacsu via B4 Relay @ 2026-10-16 11:33 UTC (permalink / raw)
To: Sakari Ailus
Cc: Mauro Carvalho Chehab, Sergey Lebedev, linux-media, linux-kernel,
George Neacsu
From: George Neacsu <geocausa@gmail.com>
ov13858_update_pad_format() and the try format set in open() fill in the
size, code and field but leave the colorspace fields at zero, so the
sensor reports V4L2_COLORSPACE_DEFAULT. v4l2-compliance flags that: on
the Intel Surface Pro 11, Active VIDIOC_SUBDEV_S_FMT fails through the
media device. Report a raw colorspace, as imx355 and imx219 do.
Tested on the Snapdragon Surface Pro 11, with this driver built against
the 7.1 kernel the machine runs: the sensor reports Raw / None / 601 /
full range, streams 4224x3136 at 29.9 fps, and v4l2-compliance passes
46 of 46 on the subdev.
Reported-by: Sergey Lebedev <lsa.uz@pm.me>
Closes: https://lore.kernel.org/all/20261016070018.11932-1-lsa.uz@pm.me/
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: George Neacsu <geocausa@gmail.com>
---
Sergey found this while testing the ov13858 device tree series on the
Intel Surface Pro 11. It is independent of that series and applies to
linux-next on its own.
---
drivers/media/i2c/ov13858.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/media/i2c/ov13858.c b/drivers/media/i2c/ov13858.c
index 5a49fa0ec..5be3d0888 100644
--- a/drivers/media/i2c/ov13858.c
+++ b/drivers/media/i2c/ov13858.c
@@ -1168,6 +1168,10 @@ static int ov13858_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
try_fmt->height = ov13858->cur_mode->height;
try_fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
try_fmt->field = V4L2_FIELD_NONE;
+ try_fmt->colorspace = V4L2_COLORSPACE_RAW;
+ try_fmt->ycbcr_enc = V4L2_YCBCR_ENC_601;
+ try_fmt->quantization = V4L2_QUANTIZATION_FULL_RANGE;
+ try_fmt->xfer_func = V4L2_XFER_FUNC_NONE;
/* No crop or compose */
mutex_unlock(&ov13858->mutex);
@@ -1348,6 +1352,10 @@ static void ov13858_update_pad_format(const struct ov13858_mode *mode,
fmt->format.height = mode->height;
fmt->format.code = MEDIA_BUS_FMT_SGRBG10_1X10;
fmt->format.field = V4L2_FIELD_NONE;
+ fmt->format.colorspace = V4L2_COLORSPACE_RAW;
+ fmt->format.ycbcr_enc = V4L2_YCBCR_ENC_601;
+ fmt->format.quantization = V4L2_QUANTIZATION_FULL_RANGE;
+ fmt->format.xfer_func = V4L2_XFER_FUNC_NONE;
}
static int ov13858_do_get_pad_format(struct ov13858 *ov13858,
---
base-commit: b810335a0699d1810683796b0e3ffe8827ddfe6c
change-id: 20261016-ov13858-colorspace-b1204e3ad06d
Best regards,
--
George Neacsu <geocausa@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] media: i2c: ov13858: Set the colorspace in the pad format
2026-10-16 11:33 [PATCH] media: i2c: ov13858: Set the colorspace in the pad format George Neacsu via B4 Relay
@ 2026-10-16 13:00 ` Sergey Lebedev
2026-10-16 14:55 ` George Neacsu
0 siblings, 1 reply; 3+ messages in thread
From: Sergey Lebedev @ 2026-10-16 13:00 UTC (permalink / raw)
To: George Neacsu
Cc: Sakari Ailus, Mauro Carvalho Chehab, linux-media, linux-kernel
Hi George,
Tested on the Intel model, where it failed: media next with my power-on
v3, without and with this patch. Without it, Active VIDIOC_SUBDEV_S_FMT
fails through the media device on fmt.colorspace == ~0U, 53 of 54. With
it the pad reports Raw, 601, full range and no transfer function,
v4l2-compliance passes 46 of 46 on the subdev and 54 of 54 through the
media device, and the sensor streams 4224x3136 at 29.95 fps.
Tested-by: Sergey Lebedev <lsa.uz@pm.me> # Surface Pro 11 (Intel)
Thank you for writing it up.
Sergey
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] media: i2c: ov13858: Set the colorspace in the pad format
2026-10-16 13:00 ` Sergey Lebedev
@ 2026-10-16 14:55 ` George Neacsu
0 siblings, 0 replies; 3+ messages in thread
From: George Neacsu @ 2026-10-16 14:55 UTC (permalink / raw)
To: Sergey Lebedev
Cc: Sakari Ailus, Mauro Carvalho Chehab, linux-media, linux-kernel
Hi Sergey,
On 16/10/2026 14:00, Sergey Lebedev wrote:
> Tested-by: Sergey Lebedev <lsa.uz@pm.me> # Surface Pro 11 (Intel)
Thank you for testing it on the Intel model, both with and without the
patch. It is good to have the failure and the fix confirmed on a second
machine.
Thanks,
George
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-16 14:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-16 11:33 [PATCH] media: i2c: ov13858: Set the colorspace in the pad format George Neacsu via B4 Relay
2026-10-16 13:00 ` Sergey Lebedev
2026-10-16 14:55 ` George Neacsu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®