have iio-sensor-proxy detect panel orientation#13
Open
fstanis wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the MiniBook-specific iio-sensor-proxy MXC6655 accelerometer driver to detect the DRM DSI connector’s panel orientation at startup and compensate its reported orientations so static rotation (VBT/kernel/i915 quirks) and dynamic rotation no longer stack. It also adds a diagnostic line to tools/check-status.sh and documents the combined static+dynamic behavior in the guides.
Changes:
- Add DRM (
libdrm) probing indrv-mxc6655-accel.cto compute and apply a static rotation compensation (panel_deg) to all reported orientations. - Extend
tools/check-status.shto report the current DRMpanel orientationviamodetest. - Add
libdrmas a build dependency for the iio-sensor-proxy fork and update documentation describing the behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/check-status.sh | Adds a panel rotation status line by parsing DRM panel orientation via modetest. |
| iio-sensor-proxy/meson.build | Introduces libdrm dependency used by the sensor proxy driver change. |
| iio-sensor-proxy/src/meson.build | Links libdrm into the iio-sensor-proxy executable dependencies. |
| iio-sensor-proxy/src/drv-mxc6655-accel.c | Reads DRM panel orientation at startup and de-rotates sensor output to avoid stacking with static rotation. |
| GUIDE.md | Documents how static rotation interacts with the proxy and how to verify via logs/check-status. |
| docs/iio-sensor-proxy.md | Documents the DRM panel orientation compensation behavior at startup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| for (gint card = 0; card < MAX_DRM_CARD; card++) { | ||
| g_autofree gchar *path = g_strdup_printf ("/dev/dri/card%d", card); | ||
| gint fd = open (path, O_RDWR | O_CLOEXEC); |
Comment on lines
+263
to
+272
| gint drm_orient = read_panel_orientation (); | ||
| gint deg = panel_orient_degrees (drm_orient); | ||
|
|
||
| g_message ("MXC6655: DRM panel orientation %d, compensating sensor " | ||
| "output by %d°, laptop mode reports orientation %d", | ||
| drm_orient, deg, | ||
| compose_orientation (MXC_ORIENT_RIGHT, deg)); | ||
|
|
||
| return deg; | ||
| } |
Comment on lines
+160
to
+162
| if [[ -z "${val}" ]]; then | ||
| print_warn "panel rotation" "no DRM panel orientation property (try sudo)" | ||
| return |
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.
Fix per #10 (comment)