-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update ST7789 to support writing to larger SPIDEV buffer #420
Conversation
…idev buffer sizes
Note: if the spidev buffer size is not increased. This code change will not cause any issues/conflicts. |
Tested ACK! On my faster Pi Zero 1.3 running a manual install (therefore Raspi OS):
Also seeing modest QR decoder framerate improvements: 4.8fps increased to 5.3fps. |
Tested in my local SeedSigner OS build w/cmdline.txt change applied:
And this is on my slightly slower Pi Zero (vs the above Raspi OS results)! |
I recommend we set the I tested different
Presumably we get the same duplication issue fooling the fps metric until So I wouldn't trust the metrics for the current value of And then at higher framerates we see negative diminishing returns as presumably we pay a resource penalty for generating more frames than the display or QR decoder can consume. Therefore YMMV. Likely/definitely different optimal results for a Pi Zero 2W. |
ACK tested as of 32eda52 Manual Instructions were easy to follow, worked perfectly. Wow what a difference! |
This PR provides a modest performance increase when an operation requires rendering an updated image to the waveshare LCD. Data is transferred to the LCD using spidev (user space interface) using python. This PR does not make any significant changes to this process.
The performance gain on this PR is done by writing out the data via a larger buffer and removing the previously required loop of write operations. Prior to this PR, the
ShowImage
method draws the entire LCD display via 29 4096 byte operations. By increasing the buffer size the entire display can be refreshed in a single operation instead of 29. The spidev kernel module supports increasing the buffer size default from 4096 via cmdline.txt. This increase is required to write out the bytes in a single operation. SeedSigner currently uses 115200 bytes (240 * 240 * 2, 240x240@16bit color). So this PR only shows performance gains after the spidev buffer has been increased.writebytes2
accepts arbitrary large lists. If list size exceeds the buffer size (which is read from /sys/module/spidev/parameters/bufsiz), data will be split into smaller chunks and sent in multiple operations. I will also be submitting at PR to increase the buffer size to 128k in SeedSignerOS. SeedSignerOS PR 55 makes this change.To Do: