Page MenuHomeFreeBSD

x11/framework-autorotate: New port
Needs ReviewPublic

Authored by dteske on Wed, Aug 5, 4:14 AM.

Details

Summary

Framework Laptop 12 X11 display autorotate: Chrome EC memmap
accelerometer and TBMD drive RandR on the built-in panel, ILIT
touch/stylus remap, XDM greeter recovery, and an optional
per-user chrome hook.

Test Plan

Requires a Framework Laptop 12 (convertible) under FreeBSD with an X11
session (or XDM greeter). Other machines can exercise build/install only;
the functional half needs the Chrome EC (/dev/io) and a 360 hinge.

Build / install

  • cd /usr/ports/x11/framework-autorotate
  • make clean check-plist BATCH=yes
  • make check-plist BATCH=yes WITHOUT=EXAMPLES
  • make reinstall clean (or: make package && pkg install -f ./work/pkg/*.pkg)

Enable and start

  • sysrc framework_autorotate_enable=YES
  • sysrc framework_autorotate_mode=always (or: tablet)
  • optional: sysrc framework_autorotate_logfile=/var/log/framework_autorotate.log
  • service framework_autorotate start
  • service framework_autorotate status Expect running, with /var/run/framework_autorotate.pid present.

Functional (Framework Laptop 12)

  • With a logged-in X11 session on the built-in panel:
    • Fold past about 180 degrees into tablet (or tip the lid) and confirm the panel rotates via xrandr to match orientation.
    • Confirm absolute touch (and stylus, if present) still track the rotated panel on the built-in screen; external heads, if any, stay put.
  • service framework_autorotate stop
  • service framework_autorotate start Confirm rotate still works after restart.
  • Optional mode check: sysrc framework_autorotate_mode=tablet service framework_autorotate restart Expect rotation only while EC reports tablet mode; otherwise forced to normal.
  • Optional greeter: log out to XDM (or equivalent); confirm the greeter recovers usable orientation / built-in panel placement after logout.

Cleanup (optional)

  • service framework_autorotate stop
  • sysrc -x framework_autorotate_enable framework_autorotate_mode
  • pkg delete framework-autorotate

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 75436
Build 72319: arc lint + arc unit

Event Timeline

dteske requested review of this revision.Wed, Aug 5, 4:14 AM
dteske created this revision.

Drop ONLY_FOR_ARCHS=amd64: Framework Laptop 12 hardware is amd64, but
the port need not be. EC LPC via /dev/io is not an amd64-only constraint.

jrm added a subscriber: jrm.

Very cool.

Looks good to me. A few thoughts:

  • Looking at the upstream code, I see you're calling xset in x11_greeter.c:61-62, so should we add xset:x11/xset to RUN_DEPENDS?
  • (optional) portclippy/portfmt have a few minor nits.
  • You could use %%EXAMPLESDIR%% instead of share/examples/framework_autorotate/ in pkg-plist.
  • files/pkg-message.in doesn't have any substitutions, so it could be a plain pkg-message without SUB_FILES.
This revision is now accepted and ready to land.Wed, Aug 5, 5:46 AM

Run portclippy and portmgr -i, incorporate feedback from jrm

This revision now requires review to proceed.Fri, Aug 7, 6:49 PM

Update distinfo

I moved the 1.0 tag to incorporate -hold / -release feature

Looks good.

One other nit unrelated to the port: In the manpage, for -v, I see: When a logfile is configured (see) RC.CONF (), verbose

I think you want this in the source.

.Po see
.Sx RC.CONF
.Pc ,

so it renders like this: When a logfile is configured (see RC.CONF), verbose.

This revision is now accepted and ready to land.Fri, Aug 7, 9:01 PM

makesum following fix to framework_autorotate(8) [jrm]

This revision now requires review to proceed.Fri, Aug 7, 9:54 PM