Skip to content

V9.2.1 prepare - #6981

Merged
kisvegabor merged 41 commits into
lvgl:release/v9.2from
kisvegabor:v9.2.1-prepare
Oct 9, 2024
Merged

kisvegabor merged 41 commits into
lvgl:release/v9.2from
kisvegabor:v9.2.1-prepare

Conversation

@kisvegabor

Copy link
Copy Markdown
Member

Cherry-pick all fix commits from master.

These 2 is not added yet:

  • 559618d It might not work well
  • c0af741 There was a conflicts that I haven't resolved yet

@nicusorcitu will add more fixes before the release of v9.2.1, but I suggest merging this PR as soon as possible to have at least these commits in place.

cc @liamHowatt @XuNeo @FASTSHIFT @faxe1008

Notes

josepho0918 and others added 30 commits October 1, 2024 15:39
)

Signed-off-by: pengxiaolei <[email protected]>
Signed-off-by: pengyiqiang <[email protected]>
Co-authored-by: pengxiaolei <[email protected]>
1. fix perf monitor FPS wrong macro judgement
2. fix arc test failing with no reason
Signed-off-by: pengyiqiang <[email protected]>
Co-authored-by: pengyiqiang <[email protected]>
Signed-off-by: Nicușor Cîțu <[email protected]>
Signed-off-by: Cosmin-Daniel Radu <[email protected]>
Co-authored-by: Nicușor Cîțu <[email protected]>
@kisvegabor

Copy link
Copy Markdown
Member Author

@cederom I just comment on the issue at NuttX.

@XuNeo XuNeo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Build pass with no warnings on multiple nuttx targets.

@liamHowatt liamHowatt left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe it's time to add CI to pull requests targeting release/v9.* branches. Currently it's this:

on:
push:
branches: [ master, release/v8.* ]
pull_request:
branches: [ master, release/v8.* ]

These would not be caught by the CI but mentioning them anyways:

The VG Lite tests needs to have two images updated and I see an integer overflow message.

This ref image can be deleted: https://github.com/kisvegabor/lvgl_upstream/blob/00a8b4f7ed8c4c8de8fa2272041ba52daa4cd506/tests/ref_imgs/libs/freetype_1.lp32.png

@kisvegabor

Copy link
Copy Markdown
Member Author

@liamHowatt Good idea! I merge this one now. Could you open a new PR for the points you mentioned?

@kisvegabor
kisvegabor merged commit 7c3b20d into lvgl:release/v9.2 Oct 9, 2024
@kisvegabor
kisvegabor deleted the v9.2.1-prepare branch October 9, 2024 11:48
@kisvegabor

Copy link
Copy Markdown
Member Author

@faxe1008 Please confirm if we are good for Zephyr too.

@XuNeo

XuNeo commented Oct 9, 2024

Copy link
Copy Markdown
Collaborator

Hi @kisvegabor

When do you plan to create release of v9.2.1?

apache/nuttx-apps#2592 will need it to merge.
I tested again with latest release/v9.2, and it's good. :)

@cederom

cederom commented Oct 9, 2024

Copy link
Copy Markdown

All display related issues are now fixed on NuttX we are waiting for v9.2.1 LVG release so we can include it in NuttX 12.7.0 release, thank you everyone involved!! :-)

@faxe1008

faxe1008 commented Oct 9, 2024

Copy link
Copy Markdown
Contributor

I ran the basic tests today with 9.2.1 and did not face compilation issues. Will do some more in depth testing with PXP tomorrow.

@nicusorcitu

Copy link
Copy Markdown
Contributor

Please run the PXP tests after merging the PR #6979

@kisvegabor

Copy link
Copy Markdown
Member Author

#6979 is merged

@nicusorcitu

nicusorcitu commented Oct 10, 2024 •

Copy link
Copy Markdown
Contributor

I see a performance drop from 9.2.0 to 9.2.1.
For now I have only the results from flash - slow processing but just for comparing is fine. The only diff between the results are the patches from this PR #6981 except 577a08a and 6f3c26c that we have them locally on 9.2.0
image

@kisvegabor

kisvegabor commented Oct 11, 2024 •

Copy link
Copy Markdown
Member Author

