From 15e0acebff28feed6ac64121a9c6f987c831b2fd Mon Sep 17 00:00:00 2001 From: Jose Maria Martin Date: Mon, 10 Aug 2026 00:12:12 +0200 Subject: [PATCH 1/2] media: ipu-bridge: check all DMI entries when overriding sensor rotation A machine can have more than one sensor whose rotation needs to be overridden, listed as one upside_down_sensor_dmi_ids[] entry per sensor sharing the same DMI match, e.g. the front (OVTI5693) and rear (OVTID858) cameras of the Microsoft Surface Pro 9. 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. Signed-off-by: Jose Maria Martin --- drivers/media/pci/intel/ipu-bridge.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c index 3418ff4751985..00743b205f665 100644 --- a/drivers/media/pci/intel/ipu-bridge.c +++ b/drivers/media/pci/intel/ipu-bridge.c @@ -291,9 +291,18 @@ 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 can have more than one sensor whose rotation must be + * overridden (e.g. both the front and the rear camera), listed as + * one entry per sensor sharing the same DMI match. + * dmi_first_match() only ever returns the first matching entry, so + * walk the whole table and match each candidate against the + * sensor's ACPI HID. + */ + 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 ec191928beadfc1a53c1fbf03b579facf5ab0eb0 Mon Sep 17 00:00:00 2001 From: Jose Maria Martin Date: Mon, 10 Aug 2026 00:12:12 +0200 Subject: [PATCH 2/2] media: ipu-bridge: fix rear camera rotation on Surface Pro 9 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: Jose Maria Martin --- 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 00743b205f665..c8fad8960e7ab 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 */ };