mirror of
https://github.com/lvgl/lvgl.git
synced 2026-06-02 01:18:04 +08:00
fix(pxp): fix issues in pxp cache management callback (#5685)
Signed-off-by: Hatim-Pierre FAZILEABASSE <hatim-pierre.fazileabasse@ingenico.com>
This commit is contained in:
committed by
GitHub
parent
7d77a509a5
commit
cde82c193c
@@ -70,7 +70,7 @@ void * lv_draw_buf_align(void * data, lv_color_format_t color_format)
|
|||||||
else return NULL;
|
else return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_draw_buf_invalidate_cache(lv_draw_buf_t * draw_buf, const lv_area_t * area)
|
void lv_draw_buf_invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area)
|
||||||
{
|
{
|
||||||
if(handlers.invalidate_cache_cb) {
|
if(handlers.invalidate_cache_cb) {
|
||||||
LV_ASSERT_NULL(draw_buf);
|
LV_ASSERT_NULL(draw_buf);
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ typedef void (*lv_draw_buf_free_cb)(void * draw_buf);
|
|||||||
|
|
||||||
typedef void * (*lv_draw_buf_align_cb)(void * buf, lv_color_format_t color_format);
|
typedef void * (*lv_draw_buf_align_cb)(void * buf, lv_color_format_t color_format);
|
||||||
|
|
||||||
typedef void (*lv_draw_buf_invalidate_cache_cb)(lv_draw_buf_t * draw_buf, const lv_area_t * area);
|
typedef void (*lv_draw_buf_invalidate_cache_cb)(const lv_draw_buf_t * draw_buf, const lv_area_t * area);
|
||||||
|
|
||||||
typedef uint32_t (*lv_draw_buf_width_to_stride_cb)(uint32_t w, lv_color_format_t color_format);
|
typedef uint32_t (*lv_draw_buf_width_to_stride_cb)(uint32_t w, lv_color_format_t color_format);
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ void * lv_draw_buf_align(void * buf, lv_color_format_t color_format);
|
|||||||
* @param area the area to invalidate in the buffer,
|
* @param area the area to invalidate in the buffer,
|
||||||
* use NULL to invalidate the whole draw buffer address range
|
* use NULL to invalidate the whole draw buffer address range
|
||||||
*/
|
*/
|
||||||
void lv_draw_buf_invalidate_cache(lv_draw_buf_t * draw_buf, const lv_area_t * area);
|
void lv_draw_buf_invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the stride in bytes based on a width and color format
|
* Calculate the stride in bytes based on a width and color format
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
* STATIC PROTOTYPES
|
* STATIC PROTOTYPES
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
static void _invalidate_cache(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 VARIABLES
|
* STATIC VARIABLES
|
||||||
@@ -58,7 +58,7 @@ void lv_draw_buf_pxp_init_handlers(void)
|
|||||||
* STATIC FUNCTIONS
|
* STATIC FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
static void _invalidate_cache(lv_draw_buf_t * draw_buf, const lv_area_t * area)
|
static void _invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area)
|
||||||
{
|
{
|
||||||
const lv_image_header_t * header = &draw_buf->header;
|
const lv_image_header_t * header = &draw_buf->header;
|
||||||
uint32_t stride = header->stride;
|
uint32_t stride = header->stride;
|
||||||
@@ -68,11 +68,11 @@ static void _invalidate_cache(lv_draw_buf_t * draw_buf, const lv_area_t * area)
|
|||||||
uint16_t size = stride * lv_area_get_height(area);
|
uint16_t size = stride * lv_area_get_height(area);
|
||||||
|
|
||||||
/* Invalidate full buffer. */
|
/* Invalidate full buffer. */
|
||||||
DEMO_CleanInvalidateCacheByAddr((void *)buf, size);
|
DCACHE_CleanInvalidateByRange((uint32_t)draw_buf->data, size);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint8_t * buf_u8 = buf;
|
const uint8_t * buf_u8 = draw_buf->data;
|
||||||
/* ARM require a 32 byte aligned address. */
|
/* ARM require a 32 byte aligned address. */
|
||||||
uint8_t align_bytes = 32;
|
uint8_t align_bytes = 32;
|
||||||
uint8_t bits_per_pixel = lv_color_format_get_bpp(cf);
|
uint8_t bits_per_pixel = lv_color_format_get_bpp(cf);
|
||||||
@@ -103,7 +103,7 @@ static void _invalidate_cache(lv_draw_buf_t * draw_buf, const lv_area_t * area)
|
|||||||
for(uint16_t y = 0; y < area_height; y++) {
|
for(uint16_t y = 0; y < area_height; y++) {
|
||||||
const void * line_addr = buf_u8 + y * stride;
|
const void * line_addr = buf_u8 + y * stride;
|
||||||
|
|
||||||
DEMO_CleanInvalidateCacheByAddr((void *)line_addr, line_size);
|
DCACHE_CleanInvalidateByRange((uint32_t)line_addr, line_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 * _buf_align(void * buf, lv_color_format_t cf);
|
||||||
|
|
||||||
static void _invalidate_cache(void * buf, uint32_t stride, lv_color_format_t cf, const lv_area_t * area);
|
static void _invalidate_cache(const void * buf, uint32_t stride, lv_color_format_t cf, const lv_area_t * area);
|
||||||
|
|
||||||
static uint32_t _width_to_stride(uint32_t w, lv_color_format_t cf);
|
static uint32_t _width_to_stride(uint32_t w, lv_color_format_t cf);
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ static void * _buf_align(void * buf, lv_color_format_t cf)
|
|||||||
return buf_u8;
|
return buf_u8;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _invalidate_cache(lv_draw_buf_t * draw_buf, const lv_area_t * area)
|
static void _invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area)
|
||||||
{
|
{
|
||||||
const lv_image_header_t * header = &draw_buf->header;
|
const lv_image_header_t * header = &draw_buf->header;
|
||||||
uint32_t stride = header->stride;
|
uint32_t stride = header->stride;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ static void execute_drawing(lv_draw_dave2d_unit_t * u);
|
|||||||
|
|
||||||
#if defined(RENESAS_CORTEX_M85)
|
#if defined(RENESAS_CORTEX_M85)
|
||||||
#if (BSP_CFG_DCACHE_ENABLED)
|
#if (BSP_CFG_DCACHE_ENABLED)
|
||||||
static void _dave2d_buf_invalidate_cache_cb(lv_draw_buf_t * draw_buf, const lv_area_t * area);
|
static void _dave2d_buf_invalidate_cache_cb(const lv_draw_buf_t * draw_buf, const lv_area_t * area);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ static void lv_draw_buf_dave2d_init_handlers(void)
|
|||||||
|
|
||||||
#if defined(RENESAS_CORTEX_M85)
|
#if defined(RENESAS_CORTEX_M85)
|
||||||
#if (BSP_CFG_DCACHE_ENABLED)
|
#if (BSP_CFG_DCACHE_ENABLED)
|
||||||
static void _dave2d_buf_invalidate_cache_cb(lv_draw_buf_t * draw_buf, const lv_area_t * area)
|
static void _dave2d_buf_invalidate_cache_cb(const lv_draw_buf_t * draw_buf, const lv_area_t * area)
|
||||||
{
|
{
|
||||||
const lv_image_header_t * header = &draw_buf->header;
|
const lv_image_header_t * header = &draw_buf->header;
|
||||||
uint32_t stride = header->stride;
|
uint32_t stride = header->stride;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
* STATIC PROTOTYPES
|
* STATIC PROTOTYPES
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
static void invalidate_cache(lv_draw_buf_t * draw_buf, const lv_area_t * area);
|
static void invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area);
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC VARIABLES
|
* STATIC VARIABLES
|
||||||
@@ -50,7 +50,7 @@ void lv_nuttx_cache_init(void)
|
|||||||
* STATIC FUNCTIONS
|
* STATIC FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
static void invalidate_cache(lv_draw_buf_t * draw_buf, const lv_area_t * area)
|
static void invalidate_cache(const lv_draw_buf_t * draw_buf, const lv_area_t * area)
|
||||||
{
|
{
|
||||||
LV_ASSERT_NULL(draw_buf);
|
LV_ASSERT_NULL(draw_buf);
|
||||||
void * buf = draw_buf->data;
|
void * buf = draw_buf->data;
|
||||||
|
|||||||
Reference in New Issue
Block a user