Skip to content

arm64: dts: apple: t8142: request AVD performance via PMP report - #3836

Merged
DjDeveloperr merged 1 commit into
mainfrom
feat/t8142-avd-perf
Dec 1, 2026
Merged

DjDeveloperr merged 1 commit into
mainfrom
feat/t8142-avd-perf

Conversation

@sithglan

@sithglan sithglan commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

What: Wire pmp_report_avd (report@13, SOC-DEV-DVFS entry 0x40, level 2) as AVD's demand-gated "perf" power domain on T8142 (J813/J815 and J704) so 4K60 hardware video decode is no longer starved at SOC fabric state 0 when CPUs and GPU are lightly loaded (such as after #3710 lowered light desktop compositing to DCS 1 / fabric 0).
Tested: J813 M5 MacBook Air 13-inch at cce70b4d3c9a (7.3.0-aurora-j813-avd+): boots cleanly (0 failed units, 0 new kernel errors, s2idle [deep]); 156 Mbps peak 4K60 H.264 decode rises from 44 fps (0.73x) to 99 fps (1.65x, bit-exact MD5 vs SW decode) with PMP voting agent0 = 0x20 during decode and releasing to 0x00 (pmp-avd off-0) on idle; 1080p30 real-time decode keeps pmp-avd off-0; live mpv playback achieves 0 VO drops and 0 decoder drops across vo=gpu-next, vo=gpu, and vo=dmabuf-wayland.
Risk: two-way door · M5 (T8142) Macs (J813, J815, J704)
Not yet: J815 and J704 live hardware runs (both share the T8142 SoC PMP/AVD layout and passed dtbs_check with 0 warnings)

Details
  • On T8142, pmp_report (apple,t8142-pmp-v2-report) already covers SOC-DEV-DVFS entries 0x37..0x46, and apple-avd (52d1efdec9d9) already demand-gates its optional "perf" power domain (engaging on >1080p, >=180 Mpx/s, multi-stream, or >=4 queued frames, while leaving it off on single-stream 1080p30/60).
  • In the J813 ADT, AVD is soc-device record 19 (0x13), DVFS ordinal 9 (SOC-DEV-DVFS entry 0x37 + 9 = 0x40), with PMP-SOC (0x20) performance floor requests.
  • Wiring pmp_report_avd: report@13 with apple,dvfs = <0x40 2> and power-domains = <&ps_avd_sys> lets the PMP acknowledge AVD and vote SOC state 2 (agent0 floor: 0x00000020) via its static PMC agent only while demanding streams are active.
  • Level 2 hits the full AVD throughput plateau on J813: levels 3 and 4 give no additional speedup on either 156 Mbps 4K60 H.264 or 4K60 HEVC (and level 5 is clamped to 4 by PMP), while keeping the SOC rail below states 3–4. Adding DCS 7 on top of SOC 2/4 changes throughput by only ~1–2% (99 -> 101 fps H.264, 3.96x -> 4.02x HEVC), so no separate DCS floor is needed.
Evidence

Exact-head J813 (air5) verification at cce70b4d3c9a (7.3.0-aurora-j813-avd+)

  • Boot & health: Linux air5 7.3.0-aurora-j813-avd+ #2 SMP PREEMPT aarch64, 0 failed systemd units, mem_sleep: s2idle [deep], apple-pmp-report 3803c0000.pmp-report: PMP running (status 0x1), requests 0x0, 0 new kernel errors.
  • 4K60 H.264 sweep (ffmpeg -hwaccel v4l2request -i ~/man_over_bord_small.mp4 -t 13 -f null -, 780 frames, 156 Mbps peak, idle CPUs):
Config PMC agent0 during decode FPS Speed Elapsed Notes
Baseline (no perf) 0x00000000 (SOC 0) 44 0.73x 17.7 s Starved below real time
apple,dvfs = <0x40 1> 0x00000010 (SOC 1) 67 1.11x 11.70 s
apple,dvfs = <0x40 2> (cce70b4d3c9a) 0x00000020 (SOC 2) 99 1.65x 7.86 s Plateau reached; releases to 0x00000000 / off-0
apple,dvfs = <0x40 3> 0x00000030 (SOC 3) 100 1.67x 7.80 s No further gain
apple,dvfs = <0x40 4> 0x00000040 (SOC 4) 99 1.66x 7.86 s No further gain
apple,dvfs = <0x40 5> 0x00000040 (SOC 4) 99 1.66x 7.85 s Clamped to 4 by PMP
  • 4K60 HEVC (testsrc2 3840x2160@60, 120 frames): 3.96x (0.50 s) at apple,dvfs = <0x40 2> vs 4.02x (0.49 s) at SOC 4 + DCS 7.
  • Bit-exactness (first 60 frames of 4K60 H.264): HW=MD5=558f73951aa2a928708ca14716364ad8, SW=MD5=558f73951aa2a928708ca14716364ad8.
  • 1080p30 demand-gating (ffmpeg -re -hwaccel v4l2request): avd_sys: on, pmp-avd: off-0, PMC agent0 floor: 0x00000000.
  • Live mpv playback on J813 (~/man_over_bord_small.mp4, 0–13 s, Apple M5 G17G C0 OpenGL / Wayland):
    • vo=gpu-next --video-sync=display-resample --hwdec=v4l2request: vo_drop=0, dec_drop=0, wall 13.22s (was 84–215 VO / 6–30 dec drops)
    • vo=gpu --hwdec=v4l2request: vo_drop=0, dec_drop=0, wall 13.35s (was 320 VO / 80 dec drops)
    • vo=dmabuf-wayland --hwdec=v4l2request: vo_drop=0, dec_drop=0, wall 13.28s (was 349 VO / 96 dec drops)

