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

feature: lvgl performance tuning #39

Conversation

danieldegrasse
Copy link
Contributor

Description of the feature or fix

This PR introduces several performance tuning settings for the Zephyr LVGL port:

  • Enable setting the full_refresh bit, which configures LVGL to only call display_write with a buffer equivalent in size to the display. This improves performance for display controllers that render from a framebuffer in memory significantly, since they no longer have to copy the framebuffer passed into display_write into a driver allocated framebuffer
  • Enable setting LVGL rendering buffer alignment. This is required because some display hardware has more restrictive alignment requirements on input buffers than the default value of 4 bytes.
  • Allow placing LVGL rendering buffers into a custom section. This allows applications to relocate LVGL buffers to a custom location (such as external RAM)

@danieldegrasse
Copy link
Contributor Author

@pdgendt would you be willing to take a look at this, or are you aware of anyone else who could?

Copy link
Collaborator

@pdgendt pdgendt left a comment

Choose a reason for hiding this comment

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

LGTM!

@danieldegrasse
Copy link
Contributor Author

@carlescufi it looks like you have merge/approval rights. Do you know who else could review this PR? Maybe @jfischer-no?

@pdgendt
Copy link
Collaborator

pdgendt commented May 9, 2023

@carlescufi it looks like you have merge/approval rights. Do you know who else could review this PR? Maybe @jfischer-no?

I am collaborator for LVGL, @carlescufi could you assign a role that would allow me to add reviews in this project?

Comment on lines 72 to 73
Force full refresh of display on update. Useful for displays where
framebuffer is stored in RAM

Choose a reason for hiding this comment

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

This is meaningless. I do not know of any display controller where it is not stored in RAM. I guess what you mean is that it is performance gain to write complete area at once since display controller RAM is connected to CPU or is part of SoC's RAM.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point, this could be more clear. I updated the description to be the following:

Force full refresh of display on update. When combined with
LV_Z_VDB_SIZE, this setting can improve performance for display
controllers that require a framebuffer to be present in system memory,
since the controller can render the LVGL framebuffer directly

Enable setting full_refresh bit for LVGL displays, which forces LVGL to
refresh the entire framebuffer on each call to display_write.

This is useful for display hardware that can directly render a framebuffer to
the display, as the LVGL buffer can now be passed directly to the
display hardware without expensive memory copies into an intermediate buffer.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Allow setting LVGL rendering buffer alignment. This is useful if the
rendering buffers will be passed directly as the framebuffer to display
hardware, which may have more restrictive alignment requirements.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Some applications may want to locate LVGL rendering buffers in a custom
memory location, such as tightly coupled or external memory. To
facilitate this, add a Kconfig CONFIG_LV_Z_VBD_CUSTOM_SECTION, which
when set will locate the LVGL rendering buffers in a section labelled as
".lvgl_buf". This section can then be located in a custom memory region
by the application.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
@danieldegrasse danieldegrasse force-pushed the feature/lvgl_performance_tuning branch from c89a6c0 to c41dbc7 Compare May 9, 2023 14:26
@danieldegrasse
Copy link
Contributor Author

@pdgendt I am not sure if you are now authorized to merged, but it does look like your review counts towards the criteria for merging.

@carlescufi carlescufi merged commit 7102083 into zephyrproject-rtos:zephyr May 22, 2023
2 of 6 checks passed
@danieldegrasse danieldegrasse deleted the feature/lvgl_performance_tuning branch May 22, 2023 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants