Skip to content

drm/imagination: use live GPU performance rows on J85 - #38

Draft
theChristopher16 wants to merge 2 commits into
OrchardLinux:mainfrom
theChristopher16:j85-gpu-live-opp
Draft

theChristopher16 wants to merge 2 commits into
OrchardLinux:mainfrom
theChristopher16:j85-gpu-live-opp

Conversation

@theChristopher16

Copy link
Copy Markdown

J85's live ADT GPU performance rows differ from the J71 fallback. For a GPU node with an explicit operating-points-v2 table, read the six powered rows supplied by m1n1 and reject a missing or malformed table before mapping PMGR or loading firmware. The J85 device tree supplies the GPU alias and table and enables its GPU node. Nodes without the property retain their existing measured fallback.

Validation so far:

  • The earlier three-file draft built the A7 kernel, J85 DTB and powervr.ko through orchard build.
  • These two refactored commits pass git diff --check; their exact build is in progress.
  • No installed J85 GPU result is claimed from this branch yet. The earlier J85 RAM-session triangle test used a different image and does not validate this revision.

This needs the matching m1n1 GPU OPP population (currently pinned at 00cd20ea0343b66e77e1e5310f35fff49ce14aaa), J85-specific G3 firmware packaging, and a companion Orchard device-catalog update. See OrchardLinux/orchard#305 for the board firmware recipe. I will update this PR with the exact build and device results.

The J85 ADT reports GPU clocks and voltages that differ from the J71 fallback. Read an explicit operating-points-v2 table populated by m1n1 at each boot and reject missing or malformed rows before touching PMGR or loading firmware. Other A7 nodes keep their existing measured fallback until they supply their own table.

Assisted-by: LLM
Give the J85 GPU its own m1n1 alias and empty operating-points-v2 table. m1n1 fills the boards six powered states from the current boots SGX ADT before the driver probes. Enable the GPU node on this board, which has its own G3 firmware recipe and measured live rows.

Assisted-by: LLM
@theChristopher16

Copy link
Copy Markdown
Author

