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

feat(drivers): account for the frame buffer virtual resolution deviating from the visible resolution. #5988

Merged

Conversation

pvginkel
Copy link
Contributor

The Linux frame buffer flush_cb method now accounts for the virtual resolution deviating from the visible resolution. The offset into the paint buffer is calculated based on the visible resolution, and the offset into the frame buffer is calculated using the line_length, i.e. stride. The x offset and y offset are only used to calculate the position into the frame buffer, not the position into the paint buffer.

Description of the feature or fix

On Linux devices where the virtual resolution of the frame buffer deviate from the visible resolution, the flush_cb method would fail. In such a configuration, the line_length (stride) differs from the xres of the device. The line_length was used to calculate the offset into the paint buffer, causing issues.

I've also made a change to how the xoffset and yoffset are used. I've removed usage of these parameters to calculate the offset into the paint buffer. xoffset was used, and is not anymore. yoffset wasn't used in the first place. Since these parameters are offsets of the visible resolution into the virtual resolution, they couldn't have been needed for the paint buffer. That being said, I wasn't able to test this as I'm not sure how to configure them using fbset.

I've tested this with different resolutions, and both the direct and partial rendering modes.

Notes

…sible resolution.

The Linux frame buffer flush_cb method now accounts for the virtual resolution deviating from the visible resolution. The offset into the paint buffer is calculated based on the visible resolution, and the offset into the frame buffer is calculated using the line_length, i.e. stride. The x offset and y offset are only used to calculate the position into the frame buffer, not the position into the paint buffer.
kisvegabor
kisvegabor previously approved these changes Apr 3, 2024
Copy link
Member

@kisvegabor kisvegabor left a comment

Choose a reason for hiding this comment

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

Thank you!

I've tested it and I confirm that it's working well.

@FASTSHIFT FASTSHIFT changed the title Account for the frame buffer virtual resolution deviating from the visible resolution. feat(drivers): account for the frame buffer virtual resolution deviating from the visible resolution. Apr 5, 2024
@pvginkel pvginkel marked this pull request as draft April 6, 2024 19:29
@pvginkel pvginkel marked this pull request as ready for review April 6, 2024 19:30
@pvginkel
Copy link
Contributor Author

pvginkel commented Apr 6, 2024

I forgot to set the PR to draft. I've incorporated feedback from @Johennes. @PGNetHun the PR is ready for review now.

Copy link
Member

@kisvegabor kisvegabor left a comment

Choose a reason for hiding this comment

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

Thank you, you just one minor note.

src/drivers/display/fb/lv_linux_fbdev.c Outdated Show resolved Hide resolved
Copy link
Member

@kisvegabor kisvegabor left a comment

Choose a reason for hiding this comment

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

Thank you!

@FASTSHIFT FASTSHIFT merged commit 1f37da2 into lvgl:master Apr 10, 2024
16 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.

4 participants