Skip to content

picogame: send display strips through busio's async write - #11684

Merged
tannewt merged 3 commits into
adafruit:mainfrom
MakerClassCZ:picogame-async-display
Oct 28, 2026
Merged

tannewt merged 3 commits into
adafruit:mainfrom
MakerClassCZ:picogame-async-display

Conversation

@lynt-smitka

Copy link
Copy Markdown

picogame's fast display had its own DMA strip sender in each port. busio.SPI now has write_start()/end() (#11468, #11489), so the shared shared-module/picogame/Display.c sends each strip through the display bus (send_async, or send on a bus without it) and the port-specific senders are removed.

  • Display works on any displayio bus; Display.async_send says whether the bus overlaps composing and sending.
  • CIRCUITPY_PICOGAME_FAST_DISPLAY defaults to CIRCUITPY_BUSIO_SPI_ASYNC on a picogame build, so boards no longer set it. A port gets the fast display when its busio sends asynchronously.

Tested on PicoPad (RP2040), PyBadge (SAMD51) and Feather ESP32-S3 TFT: same frame rates as before, async_send is True on all three.

Fruit Jam now builds the fast display too (+936 bytes, unused on DVI); a board can set CIRCUITPY_PICOGAME_FAST_DISPLAY = 0 to leave it out.

On a port with async busio SPI the display backend is shared code: each strip after the
first goes out with common_hal_busio_spi_write_start(), which ends the previous one, and
end_transaction() waits for the last. The raspberrypi, espressif and atmel-samd DMA
backends are gone; their common-hal/picogame/Display.h includes the shared one.
Display sends its strips through the display bus (send_async where the bus has it, send
otherwise) instead of reaching into FourWire for the SPI object, so it works on any displayio
bus and raises nothing on one without an asynchronous send. Display.async_send tells whether
the bus overlaps composing and sending.

CIRCUITPY_PICOGAME_FAST_DISPLAY now defaults to CIRCUITPY_BUSIO_SPI_ASYNC on a picogame
build, so boards no longer declare it and a port gets the fast display when its busio sends
asynchronously. The per-port picogame/Display.h forwarders go.

@tannewt tannewt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice! Love to see it portable. One question on the API addition. Good otherwise.

Comment thread shared-bindings/picogame/Display.c Outdated
Only the hardware tests read it.

@tannewt tannewt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@tannewt
tannewt merged commit 671fe82 into adafruit:main Oct 28, 2026
28 checks passed
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