Repository navigation
perf(rp): pack PIO engine DMA bit-planes tightly (#4621) - #4634
Merged
Merged
Conversation
ChannelEngineRpPio used one 32-bit DMA word per bit-plane (32 bytes per data byte). It now packs each data byte into an 8*lanes-bit column of planes and streams it with 8/16/32-bit DMA transfers and a matching autopull threshold, so DMA memory equals the data size for 1, 2, 4 and 8 lanes. XTRA0 strips keep the word-per-plane layout (their zero tails break byte alignment); packing is opt-in via RpPioTxConfig::packed so the auto-parallel path is unchanged. Completion detection now waits for an autopull stall (FDEBUG.TXSTALL, cleared once the FIFO drains): a packed final transfer holds up to 8 planes, so 'FIFO empty and PC at the out instruction' could fire bits early. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: FastLED/FastLED/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4621. Part of #4601 / #4580.
What changed
ChannelEngineRpPiopacks each data byte into an8*lanes-bit column of bit-planes. Planes go MSB first, and lane 0 sits in the MSB of each plane.RpPioTxConfig::packedis opt-in (defaultfalse).clockless_rp_pio_autostill sends word-per-plane and setspacked = falseexplicitly.outatterminal_pcwithout stalling for each of them, so "FIFO empty and PC == terminal" could fire up to 7 bit times early and shorten the latch.isTerminalComplete()now clears the stickyFDEBUG.TXSTALLonce the FIFO has drained, and reports done only after the SM stalls on autopull again.Bloat (
bash bloat rp2040 --example BlinkParallel --build)The saving is in the heap-allocated DMA buffer, which the static RAM figure does not show. See the per-data-byte numbers above.
Verification
tests/platforms/arm/rp/rpcommon/channel_engine_rp_pio.cpp):00 FF AA 55->0x55AAFF00, 4 × 8-bit transfers);bash test --cpp: all pass.bash lint: clean.bash compile rp2040|rp2350 --examples Blink,BlinkParallel: pass.Code review (
/code-review medium)packeddefaulted to true, which brokeclockless_rp_pio_auto's word-per-plane stream. Fixed: it is now opt-in, and that caller sets it explicitly.Hardware
Hardware validation is deferred (maintainer decision), tracked in #4623. Two things to check on hardware: that 8/16-bit DMA writes replicate into the PIO FIFO, and the TXSTALL completion check.
🤖 Generated with Claude Code