Skip to content

drm/simpledrm: Support 10.5-inch iPad Pro 2 and 48/30/24 Hz H9G cadences - #173

Merged
henrikklee merged 1 commit into
OrchardLinux:mainfrom
grierj:simpledrm-h9g-j207-cadences
Dec 5, 2026
Merged

henrikklee merged 1 commit into
OrchardLinux:mainfrom
grierj:simpledrm-h9g-j207-cadences

Conversation

@grierj

@grierj grierj commented Dec 4, 2026

Copy link
Copy Markdown

Extends the existing A10X (t8011) H9G boot-scanout cadence switching in drivers/gpu/drm/sysfb/simpledrm.c:

  1. Adds 10.5-inch iPad Pro 2 (J207/J208, 1668×2224) alongside the existing 12.9-inch iPad Pro 2 (J120/J121, 2048×2732). Both boards already share t8011-pro2.dtsi, which wires &framebuffer0 { display = <&h9g_display>; };.
  2. Exposes lower ProMotion cadences (48 / 30 / 24 Hz) via H9G_EXTRA_SUBFRAMES (3 / 6 / 8 extra blank subframes after the 2 active subframes on the fixed 240 Hz subframe clock) in addition to 120 Hz (0) and the default preferred 60 Hz boot cadence (2).

Default boot behavior is unchanged (60 Hz remains preferred and is restored on teardown); userspace/compositors can now drop to 24 Hz when idle and step up to 60/120 Hz when active.

Verification on J207 (iPad Pro 10.5-inch, Wi-Fi)

  • Built cleanly via orchard build --device j207 --kernel-tree (zero warnings).
  • Confirmed J207 H9G boot registers: M3_CTL=3, MODE=1, IRQ_EN=0, OUT_EN=0, EXTRA_SF=2, SF_LINES=1227, ACT_SF=0x200, 0x1802c=0x08b00684 (1668×2224), htotal=1756.
  • Measured actual hardware cadence from the H9G_EXTRA_SUBFRAMES subframe counter:
    • sf=2: 59.995 Hz
    • sf=3: 47.995 Hz
    • sf=6: 29.985 Hz
    • sf=8: 24.004 Hz
  • Visually verified 24 Hz clean and usable on the panel (Firefox + control menu).
  • Measured settled BQ27540 idle current on 500 mA USB (bl=400, schedutil): 60 Hz +25..+36 mA -> 24 Hz +131..+132 mA (~105 mA / ~410 mW saved).

@grierj

grierj commented Dec 4, 2026

Copy link
Copy Markdown
Author

Live DRM mode-switching verified on J207 (Omarchy A, Wayland / wlr-randr):

wlr-randr lists all five modes with 60.000000 Hz as preferred/default (60, 120, 48, 30, 24 Hz), and switching through every cadence updates H9G_EXTRA_SUBFRAMES (0x206018050) cleanly with zero DRM errors in dmesg:

  • Initial: 60.000000 Hz (preferred, current) | EXTRA_SF=0x00000002 (sf=2)
  • 24 Hz: 1668x2224 px, 24.000000 Hz (current) | EXTRA_SF=0x00080008 (sf=8)
  • 30 Hz: 1668x2224 px, 30.000000 Hz (current) | EXTRA_SF=0x00050006 (sf=6)
  • 48 Hz: 1668x2224 px, 48.000000 Hz (current) | EXTRA_SF=0x00000003 (sf=3)
  • 120 Hz: 1668x2224 px, 120.000000 Hz (current) | EXTRA_SF=0x00000000 (sf=0)
  • 60 Hz: 1668x2224 px, 60.000000 Hz (preferred, current) | EXTRA_SF=0x00000002 (sf=2)

Extend the A10X (T8011) H9G boot-scanout cadence switcher in simpledrm:

1. Add the 10.5-inch iPad Pro 2 panel (J207/J208, 1668x2224, htotal 1756,
   1227 lines per subframe, 517107 kHz pixel clock) alongside the
   12.9-inch iPad Pro 2 panel (J120/J121, 2048x2732, htotal 2088, 1497
   lines per subframe, 750001 kHz). Both share t8011-pro2.dtsi, which
   already links framebuffer0 to h9g_display.
2. Expose the lower ProMotion scanout cadences via H9G_EXTRA_SUBFRAMES in
   addition to 120 Hz (0 extra) and the preferred 60 Hz boot cadence (2
   extra): 48 Hz (3 extra), 30 Hz (6 extra), and 24 Hz (8 extra), while
   keeping 60 Hz as the default preferred mode and restoring the boot
   cadence on teardown.
3. Guard H9G register programming in simpledrm_atomic_enable() with
   drm_dev_enter()/drm_dev_exit() so queued nonblocking atomic commits
   cannot touch H9G MMIO after unplug, and add a .shutdown callback that
   unplugs DRM and restores the boot cadence so kexec from an alternate
   cadence hands off at 60 Hz.

Verified live on J207 (iPad Pro 10.5-inch, Wi-Fi):
- Hardware timing registers confirmed (0x1802c=0x08b00684,
  0x18030=0x003e0012, 0x18034=0x00020008, 0x18708=1227, 0x1870c=0x200)
- Measured refresh rates via H9G_EXTRA_SUBFRAMES counter:
  sf=2 -> 60.00 Hz, sf=3 -> 48.00 Hz, sf=6 -> 29.99 Hz, sf=8 -> 24.00 Hz
- Visually verified clean/flicker-free at 24 Hz with Firefox and shell UI
- Settled idle power on 500 mA desktop USB (bl=400, schedutil): dropping
  from 60 Hz to 24 Hz saves ~105 mA (~410 mW), lifting net battery
  current from +25/+36 mA to +131/+132 mA charging.

Assisted-by: LLM
Signed-off-by: Grier Johnson <grier@scooterfarm.com>
@grierj
grierj force-pushed the simpledrm-h9g-j207-cadences branch from 0d8dedf to fd64614 Compare December 4, 2026 23:50
@grierj

grierj commented Dec 5, 2026

Copy link
Copy Markdown
Author

Rebased onto main (182354dda) and added two lifecycle fixes from review (fd6461428):

  • Guard H9G MMIO write/readback in simpledrm_atomic_enable() with drm_dev_enter() / drm_dev_exit().
  • Add a .shutdown callback that unplugs DRM and restores the 60 Hz boot cadence so kexec from an alternate cadence hands off cleanly.

Re-verified live on J207 (iPad Pro 10.5-inch, Wi-Fi): wlr-randr exposes all 5 modes (60 preferred, 120, 48, 30, 24 Hz) and switches across all 5 cleanly with zero DRM errors in dmesg.

@henrikklee
henrikklee merged commit 974e4af into OrchardLinux:main Dec 5, 2026
4 checks passed
@henrikklee

Copy link
Copy Markdown

Merged, thank you @grierj! The 10.5-inch iPad Pro 2 now switches refresh rates like the 12.9-inch, and both get 48/30/24 Hz on top of 60/120 with 60 Hz still the default. The ~105 mA idle saving at 24 Hz on the J207 is a great result, and the wlr-randr run through every mode made this easy to land.

Nothing was changed on the branch and nothing was left out. The shutdown hook back to 60 Hz and the unplug guard are in too; both look right.

Possible follow-up whenever you like (not urgent): upstream would carry the per-panel timings in the device tree rather than in a table inside simpledrm. This extends the approach main already used for the 12.9-inch, so it was fine to merge as is.

It reaches users when orchard moves its kernel lock, which is happening next.

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.

2 participants