Surface Pro 9: fix rear camera rotation - #170
Open
jmmartinf wants to merge 2 commits into
Open
Conversation
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 <jmmartinf@hotmail.com>
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 <jmmartinf@hotmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The rear OV13858 camera (OVTID858) of the Surface Pro 9 comes out rotated 180°: the firmware SSDB reports
degree=0, and the existing DMI quirk inipu-bridgeonly covers the front OVTI5693 camera (added in #160).Fixing it takes two commits:
media: ipu-bridge: check all DMI entries when overriding sensor rotation—ipu_bridge_parse_rotation()usesdmi_first_match(), which always stops at the first entry matching the running machine, so a second entry for the same machine (needed for a second sensor) is unreachable. Walk the whole table and match each entry for the running machine against the sensor's ACPI HID instead. This is a general fix, not SP9-specific; I intend to send it to linux-media mainline as well.media: ipu-bridge: fix rear camera rotation on Surface Pro 9— add theSurface Pro 9→OVTID858quirk entry, next to the existing front-camera one.Tested on a Surface Pro 9 (kernel
6.19.8-3.surface.fc43, module rebuilt fromv6.19-surface):libcameranow reportsRotation = 180for the rear camera (was 0) and the image renders upright in GNOME Snapshot.Rotation = 180, upright image, cold first-open works.cam --capture), no newipu-bridge/ov5693/ov13858errors in dmesg.