send opaque BGRA on full frame updates - #8
Open
teddytennant wants to merge 1 commit into
Open
Conversation
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.
tinyturing/here is a subtree and is currently byte-identical to tinygrad/tinyturing main, so this gets reverted by the nextgit subtree pullon its own. I opened the same change upstream as tinygrad/tinyturing#1. This one fixes it for anyone on the current tree.Full-frame updates send the framebuffer straight through
.tobytes(), which on little-endian emitsA B G R. The partial path in_build_updatewritesB G R(display.py:207-209), and theDISPLAY_BITMAPlength field is0x00177000, which is 8004804, so the wire wants four bytes per pixel in BGRA. White rendered yellow, and pure red, green and blue each landed on colour byte 0 and rendered black.The framebuffer's low byte isn't usable as alpha, so this forces
0xffrather than shifting the existing byte along:_blit_alphawrites(red << 24) | (green << 16) | (blue << 8)with no alpha term, whileclear()fills0x000000ff.Checked against a recording serial stub: all eight test colours now match what
_build_updateemits for the same pixels, plus opaque alpha. No panel here, so this is verified against the protocol and the partial path, not on hardware.Closes #6.