2416504_zh-CN

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2416504_zh-CN

2416504_zh-CN

基于i.MXRT1052的pxp屏幕旋转问题

我正在使用rt1052的pxp将横屏旋转成竖屏显示,但是在不断刷新的情况下,整体显示会向下偏移,这是为什么?

6c748ddab78cfa48c73261b73c48d335.jpg

86894d601e3681f3125f4b431dd8ea77.jpg

10b9f2639f1f4168404de7e021d1486b.jpg

 

static void DEMO_FlushDisplay(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p)
{

lv_area_t dest_area =
{
.x1 = 0,
.x2 = 480 - 1,
.y1 = 0,
.y2 = 800 - 1,
};

lv_gpu_nxp_pxp_blit(((lv_color_t *)s_inactiveFrameBuffer), area, 800, color_p, area,480, LV_OPA_COVER, LV_DISP_ROT_270);

DCACHE_CleanInvalidateByRange((uint32_t)color_p, DEMO_FB_SIZE);

ELCDIF_SetNextBufferAddr(LCDIF, (uint32_t)s_inactiveFrameBuffer);

s_framePending = true;if (xSemaphoreTake(s_frameSema, portMAX_DELAY) == pdTRUE)
{
/* IMPORTANT!!!
* Inform the graphics library that you are ready with the flushing*/
lv_disp_flush_ready(disp_drv);
}
else
{
PRINTF("Display flush failed\r\n");
assert(0);
}

}

 

i.MXRT 105x回复: 基于i.MXRT1052的pxp屏幕旋转问题我发现当我使用pxp绘制的时候就会出现偏移问题,是因为guiguider生成的默认初始化#define LV_USE_GPU_NXP_PXP_AUTO_INIT 1不能直接使用吗?

void lv_disp_drv_init(lv_disp_drv_t * driver)
{
lv_memset_00(driver, sizeof(lv_disp_drv_t));

driver->hor_res = 320;
driver->ver_res = 240;
driver->physical_hor_res = -1;
driver->physical_ver_res = -1;
driver->offset_x = 0;
driver->offset_y = 0;
driver->antialiasing = LV_COLOR_DEPTH > 8 ? 1 : 0;
driver->screen_transp = 0;
driver->dpi = LV_DPI_DEF;
driver->color_chroma_key = LV_COLOR_CHROMA_KEY;

#if LV_USE_GPU_NXP_PXP
// driver->draw_ctx_init = lv_draw_pxp_ctx_init;
// driver->draw_ctx_deinit = lv_draw_pxp_ctx_deinit;
// driver->draw_ctx_size = sizeof(lv_draw_pxp_ctx_t);
driver->draw_ctx_init = lv_draw_sw_init_ctx;
driver->draw_ctx_deinit = lv_draw_sw_init_ctx;
driver->draw_ctx_size = sizeof(lv_draw_sw_ctx_t);


#else
driver->draw_ctx_init = lv_draw_sw_init_ctx;
driver->draw_ctx_deinit = lv_draw_sw_init_ctx;
driver->draw_ctx_size = sizeof(lv_draw_sw_ctx_t);
#endif

}
回复: 基于i.MXRT1052的pxp屏幕旋转问题

嗨@dsd ,

LV_USE_GPU_NXP_PXP_AUTO_INIT 允许 LVGL 利用 PXP 进行内部控件渲染,当应用程序还并行使用此 PXP 进行全屏旋转时,这肯定会导致问题。然而,这可能并非问题的根源。

从初始代码来看,你似乎没有使用 dest_area,或者说你将 area 同时用作 PXP blit 的源和目标,这意味着只有部分脏区域可能会被放置在不同的绝对位置,而不是预期的位置。


回复: 基于i.MXRT1052的pxp屏幕旋转问题我用guiguider生成的代码去测试,即便我不使用pxp旋转
static void DEMO_FlushDisplay(lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p)
{
DCACHE_CleanInvalidateByRange((uint32_t)color_p, DEMO_FB_SIZE);

ELCDIF_SetNextBufferAddr(LCDIF, (uint32_t)color_p);

s_framePending = true;

if (xSemaphoreTake(s_frameSema, portMAX_DELAY) == pdTRUE)
{
/* IMPORTANT!!!
* Inform the graphics library that you are ready with the flushing*/
lv_disp_flush_ready(disp_drv);
}
else
{
PRINTF("Display flush failed\r\n");
assert(0);
}
}
仅仅去修改宏/*Use NXP's PXP GPU iMX RTxxx platforms*/
#define LV_USE_GPU_NXP_PXP 1
#if LV_USE_GPU_NXP_PXP
/*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c)
* and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol SDK_OS_FREE_RTOS
* has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected.
*0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init()
*/
#define LV_USE_GPU_NXP_PXP_AUTO_INIT 1
#endif /* LV_USE_GPU_NXP_PXP */
也会有同样的问题,并且偏移的方向与旋转后的一致
回复: 基于i.MXRT1052的pxp屏幕旋转问题

更奇怪的是在同一个工程下会有两种不同的结果,我认为配置应该是相同的


没有发生显示偏移

aa54bb55bcbe69edeb3ed99d2d5b34f6.jpg

发生显示偏移

48bd7586b0015a50b87d64e4ffe42438.jpg

 

 

Tags (1)
No ratings
Version history
Last update:
3 hours ago
Updated by: