Skip to content

fix: use runtime screen dimensions for Paper Pro Move (960×1696) compatibility#22

Open
mouse76229 wants to merge 4 commits into
MaximeRivest:mainfrom
mouse76229:fix/dynamic-screen-dimensions
Open

fix: use runtime screen dimensions for Paper Pro Move (960×1696) compatibility#22
mouse76229 wants to merge 4 commits into
MaximeRivest:mainfrom
mouse76229:fix/dynamic-screen-dimensions

Conversation

@mouse76229

@mouse76229 mouse76229 commented Jul 9, 2026

Copy link
Copy Markdown

Problem

On the reMarkable Paper Pro Move (imx93-chiappa, i.MX93 SoC), riddle had two bugs caused by hardcoded constants:

1. Screen dimensions (1620×2160 hardcoded)
The quill framebuffer on Paper Pro Move reports 960×1696 pixels. The hardcoded `SCREEN_W`/`SCREEN_H` caused content to be clipped and the thinking blot to appear off-screen.

2. Digitizer axis ranges (11180×15340 hardcoded)
The pen digitizer axis limits differ between devices:

  • Paper Pro: `ABS_X max=11180`, `ABS_Y max=15340`
  • Paper Pro Move: `ABS_X max=6760`, `ABS_Y max=11960`

With Paper Pro values hardcoded, pen coordinates on the Paper Pro Move mapped to only ~60% of the screen — ink appeared far from the actual pen tip.

Solution

Screen dimensions: Remove `SCREEN_W`/`SCREEN_H` constants from `fb.rs`. Read `surf.w`/`surf.h` at runtime after `Display::open()` and propagate through:

  • `plan_reply()` / `append_reply()` — text centering and y-position clamp
  • `conjure()` — page snapshot and clear
  • `help::show()` — panel centering
  • `help::show_sleep()` / `help::restore_sleep()` — full-screen sleep card

Digitizer ranges: Read `ABS_X`/`ABS_Y` max values at runtime via `EVIOCGABS` ioctl in `PenDevice::open()`, falling back to Paper Pro values if the ioctl fails.

Testing

Tested on a reMarkable Paper Pro Move (OS 3.27.3.0). Startup log confirms both fixes:

quill: aux framebuffer 960x1696 format=4 bpl=3840
riddle: display quill/takeover (960x1696 stride 3840)
riddle: pen device /dev/input/event2 opened (grabbed: true, digi 6760x11960)
  • Content is no longer clipped
  • Pen ink appears at the correct position under the pen tip

mouse76229 and others added 2 commits July 9, 2026 20:00
The reMarkable Paper Pro Move (imx93-chiappa) reports a quill framebuffer
of 960×1696, not 1620×2160. The previous hardcoded SCREEN_W/SCREEN_H
constants caused content to be clipped on that device.

Remove the constants from fb.rs and instead read surf.w/surf.h at
runtime after Display::open(). Propagate sw/sh through plan_reply(),
append_reply(), conjure(), help::show(), help::show_sleep(),
help::restore_sleep(), and PenDevice (for digitizer-to-screen mapping).

This makes riddle work correctly on any screen size reported by the
vendor quill engine, including future reMarkable hardware revisions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PenDevice::open() needs sw/sh, which must be defined
before pen_dev is opened, not after.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mouse76229 mouse76229 changed the title fix: use runtime screen dimensions instead of hardcoded 1620×2160 fix: use runtime screen dimensions for Paper Pro Move (960×1696) compatibility Jul 9, 2026
mouse76229 and others added 2 commits July 9, 2026 20:43
The ABS_X/ABS_Y max values differ between devices:
- Paper Pro:      DIGI_MAX_X=11180, DIGI_MAX_Y=15340
- Paper Pro Move: DIGI_MAX_X=6760,  DIGI_MAX_Y=11960

Hardcoding the Paper Pro values caused pen coordinates to map to
only ~60% of the screen on the Paper Pro Move, making ink appear
in the wrong position relative to the actual pen tip.

Fix: call EVIOCGABS on open to read the real axis limits from the
kernel driver, falling back to the Paper Pro values if the ioctl
fails. The actual ranges are logged on startup for verification.

Verified on Paper Pro Move:
  riddle: pen device /dev/input/event2 opened (grabbed: true, digi 6760x11960)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Caveat is more legible than Dancing Script while retaining
a natural handwriting feel. DancingScript.ttf kept in fonts/
for easy rollback via v-dancing-script-restore tag.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant