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

fix(benchmark): use the correct subject for performance data #6237

Merged
merged 2 commits into from
May 27, 2024

Conversation

kisvegabor
Copy link
Member

Description of the feature or fix

Now each display has it's own subject.

Notes

Copy link
Contributor

@zjanosy zjanosy left a comment

Choose a reason for hiding this comment

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

Fixed.

PGNetHun
PGNetHun previously approved these changes May 19, 2024
Copy link
Collaborator

@liamHowatt liamHowatt left a comment

Choose a reason for hiding this comment

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

Update users of lv_global_t::sysmon_perf

diff --git a/demos/benchmark/lv_demo_benchmark.c b/demos/benchmark/lv_demo_benchmark.c
index 884378656..cd5b4bb12 100644
--- a/demos/benchmark/lv_demo_benchmark.c
+++ b/demos/benchmark/lv_demo_benchmark.c
@@ -418,8 +418,6 @@ static scene_dsc_t scenes[] = {
     {.name = "", .create_cb = NULL}
 };
 
-#define sysmon_perf LV_GLOBAL_DEFAULT()->sysmon_perf
-
 static uint32_t scene_act;
 static uint32_t rnd_act;
 
diff --git a/demos/music/lv_demo_music.c b/demos/music/lv_demo_music.c
index ab5ba6211..2f839d393 100644
--- a/demos/music/lv_demo_music.c
+++ b/demos/music/lv_demo_music.c
@@ -13,6 +13,9 @@
 #include "lv_demo_music_main.h"
 #include "lv_demo_music_list.h"
 #include "../../src/core/lv_global.h"
+#if LV_DEMO_MUSIC_AUTO_PLAY && LV_USE_PERF_MONITOR
+    #include "../../src/display/lv_display_private.h"
+#endif
 
 /*********************
  *      DEFINES
@@ -104,10 +107,6 @@ static const uint32_t time_list[] = {
     2 * 60 + 19,
 };
 
-#if LV_USE_PERF_MONITOR || LV_DEMO_MUSIC_AUTO_PLAY
-    #define sysmon_perf LV_GLOBAL_DEFAULT()->sysmon_perf
-#endif
-
 /**********************
  *      MACROS
  **********************/
@@ -230,7 +229,8 @@ static void auto_step_cb(lv_timer_t * t)
                 lv_obj_t * num = lv_label_create(bg);
                 lv_obj_set_style_text_font(num, font_large, 0);
 #if LV_USE_PERF_MONITOR
-                const lv_sysmon_perf_info_t * info = lv_subject_get_pointer(&sysmon_perf.subject);
+                lv_display_t * disp = lv_display_get_default();
+                const lv_sysmon_perf_info_t * info = lv_subject_get_pointer(&disp->perf_sysmon_backend.subject);
                 lv_label_set_text_fmt(num, "%" LV_PRIu32, info->calculated.fps_avg_total);
 #endif
                 lv_obj_align(num, LV_ALIGN_TOP_MID, 0, 120);

@kisvegabor
Copy link
Member Author

kisvegabor commented May 24, 2024

Great catch! Updated.

@kisvegabor kisvegabor merged commit 7a13d56 into lvgl:master May 27, 2024
17 checks passed
@kisvegabor kisvegabor deleted the fix/benchmark3 branch May 27, 2024 04:46
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

5 participants