I use mxrt-1062-based board. Application based on zephyr-rtos, also LVGL library used to create GUI.
My device has 1024 x 768 LCD-module placed in portrait mode so that (0;0) is at the bottom. So LVGL configured as 768 x 1024, and to get the elcdif-buffer I should rotate data from image-buffer 270 degrees.
I tried to use PXP with following configuration
const pxp_ps_buffer_config_t psBufferConfig = {
.pixelFormat = kPXP_PsPixelFormatRGB565,
.swapByte = false,
.bufferAddr = (uint32_t)pxp_buf,
.bufferAddrU = 0U,
.bufferAddrV = 0U,
.pitchBytes = ELCDIF_PANEL_RGB_HEIGHT * 2,
};
PXP_SetProcessSurfaceBackGroundColor(PXP, 0x000000U);
PXP_SetProcessSurfaceBufferConfig(PXP, &psBufferConfig);
PXP_SetProcessSurfacePosition( PXP, 0,
0,
ELCDIF_PANEL_RGB_WIDTH - 1,
ELCDIF_PANEL_RGB_HEIGHT - 1);
static pxp_output_buffer_config_t outputBufferConfig;
outputBufferConfig.pixelFormat = kPXP_OutputPixelFormatRGB565;
outputBufferConfig.interlacedMode = kPXP_OutputProgressive;
outputBufferConfig.buffer0Addr = (uint32_t)data->fb[write_idx].data;
outputBufferConfig.buffer1Addr = 0U;
outputBufferConfig.pitchBytes = ELCDIF_PANEL_RGB_WIDTH* 2;
outputBufferConfig.width = ELCDIF_PANEL_RGB_WIDTH;
outputBufferConfig.height = ELCDIF_PANEL_RGB_HEIGHT;
PXP_SetOutputBufferConfig(PXP, &outputBufferConfig);
PXP_EnableCsc1(PXP, false);
PXP_SetRotateConfig(PXP, kPXP_RotateProcessSurface, kPXP_Rotate270, kPXP_FlipDisable);
PXP_Start(PXP);
while (!(kPXP_CompleteFlag & PXP_GetStatusFlags(PXP))) {
}
PXP_ClearStatusFlags(PXP, kPXP_CompleteFlag);
ELCDIF_SetNextBufferAddr(config->base, uint32_t) data->fb[write_idx].data);
where: pxp_buf is lvgl-image buffer 768 x 1024, data->fb[write_idx].data - is buffer for elcdif (before new itteration contains the previous itteration data).
This code works but when I change image (full or partially) I see artifacts on the screen (some pixels, lines).
This is frist screen
after switch to second screen I see pixel lines at the bottom of the screen which should not be.
If I switch back to first screen
I also see pixel lines at the bottom.
It seems like data after rotation partially mixes in this zone with previous image data which were in output buffer before rotaiton.
I can't understand where I made a mistake.
Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Adding the code line :
/* Disable AS. */
PXP_SetAlphaSurfacePosition(DEMO_PXP, 0xFFFFU, 0xFFFFU, 0U, 0U);
after the function code :
PXP_SetProcessSurfacePosition( PXP, 0,
0,
ELCDIF_PANEL_RGB_WIDTH - 1,
ELCDIF_PANEL_RGB_HEIGHT - 1);
Then, give it a try again.
Hope it helps.
Have a great day.
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Is it possible that PXP mixes rotated image from PS buffer with the image already in the buffer ?