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

LV_COLOR_SWAP_16 has incorrect dependencies across Zephyr #81546

Closed
danieldegrasse opened this issue Nov 18, 2024 · 0 comments · Fixed by #81547
Closed

LV_COLOR_SWAP_16 has incorrect dependencies across Zephyr #81546

danieldegrasse opened this issue Nov 18, 2024 · 0 comments · Fixed by #81547
Assignees
Labels
area: LVGL Light and Versatile Graphics Library Support bug The issue is a bug, or the PR is fixing a bug

Comments

@danieldegrasse
Copy link
Collaborator

danieldegrasse commented Nov 18, 2024

Describe the bug
The KConfig LV_COLOR_SWAP_16 is defined to depend on LV_COLOR_DEPTH_16 within LVGL itself: https://github.com/zephyrproject-rtos/lvgl/blob/a76caad0aa99838bb7a3315aaaf07e50d595c284/Kconfig#L40

However, many shields or boards in Zephyr simply enable this setting if LVGL is enabled, since they assume LVGL will be built with LV_COLOR_DEPTH_16 when targeting that shield/board. For example, see here:

This assumption is broken if a sample or user manually selects the LVGL color depth setting, such as in the transparency sample:

This results in a build error, since LV_COLOR_DEPTH_16 should not logically be enabled.

Please also mention any information which could help others to understand
the problem you're facing:

  • What target platform are you using? m5stack_atoms3/esp32s3/procpu

To Reproduce
Steps to reproduce the behavior:

  1. west build -p -b m5stack_atoms3/esp32s3/procpu samples/modules/lvgl/screen_transparency -T sample.modules.lvgl.screen_transparency

Expected behavior

Setting the choice Kconfig LV_COLOR_DEPTH should be possible without inducing a build error.

Impact
Blocking CI on #81293

Logs and console output

n.c.obj -c /home/danieldegrasse/zephyr/zephyrproject/zephyr/samples/modules/lvgl/screen_transparency/src/main.c
In file included from /home/danieldegrasse/zephyr/zephyrproject/modules/lib/gui/lvgl/src/../src/hal/../draw/../misc/lv_style.h:19,
                 from /home/danieldegrasse/zephyr/zephyrproject/modules/lib/gui/lvgl/src/../src/hal/../draw/lv_draw.h:18,
                 from /home/danieldegrasse/zephyr/zephyrproject/modules/lib/gui/lvgl/src/../src/hal/lv_hal_disp.h:21,
                 from /home/danieldegrasse/zephyr/zephyrproject/modules/lib/gui/lvgl/src/../src/hal/lv_hal.h:16,
                 from /home/danieldegrasse/zephyr/zephyrproject/modules/lib/gui/lvgl/src/../lvgl.h:33,
                 from /home/danieldegrasse/zephyr/zephyrproject/modules/lib/gui/lvgl/src/lvgl.h:17,
                 from /home/danieldegrasse/zephyr/zephyrproject/zephyr/samples/modules/lvgl/screen_transparency/src/main.c:11:
/home/danieldegrasse/zephyr/zephyrproject/modules/lib/gui/lvgl/src/../src/hal/../draw/../misc/lv_color.h:27:2: error: #error "LV_COLOR_16_SWAP requires LV_COLOR_DEPTH == 16. Set it in lv_conf.h"
   27 | #error "LV_COLOR_16_SWAP requires LV_COLOR_DEPTH == 16. Set it in lv_conf.h"
      |  ^~~~~
[30/433] Building C object zephyr/CMakeFiles/zephyr.dir/lib/utils/rb.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/danieldegrasse/zephyr/zephyrproject/zephyr/build

Environment (please complete the following information):

  • OS: Ubuntu 22.04 LTS
  • Toolchain Zephyr SDK 0.17.0-rc1
  • Commit SHA or Version used 4789820 (main)
@danieldegrasse danieldegrasse added the bug The issue is a bug, or the PR is fixing a bug label Nov 18, 2024
danieldegrasse added a commit to nxp-upstream/zephyr that referenced this issue Nov 18, 2024
Since Kconfig symbol dependencies are OR'ed together between each
declaration, we must keep the same LV_COLOR_DEPTH_16 dependency that
exists on the LV_COLOR_SWAP_16 Kconfig when it is declared within the
LVGL module- otherwise a user manually selecting LV_COLOR_DEPTH will
encounter build errors

Fixes zephyrproject-rtos#81546

Signed-off-by: Daniel DeGrasse <[email protected]>
@henrikbrixandersen henrikbrixandersen added the area: LVGL Light and Versatile Graphics Library Support label Nov 19, 2024
danieldegrasse added a commit to nxp-upstream/zephyr that referenced this issue Nov 19, 2024
Use configdefault when enabling LV_COLOR_SWAP_16 within boards and
shield definitions, to avoid OR'ing the dependencies for the Kconfig
symbol. Otherwise, a user manually selecting LV_COLOR_DEPTH will
encounter build errors as LV_COLOR_SWAP_16 may be enabled when
LV_COLOR_DEPTH_16 is not selected

Fixes zephyrproject-rtos#81546

Signed-off-by: Daniel DeGrasse <[email protected]>
aescolar pushed a commit that referenced this issue Nov 21, 2024
Use configdefault when enabling LV_COLOR_SWAP_16 within boards and
shield definitions, to avoid OR'ing the dependencies for the Kconfig
symbol. Otherwise, a user manually selecting LV_COLOR_DEPTH will
encounter build errors as LV_COLOR_SWAP_16 may be enabled when
LV_COLOR_DEPTH_16 is not selected

Fixes #81546

Signed-off-by: Daniel DeGrasse <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: LVGL Light and Versatile Graphics Library Support bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants