Skip to content

Conversation

KirillYatsenko
Copy link

@KirillYatsenko KirillYatsenko commented Sep 19, 2025

Read commit messages :)


Summary by cubic

Switches the simulator to the Wayland backend and runs the LVGL benchmark demo with perf/CPU monitors enabled. Adds a fullscreen flag, vendors xdg-shell protocol files, and sets up ARMhf cross-compilation.

  • New Features

    • Enable Wayland (LV_USE_WAYLAND=1) and disable fbdev; include generated xdg-shell protocol (wayland_xdg_shell.{h,c}).
    • Run lv_demo_benchmark instead of widgets; add -F flag for fullscreen.
    • Turn on LV_USE_SYSMON and LV_USE_PERF_MONITOR; disable LVGL style/mem/object asserts to reduce overhead.
  • Migration

    • Run with -F for fullscreen if needed.
    • ARMhf cross-compile: install gcc-arm-linux-gnueabihf/g++-arm-linux-gnueabihf, then configure with -DCMAKE_TOOLCHAIN_FILE=./user_cross_compile_setup.cmake and -DCMAKE_SYSROOT=$SYSROOT.

These files can be generated like this:

```
wayland-scanner client-header $SYSROOT/usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml \
                wayland_xdg_shell.h

wayland-scanner private-code $SYSROOT/usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml \
                wayland_xdg_shell.c
```

Where SYSROOT is a path to debootstraped device's rootfs directory

Taken from LVGL Wayland Driver documentation
Required ubuntu packages are:
    - gcc-arm-linux-gnueabihf
    - g++-arm-linux-gnueabihf

To crosscompile the project:

```
cmake -DCMAKE_TOOLCHAIN_FILE=./user_cross_compile_setup.cmake
      -DCMAKE_SYSROOT=$SYSROOT -B build -S .

make -C build -j
```

Where SYSROOT is the path to debootstraped device's rootfs
Benchmark shows on average on simple screens around 30 FPS

With a lot of redrawings it can drop to even 9 FPS

Unfortunetally I couldn't find a way to enable DMA support for stm32.
It seems lvgl support IMX drawing engine through.
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 5 files

Prompt for AI agents (all 2 issues)

Understand the root cause of the following 2 issues and fix them.


<file name="src/main.c">

<violation number="1" location="src/main.c:90">
Options &#39;f&#39; and &#39;m&#39; are declared in getopt string but not handled in switch, so -f/-m are silently ignored.</violation>
</file>

<file name="user_cross_compile_setup.cmake">

<violation number="1" location="user_cross_compile_setup.cmake:12">
Setting ONLY without defining CMAKE_SYSROOT/CMAKE_FIND_ROOT_PATH can break find_library; use FIRST or define a root path.</violation>
</file>


Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.


/* Parse the command-line options. */
while ((opt = getopt (argc, argv, "b:fmW:H:BVh")) != -1) {
while ((opt = getopt (argc, argv, "b:fmW:H:BVFh")) != -1) {
Copy link

@cubic-dev-ai cubic-dev-ai bot Sep 19, 2025

Choose a reason for hiding this comment

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

Options 'f' and 'm' are declared in getopt string but not handled in switch, so -f/-m are silently ignored.

Prompt for AI agents
Address the following comment on src/main.c at line 90:

<comment>Options &#39;f&#39; and &#39;m&#39; are declared in getopt string but not handled in switch, so -f/-m are silently ignored.</comment>

<file context>
@@ -86,12 +87,15 @@ static void configure_simulator(int argc, char **argv)
 
     /* Parse the command-line options. */
-    while ((opt = getopt (argc, argv, &quot;b:fmW:H:BVh&quot;)) != -1) {
+    while ((opt = getopt (argc, argv, &quot;b:fmW:H:BVFh&quot;)) != -1) {
         switch (opt) {
         case &#39;h&#39;:
</file context>
Suggested change
while ((opt = getopt (argc, argv, "b:fmW:H:BVFh")) != -1) {
while ((opt = getopt (argc, argv, "b:W:H:BVFh")) != -1) {
Fix with Cubic

set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # Don't search for executables in sysroot
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) # Only search for libraries in sysroot
Copy link

@cubic-dev-ai cubic-dev-ai bot Sep 19, 2025

Choose a reason for hiding this comment

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

Setting ONLY without defining CMAKE_SYSROOT/CMAKE_FIND_ROOT_PATH can break find_library; use FIRST or define a root path.

Prompt for AI agents
Address the following comment on user_cross_compile_setup.cmake at line 12:

<comment>Setting ONLY without defining CMAKE_SYSROOT/CMAKE_FIND_ROOT_PATH can break find_library; use FIRST or define a root path.</comment>

<file context>
@@ -5,11 +5,13 @@
+set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++)
+
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # Don&#39;t search for executables in sysroot
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) # Only search for libraries in sysroot
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Only search for includes in sysroot
 
</file context>
Fix with Cubic

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.

1 participant