Read-only J85 evidence from the currently installed local j85gpu1 kernel (not this PR's exact two-commit build): /sys/firmware/devicetree/base/opp-table-gpu contains six populated rows:

Level MHz mV
1 330 937
2 390 965
3 450 1031
4 165 937
5 195 965
6 225 1031

The running kernel logged GPU performance rows from this boot's ADT OPP table. All six levels are unique and their values satisfy this PR's range and unit checks. The same local kernel later bound the PowerVR render node and produced a 64×64 offscreen Vulkan triangle whose pixels passed an independent host check (the earlier bounded result is documented in orchard PR #342). This supports the J85 table/driver direction, but does not validate this PR's exact revision, its build, or a GPU-accelerated desktop on J85.

@ricktav ricktav 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.

Heads-up so we don't duplicate work on the J85 GPU.

On the J71 (same S5L8960X / G6430) the GPU desktop runs on an installed kernel with #30 (two alternating compute records), OrchardLinux/mesa#25 (desktop through pco + Zink) and OrchardLinux/omarchy-a#148 (GSK_RENDERER=vulkan). Web and Chromium each ran an hour on it on 1 GB with no GPU faults. Status and measurements are in docs/bring-up/gpu/a7-g3.md (OrchardLinux/orchard#351, #400).

Our plan is to port that stack to the J85 next, by a route that doesn't wait on m1n1:

  • read the J85's GPU perf rows from its ADT once and put them in the J85 device tree as fixed values, as the J71's are, instead of having m1n1 populate the OPP table at each boot;
  • package the J85 G3 firmware (the orchard#305 recipe);
  • install the same kernel layer and mesa#25 on the J85, then run the desktop and the same soak.

We'll post the J85 rows, the build and the device results here, so they can be compared with the live-row approach in this PR. If the rows turn out to differ between boots or units, the live-row route is the right one, and we'll say so.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SFMaVcR5gEPcdDR8wQfiDP

@theChristopher16

Copy link
Copy Markdown
Author

Thanks for the coordination. I’ll avoid a competing J85 kernel port and focus on device evidence for this series. Our J85 currently runs a local j85gpu1 kernel with the board’s own packaged G3 firmware; it passed a bounded 64×64 offscreen Vulkan triangle with an independent full-image pixel check. That is not a desktop or long-run result. I’m building Mesa #25 as an isolated package and will test one frame and its transfer/readback on the running J85 before sharing the result here. I have measured the six live OPP rows on one boot (in my earlier comment); I won’t treat those values as fixed across boots without another capture. I’ll also keep extended desktop testing separate until the installed kernel is known to include linux#30.

@theChristopher16

Copy link
Copy Markdown
Author

Additional J85 runtime evidence from our local j85gpu1 kernel, not this PR's exact head: its live ADT-derived six-row GPU OPP table let PowerVR bind and supported a verified offscreen triangle, six exact full-screen color readbacks, and a normal GLES2/Zink Omarchy login on internal storage. The compositor and Qt shell both mapped the PowerVR driver. Touch and the desktop were initially responsive, but the user reported broad latency.

During a normal touch/app interaction after about 29 minutes of that GPU login, the user reported a frozen screen. The kernel had logged repeated Fender power state 3/4/6 not reached and devfreq ... dvfs failed (-110) transitions. It then logged compute and fragment job timeouts, firmware posted no fault, Fender state 3, and resetting the GPU. SSH and the render node survived. A Labwc session restart eventually restored the PIN/desktop and touch without rebooting. The local j85gpu1 lacks linux#30; the newer j85gpu2 with #30 is installed but has not been booted, so I cannot say whether that change helps.

This is not an exact match for #30's J71 compute-only lost-record signature: both engines timed out here, and the J85 compute mirror and finish stamps had both reached the prior sequence. The clock-transition timeouts preceded the hang, but causation is not established. This may be worth checking when comparing this PR's live OPP route with the fixed-row J85 port. No raw device identifiers, firmware or addresses are included. The Mesa-side status correction is here.

@theChristopher16

Copy link
Copy Markdown
Author

J85 hardware follow-up to the earlier j85gpu1 hang: a local j85gpu2 kernel built from this PR's J85 enablement with linux#30's A7 compute-retirement fix booted the existing internal Omarchy install. This is not a boot of this PR's exact two-commit head. The J85 ADT OPP table was accepted, PowerVR bound automatically with exp_hw_support=1, and /dev/dri/renderD128 appeared. The active Labwc and Quickshell session mapped the PowerVR driver through Mesa #25. A bounded six-frame full-screen draw/one-pixel readback probe returned six exact RGBA8 colors with gl_error=0; the owner confirmed the desktop and touch worked.

This boot also used the existing driver parameter apple_perf_state=1 (the measured J85 330 MHz / 937 mV row), so the GPU devfreq device was absent. At about 11 minutes of uptime, the boot journal had zero dvfs failed and GPU job-timeout lines. The prior boot had 32 DVFS failures and one two-engine timeout, but the kernel version and clock policy both changed, so this observation cannot assign the improvement to either one. The owner still reports touch/app opening as slow. Three full-screen Wayland captures took 0.235-0.349 s each; they are capture latency, not measured frame time.

This is a short J85 functional result, not a claim of long-run stability or an exact-head validation of #38. The staged fixed-state setting is a diagnostic and should be compared against a later controlled boot before changing shared policy. I did not apply or test linux#70 on J85. The Mesa-side bounded result and responsiveness limit are here.

@ricktav

ricktav commented Dec 2, 2026

Copy link
Copy Markdown

J85 result from the J71 route (the follow-up to my earlier note): one RAM boot of a second J85 (iPad mini 2 Wi-Fi), kernel = our A7 tree (a7/features) with the J85 &gpu node enabled, and the J71 driver unchanged except for the voltage rows (below). Not this PR's head.

The rows differ per unit, not just per board. This J85's ADT sgx perf-states (read from the ADT in the same boot), next to our J71 and the six OPP rows you posted:

Level MHz J71 (ours) mV J85 (ours) mV J85 (yours, OPP) mV
1 330 871 900 937
2 390 937 937 965
3 450 1000 1000 1031
4 165 871 900 937
5 195 937 937 965
6 225 1000 1000 1031

Frequencies are the same on all three; the voltages are not, even between two J85s. That suggests iBoot fills the rows per chip (binning), so a fixed table in the driver is only right for the unit it was read from. That is an argument for this PR's live-row route over the fixed J71 table we carry for the A7. I did not check whether m1n1's OPP rows and the sgx perf-states come from the same ADT property; if they do, your unit simply runs 30-37 mV higher.

Everything else matched the J71: the GPU bridge settings (pmgr bridges 0-13) are identical, CORE_REVISION 0x00014600 / CORE_ID 0x011b0403, and the same gfx-s5l8960x firmware.

Results, this J85, powervr with the J85's own rows (900/937/1000 mV) written into the firmware's platform data:

  • probe with exp_hw_support=1: clean, render node up
  • Vulkan compute ladder (Mesa A7 compute): G3 self-test, vulkaninfo and 10/10 smoke rungs pass
  • runtime PM: 8/8 suspend (GPU power state off) -> resume + job pass
  • 5 min soak: 3164 rung runs, 0 failures, no job timeouts, no Fender or DVFS errors, 26 C
  • this driver has no devfreq on the A7 (no host-side clock changes), so it does not exercise the dvfs failed (-110) / Fender 3/4/6 path you saw; with your apple_perf_state=1 boot also showing zero DVFS failures, the host-driven state transitions look like the first thing to isolate for the J85 hang

Not tested: graphics or a desktop (compute payload only), long runs, and whether the firmware applies the mV values itself. No device identifiers, firmware or ADT files included.

@Etienne-T

Copy link
Copy Markdown

RAM-boot result for both patches from this PR on a third J85 (iPad mini 2 Wi-Fi), with devfreq left on.

Kernel: 218ceb9cbb7f (nightly-20261201 base) with fae3d6ce0ee1 and d0d6c17954be applied. git patch-id --stable matches both public commits. The local tip was beab09dafe4f. The kernel was built with the Orchard kernel/build recipe. Image.gz and the three GPU dependency modules used alongside powervr.ko are byte-identical to the nightly's. There was no apple_perf_state override. The DTB was the nightly J85 DTB with only the GPU changes from d0d6c179 added: status okay, the gpu alias, and an empty opp-table-gpu referenced by operating-points-v2. m1n1 was the published 1e53a9f. The initramfs was minimal-boot plus the four GPU modules and the J85 firmware recipe output, without the ASP storage driver. The modules were loaded with insmod in the initramfs, with exp_hw_support=1 for PowerVR.

Live OPP rows (from /sys/firmware/devicetree/base/opp-table-gpu, same on two boots):

Level MHz mV
1 330 937
2 390 965
3 450 1000
4 165 937
5 195 965
6 225 1000

All six frequencies match both earlier reports. Levels 1, 2, 4 and 5 match theChristopher16's J85 at 937/965 mV. Levels 3 and 6 match ricktav's J85 at 1000 mV (theChristopher16 reported 1031 mV). So three J85s give three different row sets, which supports reading the rows live instead of carrying a fixed table.

Probe (boot 1):

powervr 201000000.gpu: GPU performance rows from this boot's ADT OPP table
powervr 201000000.gpu: MISC_ACG was clear: set after the GPU's power
powervr 201000000.gpu: A7 GPU: CORE_REVISION 0x00014600 CORE_ID 0x011b0403
[drm] Initialized powervr 1.0.0 for 201000000.gpu on minor 1

renderD128 was bound to powervr. runtime_status was suspended at the follow-up check, with 45.2 s suspended and 1.3 s active. The devfreq cur_freq was 165000000 Hz. The captured probe log showed no GPU fault or timeout.

Vulkan (boot 2): The same kernel and DTB ran an offscreen 64x64 triangle through Mesa #25 (45d17e96). See Mesa #25. The kernel log was continuous from the probe to the end, with no GPU fault, job timeout or reset logged, and the GPU autosuspended afterwards.

These results come from two short sessions, with one draw and one readback. They say nothing about long runs, the desktop or devfreq under sustained load.

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