Skip to content

Commit d951309

Browse files
ngphibangcfriedt
authored andcommitted
drivers: display: elcdif: Fix RGB565/BGR565 format mismatch
Format is incorrectly forced from RGB565 to BGR565. Fix it. Signed-off-by: Phi Bang Nguyen <[email protected]>
1 parent d0f7604 commit d951309

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/display/display_mcux_elcdif.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ LOG_MODULE_REGISTER(display_mcux_elcdif, CONFIG_DISPLAY_LOG_LEVEL);
3131
K_HEAP_DEFINE(display_heap, CONFIG_MCUX_ELCDIF_FB_NUM * CONFIG_MCUX_ELCDIF_FB_SIZE + 512);
3232

3333
static const uint32_t supported_fmts =
34-
PIXEL_FORMAT_BGR_565 | PIXEL_FORMAT_ARGB_8888 | PIXEL_FORMAT_RGB_888;
34+
PIXEL_FORMAT_RGB_565 | PIXEL_FORMAT_ARGB_8888 | PIXEL_FORMAT_RGB_888;
3535

3636
struct mcux_elcdif_config {
3737
LCDIF_Type *base;
@@ -152,7 +152,7 @@ static int mcux_elcdif_write(const struct device *dev, const uint16_t x, const u
152152
pxp_block.block_size = desc->buf_size;
153153

154154
/* DMA slot sets pixel format and rotation angle */
155-
if (dev_data->pixel_format == PIXEL_FORMAT_BGR_565) {
155+
if (dev_data->pixel_format == PIXEL_FORMAT_RGB_565) {
156156
pxp_dma.dma_slot = DMA_MCUX_PXP_FMT(DMA_MCUX_PXP_FMT_RGB565);
157157
} else if (dev_data->pixel_format == PIXEL_FORMAT_RGB_888) {
158158
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,
274274
}
275275

276276
dev_data->rgb_mode = config->rgb_mode;
277-
if (pixel_format == PIXEL_FORMAT_BGR_565) {
277+
if (pixel_format == PIXEL_FORMAT_RGB_565) {
278278
dev_data->rgb_mode.pixelFormat = kELCDIF_PixelFormatRGB565;
279279
} else if (pixel_format == PIXEL_FORMAT_RGB_888) {
280280
dev_data->rgb_mode.pixelFormat = kELCDIF_PixelFormatRGB888;

0 commit comments

Comments
 (0)