* [PATCH 1/5] media: ov02c10: Fix bayer-pattern change after default vflip change
2025-12-09 16:06 ` [PATCH regression fixes for 6.19 0/5] media: ov02c10: h/vflip fixes Hans de Goede
@ 2025-12-09 16:06 ` Hans de Goede
2025-12-09 17:16 ` Hans de Goede
2025-12-10 0:20 ` Bryan O'Donoghue
2025-12-09 16:06 ` [PATCH 2/5] media: ov02c10: Adjust x-win/y-win when changing flipping to preserve bayer-pattern Hans de Goede
` (4 subsequent siblings)
5 siblings, 2 replies; 15+ messages in thread
From: Hans de Goede @ 2025-12-09 16:06 UTC (permalink / raw)
To: Sakari Ailus, Bryan O'Donoghue
Cc: Hans de Goede, Heimir Thor Sverrisson, linux-media,
Sebastian Reichel
After commit 69fe27173396 ("media: ov02c10: Fix default vertical flip")
the reported bayer-pattern of MEDIA_BUS_FMT_SGRBG10_1X10 is no longer
correct.
Change the 16-bit x-win register (0x3810) value from 2 to 1 so that
the sensor will generate data in GRBG bayer-order again.
Fixes: 69fe27173396 ("media: ov02c10: Fix default vertical flip")
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
---
drivers/media/i2c/ov02c10.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ov02c10.c b/drivers/media/i2c/ov02c10.c
index b1e540eb8326..6369841de88b 100644
--- a/drivers/media/i2c/ov02c10.c
+++ b/drivers/media/i2c/ov02c10.c
@@ -168,7 +168,7 @@ static const struct reg_sequence sensor_1928x1092_30fps_setting[] = {
{0x3810, 0x00},
{0x3811, 0x02},
{0x3812, 0x00},
- {0x3813, 0x02},
+ {0x3813, 0x01},
{0x3814, 0x01},
{0x3815, 0x01},
{0x3816, 0x01},
--
2.52.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH 1/5] media: ov02c10: Fix bayer-pattern change after default vflip change
2025-12-09 16:06 ` [PATCH 1/5] media: ov02c10: Fix bayer-pattern change after default vflip change Hans de Goede
@ 2025-12-09 17:16 ` Hans de Goede
2025-12-10 0:20 ` Bryan O'Donoghue
1 sibling, 0 replies; 15+ messages in thread
From: Hans de Goede @ 2025-12-09 17:16 UTC (permalink / raw)
To: Sakari Ailus, Bryan O'Donoghue
Cc: Heimir Thor Sverrisson, linux-media, Sebastian Reichel
Hi,
On 9-Dec-25 5:06 PM, Hans de Goede wrote:
> After commit 69fe27173396 ("media: ov02c10: Fix default vertical flip")
> the reported bayer-pattern of MEDIA_BUS_FMT_SGRBG10_1X10 is no longer
> correct.
>
> Change the 16-bit x-win register (0x3810) value from 2 to 1 so that
> the sensor will generate data in GRBG bayer-order again.
>
> Fixes: 69fe27173396 ("media: ov02c10: Fix default vertical flip")
Correction this should be:
Fixes: d5ebe3f7d13d ("media: ov02c10: Fix default vertical flip")
Let me know if you want a v2 with this fixed.
> Cc: Sebastian Reichel <sre@kernel.org>
> Cc: Bryan O'Donoghue <bod@kernel.org>
> Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
> ---
> drivers/media/i2c/ov02c10.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/ov02c10.c b/drivers/media/i2c/ov02c10.c
> index b1e540eb8326..6369841de88b 100644
> --- a/drivers/media/i2c/ov02c10.c
> +++ b/drivers/media/i2c/ov02c10.c
> @@ -168,7 +168,7 @@ static const struct reg_sequence sensor_1928x1092_30fps_setting[] = {
> {0x3810, 0x00},
> {0x3811, 0x02},
> {0x3812, 0x00},
> - {0x3813, 0x02},
> + {0x3813, 0x01},
> {0x3814, 0x01},
> {0x3815, 0x01},
> {0x3816, 0x01},
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 1/5] media: ov02c10: Fix bayer-pattern change after default vflip change
2025-12-09 16:06 ` [PATCH 1/5] media: ov02c10: Fix bayer-pattern change after default vflip change Hans de Goede
2025-12-09 17:16 ` Hans de Goede
@ 2025-12-10 0:20 ` Bryan O'Donoghue
1 sibling, 0 replies; 15+ messages in thread
From: Bryan O'Donoghue @ 2025-12-10 0:20 UTC (permalink / raw)
To: Hans de Goede, Sakari Ailus
Cc: Heimir Thor Sverrisson, linux-media, Sebastian Reichel
On 09/12/2025 16:06, Hans de Goede wrote:
> After commit 69fe27173396 ("media: ov02c10: Fix default vertical flip")
> the reported bayer-pattern of MEDIA_BUS_FMT_SGRBG10_1X10 is no longer
> correct.
>
> Change the 16-bit x-win register (0x3810) value from 2 to 1 so that
> the sensor will generate data in GRBG bayer-order again.
>
> Fixes: 69fe27173396 ("media: ov02c10: Fix default vertical flip")
> Cc: Sebastian Reichel <sre@kernel.org>
> Cc: Bryan O'Donoghue <bod@kernel.org>
> Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
> ---
> drivers/media/i2c/ov02c10.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/ov02c10.c b/drivers/media/i2c/ov02c10.c
> index b1e540eb8326..6369841de88b 100644
> --- a/drivers/media/i2c/ov02c10.c
> +++ b/drivers/media/i2c/ov02c10.c
> @@ -168,7 +168,7 @@ static const struct reg_sequence sensor_1928x1092_30fps_setting[] = {
> {0x3810, 0x00},
> {0x3811, 0x02},
> {0x3812, 0x00},
> - {0x3813, 0x02},
> + {0x3813, 0x01},
> {0x3814, 0x01},
> {0x3815, 0x01},
> {0x3816, 0x01},
> --
> 2.52.0
>
Reviewed-by: Bryan O'Donoghue <bod@kernel.org>
---
bod
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 2/5] media: ov02c10: Adjust x-win/y-win when changing flipping to preserve bayer-pattern
2025-12-09 16:06 ` [PATCH regression fixes for 6.19 0/5] media: ov02c10: h/vflip fixes Hans de Goede
2025-12-09 16:06 ` [PATCH 1/5] media: ov02c10: Fix bayer-pattern change after default vflip change Hans de Goede
@ 2025-12-09 16:06 ` Hans de Goede
2025-12-10 0:23 ` Bryan O'Donoghue
2025-12-09 16:06 ` [PATCH 3/5] media: ov02c10: Fix the horizontal flip control Hans de Goede
` (3 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Hans de Goede @ 2025-12-09 16:06 UTC (permalink / raw)
To: Sakari Ailus, Bryan O'Donoghue
Cc: Hans de Goede, Heimir Thor Sverrisson, linux-media,
Sebastian Reichel
The ov02c10 is capable of having its (crop) window shifted around with 1
pixel precision while streaming.
This allows changing the x/y window coordinates when changing flipping to
preserve the bayer-pattern.
__v4l2_ctrl_handler_setup() will now write the window coordinates at 0x3810
and 0x3812 so these can be dropped from sensor_1928x1092_30fps_setting.
Since the bayer-pattern is now unchanged, the V4L2_CTRL_FLAG_MODIFY_LAYOUT
flag can be dropped from the flip controls.
Note the original use of the V4L2_CTRL_FLAG_MODIFY_LAYOUT flag was
incomplete, besides setting the flag the driver should also have reported
a different mbus code when getting the source pad's format depending on
the hflip / vflip settings see the ov2680.c driver for example.
Fixes: b7cd2ba3f692 ("media: ov02c10: Support hflip and vflip")
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
---
drivers/media/i2c/ov02c10.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/media/i2c/ov02c10.c b/drivers/media/i2c/ov02c10.c
index 6369841de88b..384c2f0b1608 100644
--- a/drivers/media/i2c/ov02c10.c
+++ b/drivers/media/i2c/ov02c10.c
@@ -165,10 +165,6 @@ static const struct reg_sequence sensor_1928x1092_30fps_setting[] = {
{0x3809, 0x88},
{0x380a, 0x04},
{0x380b, 0x44},
- {0x3810, 0x00},
- {0x3811, 0x02},
- {0x3812, 0x00},
- {0x3813, 0x01},
{0x3814, 0x01},
{0x3815, 0x01},
{0x3816, 0x01},
@@ -465,11 +461,15 @@ static int ov02c10_set_ctrl(struct v4l2_ctrl *ctrl)
break;
case V4L2_CID_HFLIP:
+ cci_write(ov02c10->regmap, OV02C10_ISP_X_WIN_CONTROL,
+ ctrl->val ? 1 : 2, &ret);
cci_update_bits(ov02c10->regmap, OV02C10_ROTATE_CONTROL,
BIT(3), ov02c10->hflip->val << 3, &ret);
break;
case V4L2_CID_VFLIP:
+ cci_write(ov02c10->regmap, OV02C10_ISP_Y_WIN_CONTROL,
+ ctrl->val ? 2 : 1, &ret);
cci_update_bits(ov02c10->regmap, OV02C10_ROTATE_CONTROL,
BIT(4), ov02c10->vflip->val << 4, &ret);
break;
@@ -551,13 +551,9 @@ static int ov02c10_init_controls(struct ov02c10 *ov02c10)
ov02c10->hflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops,
V4L2_CID_HFLIP, 0, 1, 1, 0);
- if (ov02c10->hflip)
- ov02c10->hflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
ov02c10->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops,
V4L2_CID_VFLIP, 0, 1, 1, 0);
- if (ov02c10->vflip)
- ov02c10->vflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
v4l2_ctrl_new_std_menu_items(ctrl_hdlr, &ov02c10_ctrl_ops,
V4L2_CID_TEST_PATTERN,
--
2.52.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH 2/5] media: ov02c10: Adjust x-win/y-win when changing flipping to preserve bayer-pattern
2025-12-09 16:06 ` [PATCH 2/5] media: ov02c10: Adjust x-win/y-win when changing flipping to preserve bayer-pattern Hans de Goede
@ 2025-12-10 0:23 ` Bryan O'Donoghue
0 siblings, 0 replies; 15+ messages in thread
From: Bryan O'Donoghue @ 2025-12-10 0:23 UTC (permalink / raw)
To: Hans de Goede, Sakari Ailus
Cc: Heimir Thor Sverrisson, linux-media, Sebastian Reichel
On 09/12/2025 16:06, Hans de Goede wrote:
> The ov02c10 is capable of having its (crop) window shifted around with 1
> pixel precision while streaming.
>
> This allows changing the x/y window coordinates when changing flipping to
> preserve the bayer-pattern.
>
> __v4l2_ctrl_handler_setup() will now write the window coordinates at 0x3810
> and 0x3812 so these can be dropped from sensor_1928x1092_30fps_setting.
>
> Since the bayer-pattern is now unchanged, the V4L2_CTRL_FLAG_MODIFY_LAYOUT
> flag can be dropped from the flip controls.
>
> Note the original use of the V4L2_CTRL_FLAG_MODIFY_LAYOUT flag was
> incomplete, besides setting the flag the driver should also have reported
> a different mbus code when getting the source pad's format depending on
> the hflip / vflip settings see the ov2680.c driver for example.
>
> Fixes: b7cd2ba3f692 ("media: ov02c10: Support hflip and vflip")
> Cc: Sebastian Reichel <sre@kernel.org>
> Cc: Bryan O'Donoghue <bod@kernel.org>
> Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
> ---
> drivers/media/i2c/ov02c10.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/i2c/ov02c10.c b/drivers/media/i2c/ov02c10.c
> index 6369841de88b..384c2f0b1608 100644
> --- a/drivers/media/i2c/ov02c10.c
> +++ b/drivers/media/i2c/ov02c10.c
> @@ -165,10 +165,6 @@ static const struct reg_sequence sensor_1928x1092_30fps_setting[] = {
> {0x3809, 0x88},
> {0x380a, 0x04},
> {0x380b, 0x44},
> - {0x3810, 0x00},
> - {0x3811, 0x02},
> - {0x3812, 0x00},
> - {0x3813, 0x01},
> {0x3814, 0x01},
> {0x3815, 0x01},
> {0x3816, 0x01},
> @@ -465,11 +461,15 @@ static int ov02c10_set_ctrl(struct v4l2_ctrl *ctrl)
> break;
>
> case V4L2_CID_HFLIP:
> + cci_write(ov02c10->regmap, OV02C10_ISP_X_WIN_CONTROL,
> + ctrl->val ? 1 : 2, &ret);
> cci_update_bits(ov02c10->regmap, OV02C10_ROTATE_CONTROL,
> BIT(3), ov02c10->hflip->val << 3, &ret);
> break;
>
> case V4L2_CID_VFLIP:
> + cci_write(ov02c10->regmap, OV02C10_ISP_Y_WIN_CONTROL,
> + ctrl->val ? 2 : 1, &ret);
> cci_update_bits(ov02c10->regmap, OV02C10_ROTATE_CONTROL,
> BIT(4), ov02c10->vflip->val << 4, &ret);
> break;
> @@ -551,13 +551,9 @@ static int ov02c10_init_controls(struct ov02c10 *ov02c10)
>
> ov02c10->hflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops,
> V4L2_CID_HFLIP, 0, 1, 1, 0);
> - if (ov02c10->hflip)
> - ov02c10->hflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
>
> ov02c10->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops,
> V4L2_CID_VFLIP, 0, 1, 1, 0);
> - if (ov02c10->vflip)
> - ov02c10->vflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
>
> v4l2_ctrl_new_std_menu_items(ctrl_hdlr, &ov02c10_ctrl_ops,
> V4L2_CID_TEST_PATTERN,
> --
> 2.52.0
>
Reviewed-by: Bryan O'Donoghue <bod@kernel.org>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 3/5] media: ov02c10: Fix the horizontal flip control
2025-12-09 16:06 ` [PATCH regression fixes for 6.19 0/5] media: ov02c10: h/vflip fixes Hans de Goede
2025-12-09 16:06 ` [PATCH 1/5] media: ov02c10: Fix bayer-pattern change after default vflip change Hans de Goede
2025-12-09 16:06 ` [PATCH 2/5] media: ov02c10: Adjust x-win/y-win when changing flipping to preserve bayer-pattern Hans de Goede
@ 2025-12-09 16:06 ` Hans de Goede
2025-12-10 0:24 ` Bryan O'Donoghue
2025-12-09 16:06 ` [PATCH 4/5] media: ipu-bridge: Add DMI quirk for Dell XPS laptops with upside down sensors Hans de Goede
` (2 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Hans de Goede @ 2025-12-09 16:06 UTC (permalink / raw)
To: Sakari Ailus, Bryan O'Donoghue
Cc: Hans de Goede, Heimir Thor Sverrisson, linux-media,
Sebastian Reichel
During sensor calibration I noticed that with the hflip control set to
false/disabled the image was mirrored.
The horizontal flip control is inverted and needs to be set to 1 to not
flip. This is something which seems to be common with various recent
Omnivision sensors, the ov01a10 and ov08x40 also have an inverted
mirror control.
Invert the hflip control to fix the sensor mirroring by default.
Fixes: b7cd2ba3f692 ("media: ov02c10: Support hflip and vflip")
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
---
drivers/media/i2c/ov02c10.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/media/i2c/ov02c10.c b/drivers/media/i2c/ov02c10.c
index 384c2f0b1608..f912ae142040 100644
--- a/drivers/media/i2c/ov02c10.c
+++ b/drivers/media/i2c/ov02c10.c
@@ -170,7 +170,7 @@ static const struct reg_sequence sensor_1928x1092_30fps_setting[] = {
{0x3816, 0x01},
{0x3817, 0x01},
- {0x3820, 0xa0},
+ {0x3820, 0xa8},
{0x3821, 0x00},
{0x3822, 0x80},
{0x3823, 0x08},
@@ -462,9 +462,9 @@ static int ov02c10_set_ctrl(struct v4l2_ctrl *ctrl)
case V4L2_CID_HFLIP:
cci_write(ov02c10->regmap, OV02C10_ISP_X_WIN_CONTROL,
- ctrl->val ? 1 : 2, &ret);
+ ctrl->val ? 2 : 1, &ret);
cci_update_bits(ov02c10->regmap, OV02C10_ROTATE_CONTROL,
- BIT(3), ov02c10->hflip->val << 3, &ret);
+ BIT(3), ctrl->val ? 0 : BIT(3), &ret);
break;
case V4L2_CID_VFLIP:
--
2.52.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH 3/5] media: ov02c10: Fix the horizontal flip control
2025-12-09 16:06 ` [PATCH 3/5] media: ov02c10: Fix the horizontal flip control Hans de Goede
@ 2025-12-10 0:24 ` Bryan O'Donoghue
0 siblings, 0 replies; 15+ messages in thread
From: Bryan O'Donoghue @ 2025-12-10 0:24 UTC (permalink / raw)
To: Hans de Goede, Sakari Ailus
Cc: Heimir Thor Sverrisson, linux-media, Sebastian Reichel
On 09/12/2025 16:06, Hans de Goede wrote:
> During sensor calibration I noticed that with the hflip control set to
> false/disabled the image was mirrored.
>
> The horizontal flip control is inverted and needs to be set to 1 to not
> flip. This is something which seems to be common with various recent
> Omnivision sensors, the ov01a10 and ov08x40 also have an inverted
> mirror control.
>
> Invert the hflip control to fix the sensor mirroring by default.
>
> Fixes: b7cd2ba3f692 ("media: ov02c10: Support hflip and vflip")
> Cc: Sebastian Reichel <sre@kernel.org>
> Cc: Bryan O'Donoghue <bod@kernel.org>
> Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
> ---
> drivers/media/i2c/ov02c10.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/i2c/ov02c10.c b/drivers/media/i2c/ov02c10.c
> index 384c2f0b1608..f912ae142040 100644
> --- a/drivers/media/i2c/ov02c10.c
> +++ b/drivers/media/i2c/ov02c10.c
> @@ -170,7 +170,7 @@ static const struct reg_sequence sensor_1928x1092_30fps_setting[] = {
> {0x3816, 0x01},
> {0x3817, 0x01},
>
> - {0x3820, 0xa0},
> + {0x3820, 0xa8},
> {0x3821, 0x00},
> {0x3822, 0x80},
> {0x3823, 0x08},
> @@ -462,9 +462,9 @@ static int ov02c10_set_ctrl(struct v4l2_ctrl *ctrl)
>
> case V4L2_CID_HFLIP:
> cci_write(ov02c10->regmap, OV02C10_ISP_X_WIN_CONTROL,
> - ctrl->val ? 1 : 2, &ret);
> + ctrl->val ? 2 : 1, &ret);
> cci_update_bits(ov02c10->regmap, OV02C10_ROTATE_CONTROL,
> - BIT(3), ov02c10->hflip->val << 3, &ret);
> + BIT(3), ctrl->val ? 0 : BIT(3), &ret);
> break;
>
> case V4L2_CID_VFLIP:
> --
> 2.52.0
>
Reviewed-by: Bryan O'Donoghue <bod@kernel.org>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 4/5] media: ipu-bridge: Add DMI quirk for Dell XPS laptops with upside down sensors
2025-12-09 16:06 ` [PATCH regression fixes for 6.19 0/5] media: ov02c10: h/vflip fixes Hans de Goede
` (2 preceding siblings ...)
2025-12-09 16:06 ` [PATCH 3/5] media: ov02c10: Fix the horizontal flip control Hans de Goede
@ 2025-12-09 16:06 ` Hans de Goede
2025-12-10 0:26 ` Bryan O'Donoghue
2025-12-10 10:32 ` kernel test robot
2025-12-09 16:06 ` [PATCH 5/5] media: ov02c10: Remove unnecessary hflip and vflip pointers Hans de Goede
2025-12-10 0:19 ` [PATCH regression fixes for 6.19 0/5] media: ov02c10: h/vflip fixes Bryan O'Donoghue
5 siblings, 2 replies; 15+ messages in thread
From: Hans de Goede @ 2025-12-09 16:06 UTC (permalink / raw)
To: Sakari Ailus, Bryan O'Donoghue
Cc: Hans de Goede, Heimir Thor Sverrisson, linux-media, stable
The Dell XPS 13 9350 and XPS 16 9640 both have an upside-down mounted
OV02C10 sensor. This rotation of 180° is reported in neither the SSDB nor
the _PLD for the sensor (both report a rotation of 0°).
Add a DMI quirk mechanism for upside-down sensors and add 2 initial entries
to the DMI quirk list for these 2 laptops.
Note the OV02C10 driver was originally developed on a XPS 16 9640 which
resulted in inverted vflip + hflip settings making it look like the sensor
was upright on the XPS 16 9640 and upside down elsewhere this has been
fixed in commit 69fe27173396 ("media: ov02c10: Fix default vertical flip").
This makes this commit a regression fix since now the video is upside down
on these Dell XPS models where it was not before.
Fixes: 69fe27173396 ("media: ov02c10: Fix default vertical flip")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
---
drivers/media/pci/intel/ipu-bridge.c | 29 ++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c
index 58ea01d40c0d..6463b2a47d78 100644
--- a/drivers/media/pci/intel/ipu-bridge.c
+++ b/drivers/media/pci/intel/ipu-bridge.c
@@ -5,6 +5,7 @@
#include <acpi/acpi_bus.h>
#include <linux/cleanup.h>
#include <linux/device.h>
+#include <linux/dmi.h>
#include <linux/i2c.h>
#include <linux/mei_cl_bus.h>
#include <linux/platform_device.h>
@@ -99,6 +100,28 @@ static const struct ipu_sensor_config ipu_supported_sensors[] = {
IPU_SENSOR_CONFIG("XMCC0003", 1, 321468000),
};
+/*
+ * DMI matches for laptops which have their sensor mounted upside-down
+ * without reporting a rotation of 180° in neither the SSDB nor the _PLD.
+ */
+static const struct dmi_system_id upside_down_sensor_dmi_ids[] = {
+ {
+ .matches = {
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 13 9350"),
+ },
+ .driver_data = "OVTI02C1",
+ },
+ {
+ .matches = {
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 16 9640"),
+ },
+ .driver_data = "OVTI02C1",
+ },
+ {} /* Terminating entry */
+};
+
static const struct ipu_property_names prop_names = {
.clock_frequency = "clock-frequency",
.rotation = "rotation",
@@ -249,6 +272,12 @@ static int ipu_bridge_read_acpi_buffer(struct acpi_device *adev, char *id,
static u32 ipu_bridge_parse_rotation(struct acpi_device *adev,
struct ipu_sensor_ssdb *ssdb)
{
+ const struct dmi_system_id *dmi_id;
+
+ dmi_id = dmi_first_match(upside_down_sensor_dmi_ids);
+ if (dmi_id && acpi_dev_hid_match(adev, dmi_id->driver_data))
+ return 180;
+
switch (ssdb->degree) {
case IPU_SENSOR_ROTATION_NORMAL:
return 0;
--
2.52.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH 4/5] media: ipu-bridge: Add DMI quirk for Dell XPS laptops with upside down sensors
2025-12-09 16:06 ` [PATCH 4/5] media: ipu-bridge: Add DMI quirk for Dell XPS laptops with upside down sensors Hans de Goede
@ 2025-12-10 0:26 ` Bryan O'Donoghue
2025-12-10 10:32 ` kernel test robot
1 sibling, 0 replies; 15+ messages in thread
From: Bryan O'Donoghue @ 2025-12-10 0:26 UTC (permalink / raw)
To: Hans de Goede, Sakari Ailus; +Cc: Heimir Thor Sverrisson, linux-media, stable
On 09/12/2025 16:06, Hans de Goede wrote:
> The Dell XPS 13 9350 and XPS 16 9640 both have an upside-down mounted
> OV02C10 sensor. This rotation of 180° is reported in neither the SSDB nor
> the _PLD for the sensor (both report a rotation of 0°).
>
> Add a DMI quirk mechanism for upside-down sensors and add 2 initial entries
> to the DMI quirk list for these 2 laptops.
>
> Note the OV02C10 driver was originally developed on a XPS 16 9640 which
> resulted in inverted vflip + hflip settings making it look like the sensor
> was upright on the XPS 16 9640 and upside down elsewhere this has been
> fixed in commit 69fe27173396 ("media: ov02c10: Fix default vertical flip").
> This makes this commit a regression fix since now the video is upside down
> on these Dell XPS models where it was not before.
Nasty.
>
> Fixes: 69fe27173396 ("media: ov02c10: Fix default vertical flip")
> Cc: stable@vger.kernel.org
> Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
> ---
> drivers/media/pci/intel/ipu-bridge.c | 29 ++++++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
> diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c
> index 58ea01d40c0d..6463b2a47d78 100644
> --- a/drivers/media/pci/intel/ipu-bridge.c
> +++ b/drivers/media/pci/intel/ipu-bridge.c
> @@ -5,6 +5,7 @@
> #include <acpi/acpi_bus.h>
> #include <linux/cleanup.h>
> #include <linux/device.h>
> +#include <linux/dmi.h>
> #include <linux/i2c.h>
> #include <linux/mei_cl_bus.h>
> #include <linux/platform_device.h>
> @@ -99,6 +100,28 @@ static const struct ipu_sensor_config ipu_supported_sensors[] = {
> IPU_SENSOR_CONFIG("XMCC0003", 1, 321468000),
> };
>
> +/*
> + * DMI matches for laptops which have their sensor mounted upside-down
> + * without reporting a rotation of 180° in neither the SSDB nor the _PLD.
> + */
> +static const struct dmi_system_id upside_down_sensor_dmi_ids[] = {
> + {
> + .matches = {
> + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 13 9350"),
> + },
> + .driver_data = "OVTI02C1",
> + },
> + {
> + .matches = {
> + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 16 9640"),
> + },
> + .driver_data = "OVTI02C1",
> + },
> + {} /* Terminating entry */
> +};
> +
> static const struct ipu_property_names prop_names = {
> .clock_frequency = "clock-frequency",
> .rotation = "rotation",
> @@ -249,6 +272,12 @@ static int ipu_bridge_read_acpi_buffer(struct acpi_device *adev, char *id,
> static u32 ipu_bridge_parse_rotation(struct acpi_device *adev,
> struct ipu_sensor_ssdb *ssdb)
> {
> + const struct dmi_system_id *dmi_id;
> +
> + dmi_id = dmi_first_match(upside_down_sensor_dmi_ids);
> + if (dmi_id && acpi_dev_hid_match(adev, dmi_id->driver_data))
> + return 180;
> +
> switch (ssdb->degree) {
> case IPU_SENSOR_ROTATION_NORMAL:
> return 0;
> --
> 2.52.0
>
Reviewed-by: Bryan O'Donoghue <bod@kernel.org>
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 4/5] media: ipu-bridge: Add DMI quirk for Dell XPS laptops with upside down sensors
2025-12-09 16:06 ` [PATCH 4/5] media: ipu-bridge: Add DMI quirk for Dell XPS laptops with upside down sensors Hans de Goede
2025-12-10 0:26 ` Bryan O'Donoghue
@ 2025-12-10 10:32 ` kernel test robot
1 sibling, 0 replies; 15+ messages in thread
From: kernel test robot @ 2025-12-10 10:32 UTC (permalink / raw)
To: Hans de Goede, Sakari Ailus, Bryan O'Donoghue
Cc: llvm, oe-kbuild-all, Hans de Goede, Heimir Thor Sverrisson,
linux-media, stable
Hi Hans,
kernel test robot noticed the following build errors:
[auto build test ERROR on linus/master]
[also build test ERROR on next-20251210]
[cannot apply to v6.18]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Hans-de-Goede/media-ov02c10-Fix-bayer-pattern-change-after-default-vflip-change/20251210-001230
base: linus/master
patch link: https://lore.kernel.org/r/20251209160621.6854-5-johannes.goede%40oss.qualcomm.com
patch subject: [PATCH 4/5] media: ipu-bridge: Add DMI quirk for Dell XPS laptops with upside down sensors
config: sparc64-allmodconfig (https://download.01.org/0day-ci/archive/20251210/202512101804.4fea2mY1-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 6ec8c4351cfc1d0627d1633b02ea787bd29c77d8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251210/202512101804.4fea2mY1-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512101804.4fea2mY1-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/media/pci/intel/ipu-bridge.c:277:16: error: call to undeclared function 'acpi_dev_hid_match'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
277 | if (dmi_id && acpi_dev_hid_match(adev, dmi_id->driver_data))
| ^
1 error generated.
vim +/acpi_dev_hid_match +277 drivers/media/pci/intel/ipu-bridge.c
270
271 static u32 ipu_bridge_parse_rotation(struct acpi_device *adev,
272 struct ipu_sensor_ssdb *ssdb)
273 {
274 const struct dmi_system_id *dmi_id;
275
276 dmi_id = dmi_first_match(upside_down_sensor_dmi_ids);
> 277 if (dmi_id && acpi_dev_hid_match(adev, dmi_id->driver_data))
278 return 180;
279
280 switch (ssdb->degree) {
281 case IPU_SENSOR_ROTATION_NORMAL:
282 return 0;
283 case IPU_SENSOR_ROTATION_INVERTED:
284 return 180;
285 default:
286 dev_warn(ADEV_DEV(adev),
287 "Unknown rotation %d. Assume 0 degree rotation\n",
288 ssdb->degree);
289 return 0;
290 }
291 }
292
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 5/5] media: ov02c10: Remove unnecessary hflip and vflip pointers
2025-12-09 16:06 ` [PATCH regression fixes for 6.19 0/5] media: ov02c10: h/vflip fixes Hans de Goede
` (3 preceding siblings ...)
2025-12-09 16:06 ` [PATCH 4/5] media: ipu-bridge: Add DMI quirk for Dell XPS laptops with upside down sensors Hans de Goede
@ 2025-12-09 16:06 ` Hans de Goede
2025-12-10 0:27 ` Bryan O'Donoghue
2025-12-10 0:19 ` [PATCH regression fixes for 6.19 0/5] media: ov02c10: h/vflip fixes Bryan O'Donoghue
5 siblings, 1 reply; 15+ messages in thread
From: Hans de Goede @ 2025-12-09 16:06 UTC (permalink / raw)
To: Sakari Ailus, Bryan O'Donoghue
Cc: Hans de Goede, Heimir Thor Sverrisson, linux-media,
Sebastian Reichel
The cci_update_bits() inside ov02c10_set_ctrl() can used the passed
in ctrk argument to access the vflip control value.
After changing this there is no need to store a pointer to the hflip
and vflip controls inside struct ov02c10, drop these.
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
---
drivers/media/i2c/ov02c10.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/media/i2c/ov02c10.c b/drivers/media/i2c/ov02c10.c
index f912ae142040..cf93d36032e1 100644
--- a/drivers/media/i2c/ov02c10.c
+++ b/drivers/media/i2c/ov02c10.c
@@ -381,8 +381,6 @@ struct ov02c10 {
struct v4l2_ctrl *vblank;
struct v4l2_ctrl *hblank;
struct v4l2_ctrl *exposure;
- struct v4l2_ctrl *hflip;
- struct v4l2_ctrl *vflip;
struct clk *img_clk;
struct gpio_desc *reset;
@@ -471,7 +469,7 @@ static int ov02c10_set_ctrl(struct v4l2_ctrl *ctrl)
cci_write(ov02c10->regmap, OV02C10_ISP_Y_WIN_CONTROL,
ctrl->val ? 2 : 1, &ret);
cci_update_bits(ov02c10->regmap, OV02C10_ROTATE_CONTROL,
- BIT(4), ov02c10->vflip->val << 4, &ret);
+ BIT(4), ctrl->val << 4, &ret);
break;
default:
@@ -549,11 +547,11 @@ static int ov02c10_init_controls(struct ov02c10 *ov02c10)
OV02C10_EXPOSURE_STEP,
exposure_max);
- ov02c10->hflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops,
- V4L2_CID_HFLIP, 0, 1, 1, 0);
+ v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops, V4L2_CID_HFLIP,
+ 0, 1, 1, 0);
- ov02c10->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops,
- V4L2_CID_VFLIP, 0, 1, 1, 0);
+ v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops, V4L2_CID_VFLIP,
+ 0, 1, 1, 0);
v4l2_ctrl_new_std_menu_items(ctrl_hdlr, &ov02c10_ctrl_ops,
V4L2_CID_TEST_PATTERN,
--
2.52.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH 5/5] media: ov02c10: Remove unnecessary hflip and vflip pointers
2025-12-09 16:06 ` [PATCH 5/5] media: ov02c10: Remove unnecessary hflip and vflip pointers Hans de Goede
@ 2025-12-10 0:27 ` Bryan O'Donoghue
0 siblings, 0 replies; 15+ messages in thread
From: Bryan O'Donoghue @ 2025-12-10 0:27 UTC (permalink / raw)
To: Hans de Goede, Sakari Ailus
Cc: Heimir Thor Sverrisson, linux-media, Sebastian Reichel
On 09/12/2025 16:06, Hans de Goede wrote:
> The cci_update_bits() inside ov02c10_set_ctrl() can used the passed
> in ctrk argument to access the vflip control value.
use the passed <data> in the ctrl argument
>
> After changing this there is no need to store a pointer to the hflip
> and vflip controls inside struct ov02c10, drop these.
>
> Cc: Sebastian Reichel <sre@kernel.org>
> Cc: Bryan O'Donoghue <bod@kernel.org>
> Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
> ---
> drivers/media/i2c/ov02c10.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/media/i2c/ov02c10.c b/drivers/media/i2c/ov02c10.c
> index f912ae142040..cf93d36032e1 100644
> --- a/drivers/media/i2c/ov02c10.c
> +++ b/drivers/media/i2c/ov02c10.c
> @@ -381,8 +381,6 @@ struct ov02c10 {
> struct v4l2_ctrl *vblank;
> struct v4l2_ctrl *hblank;
> struct v4l2_ctrl *exposure;
> - struct v4l2_ctrl *hflip;
> - struct v4l2_ctrl *vflip;
>
> struct clk *img_clk;
> struct gpio_desc *reset;
> @@ -471,7 +469,7 @@ static int ov02c10_set_ctrl(struct v4l2_ctrl *ctrl)
> cci_write(ov02c10->regmap, OV02C10_ISP_Y_WIN_CONTROL,
> ctrl->val ? 2 : 1, &ret);
> cci_update_bits(ov02c10->regmap, OV02C10_ROTATE_CONTROL,
> - BIT(4), ov02c10->vflip->val << 4, &ret);
> + BIT(4), ctrl->val << 4, &ret);
> break;
>
> default:
> @@ -549,11 +547,11 @@ static int ov02c10_init_controls(struct ov02c10 *ov02c10)
> OV02C10_EXPOSURE_STEP,
> exposure_max);
>
> - ov02c10->hflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops,
> - V4L2_CID_HFLIP, 0, 1, 1, 0);
> + v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops, V4L2_CID_HFLIP,
> + 0, 1, 1, 0);
>
> - ov02c10->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops,
> - V4L2_CID_VFLIP, 0, 1, 1, 0);
> + v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops, V4L2_CID_VFLIP,
> + 0, 1, 1, 0);
>
> v4l2_ctrl_new_std_menu_items(ctrl_hdlr, &ov02c10_ctrl_ops,
> V4L2_CID_TEST_PATTERN,
> --
> 2.52.0
>
Reviewed-by: Bryan O'Donoghue <bod@kernel.org>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH regression fixes for 6.19 0/5] media: ov02c10: h/vflip fixes
2025-12-09 16:06 ` [PATCH regression fixes for 6.19 0/5] media: ov02c10: h/vflip fixes Hans de Goede
` (4 preceding siblings ...)
2025-12-09 16:06 ` [PATCH 5/5] media: ov02c10: Remove unnecessary hflip and vflip pointers Hans de Goede
@ 2025-12-10 0:19 ` Bryan O'Donoghue
2025-12-10 8:06 ` Hans de Goede
5 siblings, 1 reply; 15+ messages in thread
From: Bryan O'Donoghue @ 2025-12-10 0:19 UTC (permalink / raw)
To: Hans de Goede, Sakari Ailus; +Cc: Heimir Thor Sverrisson, linux-media
On 09/12/2025 16:06, Hans de Goede wrote:
> Hi All,
>
> Commit 69fe27173396 ("media: ov02c10: Fix default vertical flip") which
> has been merged this merge window is causing various problems for
> laptops with a ov02c10 sensors:
>
> 1. This changes the vflip default but does not update the bayer-order
> leading to debayer artifacts and wrong colors
>
> 2. The ov02c10 driver was originally developed on a XPS 16 9640 which
> has its sensor upside down. Changing the vflip (and hflip) default
> values fixes the image being upside down on other laptops, but will
> cause a regression on Dell XPS models causing the image to be upside
> down there.
>
> 3. The mentioned commit only changes vflip, so the image now is upside-up,
> but it is still mirrored.
>
> Patches 1-4 of this series fixes these issues. Patch 5 is a follow-up
> cleanup patch.
>
> Hans Verkuil, can you please queue these up as fixes for 6.19?
>
> Regards,
>
> Hans
>
>
> Hans de Goede (5):
> media: ov02c10: Fix bayer-pattern change after default vflip change
> media: ov02c10: Adjust x-win/y-win when changing flipping to preserve
> bayer-pattern
> media: ov02c10: Fix the horizontal flip control
> media: ipu-bridge: Add DMI quirk for Dell XPS laptops with upside down
> sensors
> media: ov02c10: Remove unnecessary hflip and vflip pointers
>
> drivers/media/i2c/ov02c10.c | 28 +++++++++++----------------
> drivers/media/pci/intel/ipu-bridge.c | 29 ++++++++++++++++++++++++++++
> 2 files changed, 40 insertions(+), 17 deletions(-)
>
> --
> 2.52.0
>
I thought of this at the time but, assumed it was tested, on submission.
Should have asked.
---
bod
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH regression fixes for 6.19 0/5] media: ov02c10: h/vflip fixes
2025-12-10 0:19 ` [PATCH regression fixes for 6.19 0/5] media: ov02c10: h/vflip fixes Bryan O'Donoghue
@ 2025-12-10 8:06 ` Hans de Goede
0 siblings, 0 replies; 15+ messages in thread
From: Hans de Goede @ 2025-12-10 8:06 UTC (permalink / raw)
To: Bryan O'Donoghue, Sakari Ailus; +Cc: Heimir Thor Sverrisson, linux-media
Hi Bryan,
Thank you for the reviews.
On 10-Dec-25 1:19 AM, Bryan O'Donoghue wrote:
> On 09/12/2025 16:06, Hans de Goede wrote:
>> Hi All,
>>
>> Commit 69fe27173396 ("media: ov02c10: Fix default vertical flip") which
>> has been merged this merge window is causing various problems for
>> laptops with a ov02c10 sensors:
>>
>> 1. This changes the vflip default but does not update the bayer-order
>> leading to debayer artifacts and wrong colors
>>
>> 2. The ov02c10 driver was originally developed on a XPS 16 9640 which
>> has its sensor upside down. Changing the vflip (and hflip) default
>> values fixes the image being upside down on other laptops, but will
>> cause a regression on Dell XPS models causing the image to be upside
>> down there.
>>
>> 3. The mentioned commit only changes vflip, so the image now is upside-up,
>> but it is still mirrored.
>>
>> Patches 1-4 of this series fixes these issues. Patch 5 is a follow-up
>> cleanup patch.
>>
>> Hans Verkuil, can you please queue these up as fixes for 6.19?
>>
>> Regards,
>>
>> Hans
>>
>>
>> Hans de Goede (5):
>> media: ov02c10: Fix bayer-pattern change after default vflip change
>> media: ov02c10: Adjust x-win/y-win when changing flipping to preserve
>> bayer-pattern
>> media: ov02c10: Fix the horizontal flip control
>> media: ipu-bridge: Add DMI quirk for Dell XPS laptops with upside down
>> sensors
>> media: ov02c10: Remove unnecessary hflip and vflip pointers
>>
>> drivers/media/i2c/ov02c10.c | 28 +++++++++++----------------
>> drivers/media/pci/intel/ipu-bridge.c | 29 ++++++++++++++++++++++++++++
>> 2 files changed, 40 insertions(+), 17 deletions(-)
>>
>> --
>> 2.52.0
>>
>
> I thought of this at the time but, assumed it was tested, on submission.
That reminds me I should have put some testing info in the cover-letter.
This series has been tested on a ThinkPad T14s gen 6 (snapdragon)
and a Dell XPS 16 9640, both with a ov02c10 driver.
All flip orientations now work correctly on both laptops and after
the DMI quirks are added libcamera automatically enables hflip + vflip
on the XPS models, fixing the image being upside-down there.
Regards,
Hans
^ permalink raw reply [flat|nested] 15+ messages in thread