mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fernando Rimoli <fernandorimoli11@gmail.com>
To: linux-media@vger.kernel.org
Cc: sakari.ailus@linux.intel.com, dan.scally@ideasonboard.com,
	mchehab@kernel.org, hansg@kernel.org, lsa.uz@pm.me,
	linux-kernel@vger.kernel.org,
	Fernando Rimoli <fernandorimoli11@gmail.com>
Subject: [PATCH] media: ipu-bridge: Add upside-down sensor quirks for the Surface Pro 9
Date: Tue, 15 Sep 2026 01:01:40 +0100	[thread overview]
Message-ID: <20260915000140.47125-1-fernandorimoli11@gmail.com> (raw)

The Microsoft Surface Pro 9 mounts both its front sensor (OVTI5693) and
its rear one (OVTID858) rotated 180 degrees, and its SSDB reports 0 for
each, so frames from either arrive inverted with nothing to say so.

Add both to upside_down_sensor_dmi_ids. The two entries carry identical
DMI matches and differ only in the ACPI HID they gate on, which works
because ipu_bridge_parse_rotation() walks every matching DMI entry rather
than stopping at the first one.

Measured on a Surface Pro 9, DMI product SKU Surface_Pro_9_2038, IPU6
Alder Lake-P 8086:465d, where the inversion of both sensors was confirmed
visually. Matched on DMI_PRODUCT_NAME as the rest of the table is, rather
than on the narrower SKU: the entries only take effect when the ACPI HID
matches too, so a variant of the same model that shipped different
sensors is left alone.

This makes the kernel report the mounting truthfully and does no more
than that. Nothing in the bridge rotates pixels, so an application that
reads the property can turn the image the right way up while one that
ignores it still shows it inverted.

Signed-off-by: Fernando Rimoli <fernandorimoli11@gmail.com>
---
Applies to media/next as it stands today.

Two notes for whoever sequences this against Sergey Lebedev's Surface Pro 11
entry, which is in flight for the same table:

  https://lore.kernel.org/linux-media/20260913153526.80287-1-lsa.uz@pm.me/

Both his entry and mine go in immediately before the terminating entry, so
whichever is applied second needs a one-line context fix. Nothing else in the
two overlaps: different machines, different HIDs.

Separately, and only because it would be a shame for it to be dropped
silently: his version as posted does not apply to the current tip. Its hunk
context ends at the Samsung Galaxy Book5 Pro 360 entry (OVTI02E1), while the
table now ends with the Book3 Ultra (960XFH, OVTI02C1), so his base predates
that entry. A rebase is all it needs.

I have not touched the Surface Pro 9 rear sensor's own bridge entry here.
That is Sergey's patch, which I tested separately:

  https://lore.kernel.org/linux-media/20260913142034.5632-1-lsa.uz@pm.me/

 drivers/media/pci/intel/ipu-bridge.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c
index 952868a..f286881 100644
--- a/drivers/media/pci/intel/ipu-bridge.c
+++ b/drivers/media/pci/intel/ipu-bridge.c
@@ -226,6 +226,22 @@ static const struct dmi_system_id upside_down_sensor_dmi_ids[] = {
 		},
 		.driver_data = "OVTI02C1",
 	},
+	{
+		/* Microsoft Surface Pro 9, front sensor */
+		.matches = {
+			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
+			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Pro 9"),
+		},
+		.driver_data = "OVTI5693",
+	},
+	{
+		/* Microsoft Surface Pro 9, rear sensor */
+		.matches = {
+			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
+			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Surface Pro 9"),
+		},
+		.driver_data = "OVTID858",
+	},
 	{} /* Terminating entry */
 };
 

             reply	other threads:[~2026-09-15  0:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15  0:01 Fernando Rimoli [this message]
2026-09-15  7:56 ` Sergey Lebedev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260915000140.47125-1-fernandorimoli11@gmail.com \
    --to=fernandorimoli11@gmail.com \
    --cc=dan.scally@ideasonboard.com \
    --cc=hansg@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=lsa.uz@pm.me \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®