Can you bisect which commit introduced the problem? Fortunately it's visible on the first scene to.

I'm sure yes, just asking: have you set -O3 in both cases?

@nicusorcitu

nicusorcitu commented Oct 14, 2024 •

Copy link
Copy Markdown
Contributor

@cristian-stoica can you please try it out the last 9.2 branch and do a git bisect? Thank you.

@cosmindanielradu19

Copy link
Copy Markdown
Contributor

Can you bisect which commit introduced the problem? Fortunately it's visible on the first scene to.

I'm sure yes, just asking: have you set -O3 in both cases?

Hi @kisvegabor , I've managed to find the issue. It comes from #6803.

I've done a comparison of release/9.2 branch with and without commit 53c846f, and it seems that without it, the performance is fine.

image

@nicusorcitu

Copy link
Copy Markdown
Contributor

Why do we need the recursive semaphores?

@liamHowatt

Copy link
Copy Markdown
Contributor

Let's cross off this as a potential cause of the degradation. Is it unrelated?

@nicusorcitu

Copy link
Copy Markdown
Contributor

My question is why do we need recursive locks? This change 53c846f impact the performance.

If someone takes recursively the same mutex, maybe there is a problem on that application. We need to fix the performance regression.

@kisvegabor

Copy link
Copy Markdown
Member Author

So far I couldn't reproduce the performance regression. I've tried with a Renesas board and measured the exact same performance with and without FreeRTOS. We will try with an ST board on Monday too.

We started to use recursive mutexes based on the request of @espzav (Espressif). The use case is the following: We have added lv_lock and lv_unlock. It is a generic interface to lock LVGL when LVGL functions are called from other threads. However, when the application is complex, and the user's function calls are deeply nested it can happen that lv_lock will be called multiple times. For example my_screen_load calls lv_lock and calls my_card_create too, which also locks LVGL as a card can be created at any time too. Or maybe these functions are called from an event where LVGL is already locked (lv_timer_handler automatically locks the LVGL).

It seems the recursive mutex handling is only a very thin layer around the normal mutex handling which doesn't explain why it is so much slower.

Is there anything special in your FreeRTOS or its config?

@nicusorcitu

nicusorcitu commented Oct 21, 2024 •

Copy link
Copy Markdown
Contributor

Nothing special in the FreeRTOS config.
Please remember this is happening only with the freeRTOS heap in the slower memory (SDRAM for example).
While we put everything in SRAM (internal memory) the impact can not be seen.

"Each recursive mutex require a small amount of RAM that is used to hold the recursive mutex's state. If a mutex is created using xSemaphoreCreateRecursiveMutex() then the required RAM is automatically allocated from the FreeRTOS heap."
This is what manual says about recursive mutex, but I guess it should not do anything more that does the xSemaphoreCreateMutex() if "recursiveness" is not used - e.g. the same amount of memory will be allocated for a single mutex.

@kisvegabor

Copy link
Copy Markdown
Member Author

While we put everything in SRAM (internal memory) the impact can not be seen.

How slow this RAM is? Maybe it's very slow because of caching? E g. even when a byte is changed the whole cache line is read and written.

In freeRTOS it seems it's only about incrementing and decrementing a single int to keep track of the nested gives and takes.

(Although freeRTOS is in internal RAM we haven't seen any changes on ST either)

@XuNeo

XuNeo commented Oct 22, 2024

Copy link
Copy Markdown
Collaborator

Hi @kisvegabor
Would you consider release v9.2.1 and fix the performance issue in next patch version update?

@nicusorcitu

Copy link
Copy Markdown
Contributor

@kisvegabor I would remove the commit 53c846f from 9.2.1 as this is also a new feature - not a bugfix. Next we have to figure out on master branch why the recursive lock introduce this performance drop.

kisvegabor added a commit that referenced this pull request Oct 23, 2024
It causes performance issues in some cases
See #6981 (comment)

This reverts commit 53c846f.
@kisvegabor

Copy link
Copy Markdown
Member Author

It's hard to decide which option is better, but finally I reverted it here. Let's investigate the performance issue in master.

Please do a final test. If all looks good, I'll release v9.2.1 tomorrow.

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.