From 0f5cda602b758074a9be05de51c07d67c0c8bacf Mon Sep 17 00:00:00 2001 From: cristian-stoica Date: Wed, 22 May 2024 15:15:14 +0300 Subject: [PATCH] fix(vglite): build issues (#6245) Signed-off-by: Ana Grad Co-authored-by: Ana Grad --- src/draw/nxp/pxp/lv_draw_buf_pxp.c | 4 ++-- src/draw/nxp/pxp/lv_draw_pxp.c | 3 +++ src/draw/nxp/vglite/lv_draw_buf_vglite.c | 6 +++--- src/draw/nxp/vglite/lv_draw_vglite_img.c | 6 ++++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/draw/nxp/pxp/lv_draw_buf_pxp.c b/src/draw/nxp/pxp/lv_draw_buf_pxp.c index 12b37de95..d3f99f8b0 100644 --- a/src/draw/nxp/pxp/lv_draw_buf_pxp.c +++ b/src/draw/nxp/pxp/lv_draw_buf_pxp.c @@ -68,7 +68,7 @@ static void _invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * uint16_t size = stride * lv_area_get_height(area); /* Invalidate full buffer. */ - DCACHE_CleanInvalidateByRange((uint32_t)draw_buf->data, size); + DEMO_CleanInvalidateCacheByAddr((void *)draw_buf->data, size); return; } @@ -103,7 +103,7 @@ static void _invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * for(uint16_t y = 0; y < area_height; y++) { const void * line_addr = buf_u8 + y * stride; - DCACHE_CleanInvalidateByRange((uint32_t)line_addr, line_size); + DEMO_CleanInvalidateCacheByAddr((void *)line_addr, line_size); } } diff --git a/src/draw/nxp/pxp/lv_draw_pxp.c b/src/draw/nxp/pxp/lv_draw_pxp.c index b8fd14cd8..521c6d508 100644 --- a/src/draw/nxp/pxp/lv_draw_pxp.c +++ b/src/draw/nxp/pxp/lv_draw_pxp.c @@ -284,6 +284,9 @@ static int32_t _pxp_evaluate(lv_draw_unit_t * u, lv_draw_task_t * t) lv_draw_image_dsc_t * draw_dsc = (lv_draw_image_dsc_t *) t->draw_dsc; const lv_image_dsc_t * img_dsc = draw_dsc->src; + if(draw_dsc->tile) + return 0; + if((!_pxp_src_cf_supported(img_dsc->header.cf)) || (!pxp_buf_aligned(img_dsc->data, img_dsc->header.stride))) return 0; diff --git a/src/draw/nxp/vglite/lv_draw_buf_vglite.c b/src/draw/nxp/vglite/lv_draw_buf_vglite.c index dafb0156b..1b93f8279 100644 --- a/src/draw/nxp/vglite/lv_draw_buf_vglite.c +++ b/src/draw/nxp/vglite/lv_draw_buf_vglite.c @@ -37,7 +37,7 @@ static void * _buf_malloc(size_t size_bytes, lv_color_format_t cf); static void * _buf_align(void * buf, lv_color_format_t cf); -static void _invalidate_cache(const void * buf, uint32_t stride, lv_color_format_t cf, const lv_area_t * area); +static void _invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area); static uint32_t _width_to_stride(uint32_t w, lv_color_format_t cf); @@ -100,11 +100,11 @@ static void _invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * uint16_t size = stride * lv_area_get_height(area); /* Invalidate full buffer. */ - DEMO_CleanInvalidateCacheByAddr((void *)buf, size); + DEMO_CleanInvalidateCacheByAddr((void *)draw_buf->data, size); return; } - const uint8_t * buf_u8 = buf; + const uint8_t * buf_u8 = draw_buf->data; /* ARM require a 32 byte aligned address. */ uint8_t align_bytes = 32; uint8_t bits_per_pixel = lv_color_format_get_bpp(cf); diff --git a/src/draw/nxp/vglite/lv_draw_vglite_img.c b/src/draw/nxp/vglite/lv_draw_vglite_img.c index b7ee0560c..456372d3a 100644 --- a/src/draw/nxp/vglite/lv_draw_vglite_img.c +++ b/src/draw/nxp/vglite/lv_draw_vglite_img.c @@ -399,7 +399,9 @@ static void _vglite_draw_pattern(const lv_area_t * clip_area, const lv_area_t * src_vgbuf->transparency_mode = VG_LITE_IMAGE_TRANSPARENT; /* Pattern matrix */ - vg_lite_matrix_t * vgmatrix = vglite_get_matrix(); + vg_lite_matrix_t vgmatrix; + vg_lite_identity(&vgmatrix); + vg_lite_translate((vg_lite_float_t)dsc->image_area.x1, (vg_lite_float_t)dsc->image_area.y1, &vgmatrix); /* Blend mode */ vg_lite_blend_t vgblend = vglite_get_blend_mode(dsc->blend_mode); @@ -412,7 +414,7 @@ static void _vglite_draw_pattern(const lv_area_t * clip_area, const lv_area_t * /* Draw Pattern */ VGLITE_CHECK_ERROR(vg_lite_draw_pattern(dst_vgbuf, &path, VG_LITE_FILL_NON_ZERO, &path_matrix, - src_vgbuf, vgmatrix, vgblend, VG_LITE_PATTERN_REPEAT, + src_vgbuf, &vgmatrix, vgblend, VG_LITE_PATTERN_REPEAT, 0, vgcol, filter)); }