Skip to content

modules: lvgl: Remove LV_COLOR_16_SWAP option#108497

Draft
faxe1008 wants to merge 2 commits intozephyrproject-rtos:mainfrom
faxe1008:lv_color_swap16
Draft

modules: lvgl: Remove LV_COLOR_16_SWAP option#108497
faxe1008 wants to merge 2 commits intozephyrproject-rtos:mainfrom
faxe1008:lv_color_swap16

Conversation

@faxe1008
Copy link
Copy Markdown
Contributor

@faxe1008 faxe1008 commented May 5, 2026

Since Zephyr and LVGL both now properly support byte-swapped RGB565 there is not point is spraying the LV_COLOR_16_SWAP option everywhere.

Will add a migration guide entry as well.

Displays that advertise PIXEL_FORMAT_RGB_565X need LVGL to render
RGB565 pixels in byte-swapped order. Treating RGB_565X like native
RGB_565 makes non-palindromic colors decode as the wrong hue on the
panel.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
Co-authored-by: Carlo Caione <ccaione@baylibre.com>
@faxe1008 faxe1008 force-pushed the lv_color_swap16 branch from 70464ba to d18a378 Compare May 5, 2026 11:53
mdac = <0x08>;
gamma = <0x01>;
pixel-format = <PANEL_PIXEL_FORMAT_RGB_565>;
pixel-format = <PANEL_PIXEL_FORMAT_RGB_565X>;
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.

No, cause we rely on samples/drivers/display as the reference for colors and orientation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes that is correct, I fail to understand why thats an issue - shouldn't the sample just deal with the fact that the display now has this default pixel format correctly (assuming that the driver does set the display drivers registeres according to the pixel-format?)

@faxe1008
Copy link
Copy Markdown
Contributor Author

faxe1008 commented May 5, 2026

cc @carlocaione @JarmouniA
picked up the PR, went through the boards. Testing will be required.

height = <132>;
x-offset = <0>;
y-offset = <0>;
pixel-format = <PANEL_PIXEL_FORMAT_RGB_565X>;
Copy link
Copy Markdown
Contributor

@JarmouniA JarmouniA May 5, 2026

Choose a reason for hiding this comment

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

not all panel controllers have the pixel-format property

include: [mipi-dbi-spi-device.yaml, display-controller.yaml]
(includes display-controller.yaml not lcd-controller.yaml)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should have caught now the ones erroring, lets see what CI says.

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.

yeah, this is the main issue and exactly why I discarded my attempt: I didn't want to deal with all the non-compliant drivers.

@faxe1008 faxe1008 force-pushed the lv_color_swap16 branch 2 times, most recently from 1fdd251 to 36a22e5 Compare May 5, 2026 14:02
Remove usage of LV_COLOR_16_SWAP everywhere. Display drivers support a
dedicated RGB_565X format for byte swapping no need to have this additional
option.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
@faxe1008 faxe1008 force-pushed the lv_color_swap16 branch from 36a22e5 to 1a35d8a Compare May 5, 2026 14:03
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 5, 2026

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.

3 participants