Skip to content

Review fixes for "Remove fixed display limit" - #28

Merged
tannewt merged 9 commits into
tannewt:infinite_displaysfrom
adafruit:dhalbert-11963-review-fixes
Dec 4, 2026
Merged

tannewt merged 9 commits into
tannewt:infinite_displaysfrom
adafruit:dhalbert-11963-review-fixes

Conversation

@dhalbert

@dhalbert dhalbert commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Claude wrote this.

These are the suggestions from this review of adafruit#11963, applied as posted, one commit per lettered item. C, D, H and I are not included.

  • A. BusDisplay and EPaperDisplay raise when given a deinited bus, and FramebufferDisplay raises when given a deinited framebuffer.
  • B. FourWire's deinit() clears its pointers to the D/C, CS and reset objects it frees. release_sequences() clears the sequence pointers.
  • E and J.
    • The LVGL EPaperDisplay constructor allocates its buffers before creating the LVGL display, so a failed allocation no longer marks the display deinited and the finaliser releases the busy pin and sequences.
    • EPaperDisplay now sets LVGL driver data, as the other displays do.
    • A zephyr Display deletes the default LVGL display only if it has no driver data, which is true only for the one Zephyr's LVGL glue creates at boot.
  • F. The picodvi framebuffer protocol has is_deinited.
  • G. RGBMatrix tracks deinit with its own deinited flag instead of Protomatter's rgbPins.
  • K. Updated the stale comment about the one-Display limit in zephyr_display/Display.c.
  • L. Added a CIRCUITPY-CHANGE marker to the py/gc.c assert.
  • M. supervisor.runtime.display documents that only it shows the terminal.

The zephyr-cp display tests pass on native_sim, including the ASAN builds. Metro ESP32-P4 and Fruit Jam build.

dhalbert and others added 8 commits December 4, 2026 13:57
BusDisplay and EPaperDisplay did not check for a deinited bus, and
FramebufferDisplay treated a deinited framebuffer as an unregistered one.
Constructing a BusDisplay on a deinited FourWire crashed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FourWire's deinit() frees the D/C, CS and reset objects it owns but left
pointers to them. Releasing EPaperDisplay sequences freed their storage
but left the sequence pointers set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed LVGL buffer allocation in the EPaperDisplay constructor marked
the display deinited, so the finaliser skipped releasing its busy pin and
sequences. Allocate the buffers before creating the LVGL display, so the
failure path has nothing LVGL-related to undo.

Creating a zephyr Display deleted LVGL's default display, which can now
be another CircuitPython display. Delete it only if it is the display
Zephyr's LVGL glue made at boot: every CircuitPython display sets driver
data, and EPaperDisplay now does too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without it, the board framebuffer is treated as deinited, so it never gets
on_vm_start and its audio sample is not GC-rooted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed constructor leaked its pins, timer and framebuffer: the
deinited check looked at Protomatter's rgbPins, which is not set yet, so
deinit() returned early. Use a deinited flag, as FourWire and ParallelBus
do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LVGL now drives several displays. Only one zephyr_display.Display can
exist because there is only one zephyr,display device.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@tannewt tannewt left a comment

Copy link
Copy Markdown
Owner

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 7b8f6d4 into tannewt:infinite_displays Dec 4, 2026
1 check passed
@tannewt
tannewt deleted the dhalbert-11963-review-fixes branch December 4, 2026 19:19
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