Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

New diff-to-previous framebuffer implementation #129

Merged
merged 4 commits into from Nov 4, 2020

Conversation

rm-hull
Copy link
Owner

@rm-hull rm-hull commented Oct 25, 2020

Implementation status

馃煝 ST7735
馃煝 HD44780
馃煝 ILI9341

Notes

For reference bounce.py demo on ILI9341 (SPI bus speed @ 32MHz) run at approx 10 FPS on RPI B4 using the current implementation. For the new implementation, bounce.py is reporting the following FPS for the following segment size:

num_segments FPS
100 60
64 70
25 86
16 75
4 24
1 10

Obviously a segment size of 1 - this is equivalent to the current implementation, but for the others WOW! ... I didn't expect such a huge improvement. The best value for num_segments will largely depend on what the application draws on the screen, but for the bounce demo, having 25 segments appeared to be the sweet spot for maximal frame rate.

@rm-hull rm-hull changed the title New framebuffer implementation ST7739 and ILI9341 new framebuffer implementation Oct 25, 2020
@rm-hull rm-hull changed the title ST7739 and ILI9341 new framebuffer implementation New framebuffer implementation Oct 25, 2020
@rm-hull rm-hull force-pushed the feature/improved-framebuffer-performance branch from 54e9909 to e7ac573 Compare October 26, 2020 22:43
@rm-hull rm-hull force-pushed the feature/improved-framebuffer-performance branch from e7ac573 to 7cfab73 Compare October 26, 2020 22:59
@rm-hull rm-hull changed the title New framebuffer implementation New diff-to-previous framebuffer implementation Nov 2, 2020
@rm-hull rm-hull marked this pull request as ready for review November 2, 2020 18:36
Copy link
Collaborator

@thijstriemstra thijstriemstra left a comment

Choose a reason for hiding this comment

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

test coverage dropped with 3%, can you take a look at that?

self.framebuffer = getattr(luma.core.framebuffer, framebuffer)(self)
if isinstance(framebuffer, str):
import warnings
warnings.warn(
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we use the deprecated library for this instead?

Copy link
Owner Author

@rm-hull rm-hull Nov 3, 2020

Choose a reason for hiding this comment

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

Coverage should increase now to ~ 99% - there were three identical bits of duplication, but the intention is to remove all this on the next major release anyway.

deprecated only gives us the deprecated decorator, but I think this should've been a DeprecationWarning rather than a RuntimeWarning category

Copy link
Owner Author

Choose a reason for hiding this comment

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

I want to release this as 2.7.0, and then in about a months time, do a 3.0.0 release that just removes the string framebuffer handling altogether

Ditto for luma.oled.

The other display classes (luma.emulator and luma.led-matrix) should not be affected as they dont utilize the framebuffer concept at all

@rm-hull rm-hull merged commit 0e20933 into master Nov 4, 2020
@rm-hull rm-hull deleted the feature/improved-framebuffer-performance branch November 4, 2020 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants