From 88877eacc1c26266ba0871df6f10ed4c70aa204b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Mar=C3=ADa=20Mart=C3=ADn?= Date: Mon, 10 Aug 2026 01:35:51 +0200 Subject: [PATCH 1/2] media: ipu-bridge: check all DMI entries when overriding sensor rotation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A machine can have more than one sensor whose rotation needs to be overridden, which takes one upside_down_sensor_dmi_ids[] entry per sensor, all sharing the same DMI match but with different ACPI HIDs in driver_data. ipu_bridge_parse_rotation() uses dmi_first_match(), which always stops at the first entry matching the running machine, so any further entry for the same machine is unreachable and only one sensor per machine can ever be corrected. Walk the whole table and match every entry for the running machine against the sensor's ACPI HID instead. Fixes: b75710155a82 ("media: ipu-bridge: Add DMI quirk for Dell XPS laptops with upside down sensors") Cc: stable@vger.kernel.org Signed-off-by: José María Martín Signed-off-by: Sakari Ailus (cherry picked from commit 4900cad020c0580dfb1be27776ff10a4ef110cfa) --- drivers/media/pci/intel/ipu-bridge.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c index 3418ff4751985..cc88a67a0f443 100644 --- a/drivers/media/pci/intel/ipu-bridge.c +++ b/drivers/media/pci/intel/ipu-bridge.c @@ -291,9 +291,11 @@ static u32 ipu_bridge_parse_rotation(struct acpi_device *adev, { 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; + /* A machine may have one entry per sensor, so check all matches. */ + for (dmi_id = dmi_first_match(upside_down_sensor_dmi_ids); dmi_id; + dmi_id = dmi_first_match(dmi_id + 1)) + if (acpi_dev_hid_match(adev, dmi_id->driver_data)) + return 180; switch (ssdb->degree) { case IPU_SENSOR_ROTATION_NORMAL: From e357c42cd21d38e92ec3afbf043f874900f62420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Mar=C3=ADa=20Mart=C3=ADn?= Date: Mon, 10 Aug 2026 00:12:12 +0200 Subject: [PATCH 2/2] media: ipu-bridge: fix rear camera rotation on Surface Pro 9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SSDB provided by the firmware for the rear OV13858 camera (OVTID858) of the Microsoft Surface Pro 9 reports degree=0, but the module is mounted upside down, so the image comes out rotated 180 degrees. Add a DMI quirk entry for it, next to the existing one for the front OVTI5693 camera of the same machine. Tested on a Surface Pro 9: both cameras now report Rotation = 180 and render upright in libcamera clients, with no regression on the front camera. Signed-off-by: José María Martín --- drivers/media/pci/intel/ipu-bridge.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c index cc88a67a0f443..413d28a95d95d 100644 --- a/drivers/media/pci/intel/ipu-bridge.c +++ b/drivers/media/pci/intel/ipu-bridge.c @@ -136,6 +136,13 @@ static const struct dmi_system_id upside_down_sensor_dmi_ids[] = { }, .driver_data = "OVTI5693", }, + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), + DMI_MATCH(DMI_PRODUCT_NAME, "Surface Pro 9"), + }, + .driver_data = "OVTID858", + }, {} /* Terminating entry */ };