diff --git a/boards/shields/rk043fn02h_ct/rk043fn02h_ct.overlay b/boards/shields/rk043fn02h_ct/rk043fn02h_ct.overlay index ee76848b2203..a70ca591f6a7 100644 --- a/boards/shields/rk043fn02h_ct/rk043fn02h_ct.overlay +++ b/boards/shields/rk043fn02h_ct/rk043fn02h_ct.overlay @@ -45,7 +45,7 @@ vsync-active = <0>; clock-frequency = <9210240>; }; - pixel-format = ; + pixel-format = ; data-bus-width = "16-bit"; backlight-gpios = <&nxp_parallel_lcd_connector 0 GPIO_ACTIVE_HIGH>; }; diff --git a/boards/shields/rk043fn66hs_ctg/rk043fn66hs_ctg.overlay b/boards/shields/rk043fn66hs_ctg/rk043fn66hs_ctg.overlay index 6231bd51db3a..05ee89f88547 100644 --- a/boards/shields/rk043fn66hs_ctg/rk043fn66hs_ctg.overlay +++ b/boards/shields/rk043fn66hs_ctg/rk043fn66hs_ctg.overlay @@ -46,7 +46,7 @@ vsync-active = <0>; clock-frequency = <9210240>; }; - pixel-format = ; + pixel-format = ; data-bus-width = "16-bit"; backlight-gpios = <&nxp_parallel_lcd_connector 0 GPIO_ACTIVE_HIGH>; }; diff --git a/boards/shields/rk055hdmipi4m/rk055hdmipi4m.overlay b/boards/shields/rk055hdmipi4m/rk055hdmipi4m.overlay index a7526a3353a6..5ab0360b67d7 100644 --- a/boards/shields/rk055hdmipi4m/rk055hdmipi4m.overlay +++ b/boards/shields/rk055hdmipi4m/rk055hdmipi4m.overlay @@ -58,7 +58,7 @@ */ clock-frequency = <62346240>; }; - pixel-format = ; + pixel-format = ; data-bus-width = "24-bit"; backlight-gpios = <&nxp_mipi_connector 0 GPIO_ACTIVE_HIGH>; }; diff --git a/boards/shields/rk055hdmipi4ma0/rk055hdmipi4ma0.overlay b/boards/shields/rk055hdmipi4ma0/rk055hdmipi4ma0.overlay index 6c353d09372e..15f587dbb4f3 100644 --- a/boards/shields/rk055hdmipi4ma0/rk055hdmipi4ma0.overlay +++ b/boards/shields/rk055hdmipi4ma0/rk055hdmipi4ma0.overlay @@ -58,7 +58,7 @@ */ clock-frequency = <62346240>; }; - pixel-format = ; + pixel-format = ; data-bus-width = "24-bit"; backlight-gpios = <&nxp_mipi_connector 0 GPIO_ACTIVE_HIGH>; }; diff --git a/doc/releases/migration-guide-4.2.rst b/doc/releases/migration-guide-4.2.rst index 9b844dbb1183..591aaa8beba4 100644 --- a/doc/releases/migration-guide-4.2.rst +++ b/doc/releases/migration-guide-4.2.rst @@ -631,6 +631,11 @@ Audio * The binding file for :dtcompatible:`cirrus,cs43l22` has been renamed to have a name matching the compatible string. +Display +======= + +* The RGB565 and BGR565 interchange issue has been fixed in the display sample. + Other subsystems **************** diff --git a/drivers/display/display_mcux_dcnano_lcdif.c b/drivers/display/display_mcux_dcnano_lcdif.c index 084cb11893ee..f94f09b18538 100644 --- a/drivers/display/display_mcux_dcnano_lcdif.c +++ b/drivers/display/display_mcux_dcnano_lcdif.c @@ -133,16 +133,11 @@ static void mcux_dcnano_lcdif_get_capabilities(const struct device *dev, capabilities->y_resolution = config->dpi_config.panelHeight; capabilities->x_resolution = config->dpi_config.panelWidth; - capabilities->supported_pixel_formats = - (PIXEL_FORMAT_BGR_565 | PIXEL_FORMAT_ARGB_8888); + capabilities->supported_pixel_formats = (PIXEL_FORMAT_RGB_565 | PIXEL_FORMAT_ARGB_8888); capabilities->current_orientation = DISPLAY_ORIENTATION_NORMAL; switch (data->fb_config.format) { case kLCDIF_PixelFormatRGB565: - /* Zephyr stores RGB565 as big endian, and LCDIF - * expects little endian. Use BGR565 format to resolve - * this. - */ - capabilities->current_pixel_format = PIXEL_FORMAT_BGR_565; + capabilities->current_pixel_format = PIXEL_FORMAT_RGB_565; break; #if DT_ENUM_IDX_OR(DT_NODELABEL(lcdif), version, 0) == 1 case kLCDIF_PixelFormatARGB8888: @@ -185,11 +180,7 @@ static int mcux_dcnano_lcdif_set_pixel_format(const struct device *dev, struct mcux_dcnano_lcdif_data *data = dev->data; switch (pixel_format) { - case PIXEL_FORMAT_BGR_565: - /* Zephyr stores RGB565 as big endian, and LCDIF - * expects little endian. Use BGR565 format to resolve - * this. - */ + case PIXEL_FORMAT_RGB_565: data->fb_config.format = kLCDIF_PixelFormatRGB565; data->pixel_bytes = 2; break; diff --git a/drivers/display/display_mcux_elcdif.c b/drivers/display/display_mcux_elcdif.c index bdde9f59ed90..517f36a5d88f 100644 --- a/drivers/display/display_mcux_elcdif.c +++ b/drivers/display/display_mcux_elcdif.c @@ -31,7 +31,7 @@ LOG_MODULE_REGISTER(display_mcux_elcdif, CONFIG_DISPLAY_LOG_LEVEL); K_HEAP_DEFINE(display_heap, CONFIG_MCUX_ELCDIF_FB_NUM * CONFIG_MCUX_ELCDIF_FB_SIZE + 512); static const uint32_t supported_fmts = - PIXEL_FORMAT_BGR_565 | PIXEL_FORMAT_ARGB_8888 | PIXEL_FORMAT_RGB_888; + PIXEL_FORMAT_RGB_565 | PIXEL_FORMAT_ARGB_8888 | PIXEL_FORMAT_RGB_888; struct mcux_elcdif_config { LCDIF_Type *base; @@ -152,7 +152,7 @@ static int mcux_elcdif_write(const struct device *dev, const uint16_t x, const u pxp_block.block_size = desc->buf_size; /* DMA slot sets pixel format and rotation angle */ - if (dev_data->pixel_format == PIXEL_FORMAT_BGR_565) { + if (dev_data->pixel_format == PIXEL_FORMAT_RGB_565) { pxp_dma.dma_slot = DMA_MCUX_PXP_FMT(DMA_MCUX_PXP_FMT_RGB565); } else if (dev_data->pixel_format == PIXEL_FORMAT_RGB_888) { pxp_dma.dma_slot = DMA_MCUX_PXP_FMT(DMA_MCUX_PXP_FMT_RGB888); @@ -274,7 +274,7 @@ static int mcux_elcdif_set_pixel_format(const struct device *dev, } dev_data->rgb_mode = config->rgb_mode; - if (pixel_format == PIXEL_FORMAT_BGR_565) { + if (pixel_format == PIXEL_FORMAT_RGB_565) { dev_data->rgb_mode.pixelFormat = kELCDIF_PixelFormatRGB565; } else if (pixel_format == PIXEL_FORMAT_RGB_888) { dev_data->rgb_mode.pixelFormat = kELCDIF_PixelFormatRGB888; diff --git a/samples/drivers/display/src/main.c b/samples/drivers/display/src/main.c index d7b53938f787..fbedcf319db0 100644 --- a/samples/drivers/display/src/main.c +++ b/samples/drivers/display/src/main.c @@ -119,7 +119,7 @@ static uint16_t get_rgb565_color(enum corner corner, uint8_t grey) return color; } -static void fill_buffer_rgb565(enum corner corner, uint8_t grey, uint8_t *buf, +static void fill_buffer_bgr565(enum corner corner, uint8_t grey, uint8_t *buf, size_t buf_size) { uint16_t color = get_rgb565_color(corner, grey); @@ -130,7 +130,7 @@ static void fill_buffer_rgb565(enum corner corner, uint8_t grey, uint8_t *buf, } } -static void fill_buffer_bgr565(enum corner corner, uint8_t grey, uint8_t *buf, +static void fill_buffer_rgb565(enum corner corner, uint8_t grey, uint8_t *buf, size_t buf_size) { uint16_t color = get_rgb565_color(corner, grey); diff --git a/samples/drivers/video/capture/src/main.c b/samples/drivers/video/capture/src/main.c index ce9631bc8a53..7b26e9e4b3c1 100644 --- a/samples/drivers/video/capture/src/main.c +++ b/samples/drivers/video/capture/src/main.c @@ -42,8 +42,8 @@ static inline int display_setup(const struct device *const display_dev, const ui /* Set display pixel format to match the one in use by the camera */ switch (pixfmt) { case VIDEO_PIX_FMT_RGB565: - if (capabilities.current_pixel_format != PIXEL_FORMAT_BGR_565) { - ret = display_set_pixel_format(display_dev, PIXEL_FORMAT_BGR_565); + if (capabilities.current_pixel_format != PIXEL_FORMAT_RGB_565) { + ret = display_set_pixel_format(display_dev, PIXEL_FORMAT_RGB_565); } break; case VIDEO_PIX_FMT_XRGB32: