Skip to content

Display dma optimization - #99

Merged
TheMaxMur merged 6 commits into
TheMaxMur:mainfrom
cofob:cofob/display-dma-optimization
Sep 2, 2026
Merged

Display dma optimization#99
TheMaxMur merged 6 commits into
TheMaxMur:mainfrom
cofob:cofob/display-dma-optimization

Conversation

@cofob

@cofob cofob commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

What

  • Added framebuffer-free retained rendering with tile-based damage tracking.
  • Overlapped rendering and DMA using two alternating RGB565 buffers.
  • Reduced repeated work with cached layouts, lookup tables, RLE checkpoints, and indexed commands.
  • Replaced SPI with an 80 MHz PIO DMA link, cutting full-frame transfer time to 15.36 ms.
  • Added flash-based background templates and stricter display-failure handling.

How it was tested

  • nix develop -c ./scripts/check.sh passes locally
  • On hardware: works faster :D
  • Host-only change (CLI / docs / CI) — no device behavior touched

Checklist

  • Device behavior / image changed → config.device_release (bcdDevice) bumped by one (hex)
    in firmware/src/main.rs — host-only (CLI / docs / CI / build) does not (CONTRIBUTING.md)
  • Fixes something a downgrade would reopen → flag whether the next release should advance the
    rollback epoch (docs/production.md, stage 3) — a seal-time --rollback call, not a code bump
  • New or changed unsafe → justified in docs/unsafe.md
  • User-visible behavior (kinda) → the matching guide under docs/ updated
  • New files carry the SPDX header (AGPL-3.0-only)
  • Commit messages use the zone prefix style (fido:, piv:, rsk:, docs:, …)

@cofob
cofob marked this pull request as draft August 29, 2026 13:18
@github-actions

Copy link
Copy Markdown

Development firmware for this pull request: https://rskey.fob.wtf/preview?pr=99

The link always opens the latest successful preview build.

@TheMaxMur
TheMaxMur marked this pull request as ready for review September 2, 2026 16:23
@TheMaxMur
TheMaxMur merged commit d9361ea into TheMaxMur:main Sep 2, 2026
40 checks passed
@cofob cofob changed the title Draft: display dma optimization Display dma optimization Sep 3, 2026
@cofob
cofob deleted the cofob/display-dma-optimization branch September 3, 2026 19:38
TheMaxMur added a commit that referenced this pull request Sep 8, 2026
Brings PR #99 (the retained framebuffer-less display compositor over a PIO DMA
link) and 27 other commits from main onto develop.

Conflicts, and how each was settled:

- firmware/src/main.rs — bcdDevice: develop's 0x09C6 wins; main's 0x0989 is
  345 builds behind it.
- scripts/check.sh — kept develop's FLASH_SIZE=16M display row (it compiles the
  geometry the shipped package actually is) and main's new stack-floor row.
- crates/rsk-display/src/tests.rs — both sides added independent recorder fields;
  kept both.
- crates/rsk-ui/src/render_tests.rs — kept main's new hold-fill damage test and
  develop's wording of the pin-dots doc comment.
- formal/RSKeyAppletSeams.tla — neither side's line span was right after the
  merge. Re-derived by content: ccid.rs:310-319 did not move, pin.rs is 704-712
  now (PR #99 shifted it and turned self.panel into self.frame()).
- formal/citations.lock — took develop's side wholesale. main's half is locked
  against pre-develop ctaphid.rs/main.rs/reset.rs/fs.rs; it is stale, not a
  competing claim. The lock gets re-derived against the merged tree separately.
- CHANGELOG.md — PR #99's entry folded into develop's [Unreleased] Changed.

Verified: the display flavor builds (LED_KIND=none FLASH_SIZE=16M, --features
display).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
TheMaxMur added a commit that referenced this pull request Sep 8, 2026
…tchets and a matrix cell

Bookkeeping the `main` merge owes, and none of it is a re-label.

The 41 drifted citations were repaired BY CONTENT, not by `--relock`. Running
--relock first is what showed why: it re-pointed `PLAT-TIMER-002` from
`hp.spawn(led::gpio_task(led).unwrap());` at `18 => gpio_pin!(p.PIN_18),` and
`PLAT-TIMER-003` from `usb_attach::mark();` at a bare `};`, silently, because a
stale line number still resolves to whatever now sits on it. The tool says so in
its own output — "re-locked, not repaired" — and it is right. So the citing pages
were renumbered from the gate's own old->new report, the gate re-run until it
reported zero drift, and only then re-locked. The lock's content columns are
byte-identical across all 1177 rows except one: `RSKeyAppletSeams`'s citation of
`pin.rs`, where PR #99 turned `self.panel` into `self.frame()`.

`SEC-SEAM-001..003` and `SEC-TRANS-001..003` x waveshare-touch-lcd were
re-decided rather than re-labelled. `display.spi_freq_hz` stopped being only a
panel knob when the PIO transport started taking `clk_sys / 2` from it, so this
column now runs the part at 160 MHz where every other runs 150. That is real and
it is recorded, but it does not reach these six: no clause in `RSKeyAppletSeams`
or `RSKeyTransport` quantifies over time, a rate or a deadline, so a core that
retires instructions faster cannot make one true or false. The cell says that,
and says what would have owed `conditional` instead.

Regenerated: assurance-matrix, assurance-vector, assurance-bounds and
platform-assumptions. Only one status-bearing change is in them —
`PLAT-TIMER-001` and `PLAT-UNSAFE-009` go fresh -> stale, TIMER-001 because the
clock moved under the evidence. Committed so that shows up in a diff, which is
the whole point of the row that demanded it.

Two ratchets the merge moved and did not carry: `SUITE_CASES` 2608 -> 2609
(main's `test_spdx_gate.py` gained a case) and `verified-compilation.md`'s row
counts 121/19 -> 123/21 (`firmware stack floor (display)` and `preview
publisher`). `reproduce.sh` also had no shape for `node --test`, so the preview
publisher row was UNCLAIMED and red; it is a gate-phase row like every other
`check.sh` command.

Co-Authored-By: Claude Opus 5 <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.

2 participants