Static, schema, and KUnit checks

  • ./scripts/checkpatch.pl --strict -g HEAD: 0 errors, 0 warnings, 0 checks
  • CHECK_DTBS=y DT_SCHEMA_FILES="apple,avd.yaml:apple,t8140-pmp-report.yaml" on t8142-j813.dtb, t8142-j815.dtb, t8142-j704.dtb: 0 warnings
  • kunit.py arm64 QEMU (apple-*, incl. apple-avd-pm and apple-pmp-report): 519/519 passed

Add a PMP report entry for AVD on T8142 (soc-device record 19 / 0x13,
SOC-DEV-DVFS entry 0x40, level 2) and attach it as AVD's optional "perf"
power domain alongside ps_avd_sys ("core") on J813/J815 and J704.

Without a "perf" domain, AVD runs at the lowest SoC fabric state (0)
whenever CPUs and GPU are lightly loaded -- including 4K60 video playback
after the J813/J815 CLPC GPU busy-share ladder lowered light compositing
to DCS 1 / fabric 0 -- capping high-bitrate 4K60 H.264 decode below real
time (~44 fps on a 156 Mbps peak 4K60 stream on J813).

With pmp_report_avd wired as "perf", apple-avd's demand-gated PM
engages the PMP report only for demanding streams (>1080p, >=180 Mpx/s,
multi-stream, or queue backlog) and releases it back to 0 on idle:
- PMP acknowledges record 0x13 and votes SOC state 2 through its static
  PMC voter agent (agent0 floor 0x00000020).
- Measured on J813 (M5 MacBook Air 13-inch, idle CPUs, 156 Mbps peak
  4K60 H.264 via ffmpeg -hwaccel v4l2request):
  - No perf domain (SOC 0): 44 fps (0.73x)
  - Level 1 (SOC 1):        67 fps (1.11x)
  - Level 2 (SOC 2):        99 fps (1.66x), bit-exact MD5 vs SW decode
  - Level 3 (SOC 3):       100 fps (1.67x)
  - Level 4 (SOC 4):        99 fps (1.66x); level 5 clamps to 4
- 4K60 HEVC decodes at 3.96x at level 2 (matching 4.02x at SOC 4 + DCS 7).
- 1080p30 real-time decode keeps pmp-avd off-0 (agent0 floor 0x00000000).

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
@sithglan
sithglan requested review from a team as code owners December 1, 2026 21:09
@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Merge readiness at cce70b4d: ready to merge

Check Detail
CI at head ok 5 checks passed
Review ok approved by RyanTheTide
Requested changes ok none
Hardware row at head ok in the PR body at cce70b4d
Conflicts ok none
PR text ok Risk: two-way · M5 (T8142) Macs (J813, J815, J704)

Areas: area:bringup
Merge: gh pr merge 3836 --merge (Owners and Core through the bypass: add --admin).

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved at cce70b4. This uses the same pattern as T8140 (avd perf = pmp_report_avd0, "core"/"perf" names, pmp report entry with power-domains = ps_avd_sys). pmp_report is enabled on J704 and on J813/J815 (j815.dts includes t8142-j813-avd.dtsi). report@13 does not clash with the other T8142 entries (J704 hdmi = @1a). apple,dvfs is a 2-cell value, as pmp-report.c parses it. The J813 row shows the vote engaging (0x20) only on demand and releasing to off-0 at idle. Decode output is bit-exact. Follow-up, not a blocker: J815/J704 live rows.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 2026
@DjDeveloperr
DjDeveloperr merged commit 6a70888 into main Dec 1, 2026
7 checks passed
@DjDeveloperr
DjDeveloperr deleted the feat/t8142-avd-perf branch December 1, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants