media: i2c: ov13858: apply 180-degree sensor flip on Surface Pro 9 - #177
Open
dragged9698 wants to merge 1 commit into
Open
media: i2c: ov13858: apply 180-degree sensor flip on Surface Pro 9#177dragged9698 wants to merge 1 commit into
dragged9698 wants to merge 1 commit into
Conversation
The Surface Pro 9 rear OV13858 (OVTID858) is mounted upside-down. SSDB reports degree=0, and PipeWire does not rotate buffers from V4L2 Rotation metadata, so the image stays inverted even after ipu-bridge reports Rotation=180. Do not advertise V4L2 HFLIP/VFLIP: libcamera remaps Bayer order from those controls and the image washes out. After the mode table is programmed, set the FORMAT2 horizontal bits the ov5693 uses on this tablet plus the ov13b10 FORMAT1 vertical bits (4 and 5). The ov5693 FORMAT1 bits are a no-op on this die. Report rotation=0 when the hardware flip is applied so clients that do honor metadata do not double-rotate. Tested on Surface Pro 9 (CachyOS 6.19.8-1-cachyos-surface) with PipeWire and libcamera. Front ov5693 is unchanged. Link: linux-surface/linux-surface#1892 Link: linux-surface#170 Patchset: cameras Signed-off-by: Jeff <125375211+dragged9698@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
I do not think we want to flip bytes in the driver |
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.
PipeWire and the camera portal leave the Surface Pro 9 rear camera upside-down even when
Rotation=180is advertised. This applies the 180-degree correction in the OV13858 itself so those clients get an upright image.Why not metadata-only
#170 is the right ipu-bridge fix for clients that honor V4L2 Rotation (GNOME Snapshot / libcamera). PipeWire ignores that property, so OBS and similar stay inverted. This PR is the pixel-path complement: after the mode table is written, it ORs FORMAT2 horizontal bits (same ones ov5693 uses on this tablet) and ov13b10 FORMAT1 vertical bits 4+5. ov5693's FORMAT1 bits are a no-op on this die.
V4L2 HFLIP/VFLIP are not advertised — libcamera remaps Bayer from those controls and the image washed out when we tried that.
When the hardware flip is on,
rotationis reported as 0 so a later merge of #170 does not double-rotate.Not in this PR
ov5693IPU6MIPI_CTRL00=0x2d— already in linux-surface/linux-surface#2171OVTID858quirk — already in Surface Pro 9: fix rear camera rotation #170Test plan
6.19.8-1-cachyos-surface, out-of-treeov13858.kowith this overlayov5693still streams (unchanged by this commit)Patchset: cameras