Skip to content

have iio-sensor-proxy detect panel orientation#13

Open
fstanis wants to merge 1 commit into
mainfrom
detect-drm
Open

have iio-sensor-proxy detect panel orientation#13
fstanis wants to merge 1 commit into
mainfrom
detect-drm

Conversation

@fstanis

@fstanis fstanis commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Fix per #10 (comment)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in drv-mxc6655-accel.c to compute and apply a static rotation compensation (panel_deg) to all reported orientations.
  • Extend tools/check-status.sh to report the current DRM panel orientation via modetest.
  • Add libdrm as 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 thread tools/check-status.sh
Comment on lines +160 to +162
if [[ -z "${val}" ]]; then
print_warn "panel rotation" "no DRM panel orientation property (try sudo)"
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants