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;
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
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-F... base: linus/master patch link: https://lore.kernel.org/r/20251209160621.6854-5-johannes.goede%40oss.qualcom... 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@i...) 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@i...)
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
linux-stable-mirror@lists.linaro.org