Skip to content

sdl: Fix plugin build and remove broken damage tracking - #23

Merged
bettio merged 3 commits into
atomvm:mainfrom
bettio:sdl-fixes
Oct 3, 2026
Merged

bettio merged 3 commits into
atomvm:mainfrom
bettio:sdl-fixes

Conversation

@bettio

@bettio bettio commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

The SDL display plugin no longer compiled on main and carried a display
list comparison whose result was discarded. This series makes it build
again and removes that code:

  • ufont_manager_register() takes an owned buffer since the font
    unloading change, so register_font did not compile. The font was also
    parsed straight from the message binary, which is destroyed once the
    call is answered. Copy the binary and hand it over, as the ESP32
    display task does.
  • subscribe_input read element 2 of its arity-2 tuple.
  • The comparison between the previous and the new display list had
    several bugs: an out-of-bounds read when the new list is longer, the
    wrong union member compared for scaled images, removed and moved items
    never damaged, and a damage rectangle that shrank when merged or
    clipped. A workaround forced a full redraw anyway, so its only effect
    left was to skip an update whose list looked unchanged, which the bugs
    made unreliable. Remove it and always redraw the whole screen.

Partial updates come back with a damage tracking module shared by all
drivers, in a separate series.

See also: #20

bettio added 3 commits October 2, 2026 12:12
ufont_manager_register() takes an owned buffer since 6c0e995, so the
plugin did not compile. The font was also parsed from the message
binary, which is freed once the call is answered.

Signed-off-by: Davide Bettio <davide@uninstall.it>
The driver read element 2 of the arity-2 {subscribe_input, Sources}
tuple, one past its end.

Signed-off-by: Davide Bettio <davide@uninstall.it>
The comparison between the previous and the new display list had
several bugs, and a workaround forced a full redraw anyway. Its only
effect left was to skip an update whose list looked unchanged, which
the bugs made unreliable. Remove it and always redraw; a damage
tracking module shared by all drivers follows in a separate series.

See also: atomvm#20

Signed-off-by: Davide Bettio <davide@uninstall.it>
@bettio
bettio merged commit df47163 into atomvm:main Oct 3, 2026
4 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.

1 participant