drivers: display: elcdif: Fix RGB565/BGR565 format mismatch

Format is incorrectly forced from RGB565 to BGR565. Fix it.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
This commit is contained in:
Phi Bang Nguyen 2024-10-17 15:06:45 +02:00 committed by Chris Friedt
parent d0f7604b1a
commit d9513095d9

View File

@ -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;