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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for 'rolling scrolling' to HX8357D pitft driver. #15

Open
wants to merge 3 commits into
base: rpi-4.9.y
Choose a base branch
from

Conversation

wziard
Copy link

@wziard wziard commented Nov 29, 2017

When you want to scroll your display by just redrawing it all the time it is very slow (fullscreen redraws over spi are quite slow). However, the HX8357D (and others probably too) chipset supports hardware scrolling.
(horizontal wraparounf scrolling in landscape mode, or vertical in portrait)
This changeset adds a sysfs param to set the start scanline. by changing the start scanline the whole display is scrolled. You then only need to redraw the wrapped around scanlines instead of the whole screen.

Martijn Versteegh added 3 commits November 29, 2017 00:07
…n a window.

Add a sysfs param scroll_pos which sets the scanline where the display
starts for 'rolling scrolling'. This needs support from the specific
display driver as well. When supported it can be used to implement smooth
vertical (when the display is in portrait mode) hor horizontal (when the
display is used in landscape mode) scrolling by strategically changing the
start scanline of the display and erasing/redrawing only the wrapping part.
This way you never need to redraw what's already there, preventing slow
full screen redraws over spi.
Writing to registers of the device directly from the sysfs store handler
leads to race conditions with updating the screen. Just set the variable
and update the scroll pos from the next update_display call.

This means the scrolling might not actually happen until you draw something
to the screen. But as scrolling without drawing a new scanline is not very
useful anyway this is a minor annoyance.
@wziard
Copy link
Author

wziard commented May 5, 2018

It's nice to be able to have somewhat smooth scrolling, despite the slow(ish) spi connection.

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.

None yet

1 participant