mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-22 07:02:05 +08:00
feat(dma2d): improve DMA2D Compatibility (#8293)
Arduino Lint / lint (push) Has been cancelled
Build Examples with C++ Compiler / build-examples (push) Has been cancelled
MicroPython CI / Build esp32 port (push) Has been cancelled
MicroPython CI / Build rp2 port (push) Has been cancelled
MicroPython CI / Build stm32 port (push) Has been cancelled
MicroPython CI / Build unix port (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_NORMAL_8BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_SDL - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_VG_LITE - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_VG_LITE - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_VG_LITE - gcc - Windows (push) Has been cancelled
C/C++ CI / Build ESP IDF ESP32S3 (push) Has been cancelled
C/C++ CI / Run tests with 32bit build (push) Has been cancelled
C/C++ CI / Run tests with 64bit build (push) Has been cancelled
BOM Check / bom-check (push) Has been cancelled
Verify that lv_conf_internal.h matches repository state / verify-conf-internal (push) Has been cancelled
Verify the widget property name / verify-property-name (push) Has been cancelled
Verify code formatting / verify-formatting (push) Has been cancelled
Build docs / build-and-deploy (push) Has been cancelled
Test API JSON generator / Test API JSON (push) Has been cancelled
Check Makefile / Build using Makefile (push) Has been cancelled
Check Makefile for UEFI / Build using Makefile for UEFI (push) Has been cancelled
Performance Tests CI / Perf Tests OPTIONS_TEST_PERF_32B - Ubuntu (push) Has been cancelled
Performance Tests CI / Perf Tests OPTIONS_TEST_PERF_64B - Ubuntu (push) Has been cancelled
Port repo release update / run-release-branch-updater (push) Has been cancelled
Verify Font License / verify-font-license (push) Has been cancelled
Verify Kconfig / verify-kconfig (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
Arduino Lint / lint (push) Has been cancelled
Build Examples with C++ Compiler / build-examples (push) Has been cancelled
MicroPython CI / Build esp32 port (push) Has been cancelled
MicroPython CI / Build rp2 port (push) Has been cancelled
MicroPython CI / Build stm32 port (push) Has been cancelled
MicroPython CI / Build unix port (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_NORMAL_8BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_SDL - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_VG_LITE - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_VG_LITE - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_VG_LITE - gcc - Windows (push) Has been cancelled
C/C++ CI / Build ESP IDF ESP32S3 (push) Has been cancelled
C/C++ CI / Run tests with 32bit build (push) Has been cancelled
C/C++ CI / Run tests with 64bit build (push) Has been cancelled
BOM Check / bom-check (push) Has been cancelled
Verify that lv_conf_internal.h matches repository state / verify-conf-internal (push) Has been cancelled
Verify the widget property name / verify-property-name (push) Has been cancelled
Verify code formatting / verify-formatting (push) Has been cancelled
Build docs / build-and-deploy (push) Has been cancelled
Test API JSON generator / Test API JSON (push) Has been cancelled
Check Makefile / Build using Makefile (push) Has been cancelled
Check Makefile for UEFI / Build using Makefile for UEFI (push) Has been cancelled
Performance Tests CI / Perf Tests OPTIONS_TEST_PERF_32B - Ubuntu (push) Has been cancelled
Performance Tests CI / Perf Tests OPTIONS_TEST_PERF_64B - Ubuntu (push) Has been cancelled
Port repo release update / run-release-branch-updater (push) Has been cancelled
Verify Font License / verify-font-license (push) Has been cancelled
Verify Kconfig / verify-kconfig (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
@@ -211,72 +211,16 @@ void lv_draw_dma2d_configure_and_start_transfer(const lv_draw_dma2d_configuratio
|
||||
#if LV_DRAW_DMA2D_CACHE
|
||||
void lv_draw_dma2d_invalidate_cache(const lv_draw_dma2d_cache_area_t * mem_area)
|
||||
{
|
||||
if((SCB->CCR & SCB_CCR_DC_Msk) == 0) return; /* data cache is disabled */
|
||||
|
||||
uint32_t rows_remaining = mem_area->height;
|
||||
uint32_t row_addr = (uint32_t)(uintptr_t) mem_area->first_byte;
|
||||
uint32_t row_end_addr = 0;
|
||||
|
||||
__DSB();
|
||||
|
||||
while(rows_remaining) {
|
||||
uint32_t addr = row_addr & ~(__SCB_DCACHE_LINE_SIZE - 1U);
|
||||
uint32_t cache_lines = ((((row_addr + mem_area->width_bytes - 1) & ~(__SCB_DCACHE_LINE_SIZE - 1U)) - addr) /
|
||||
__SCB_DCACHE_LINE_SIZE) + 1;
|
||||
|
||||
if(addr == row_end_addr) {
|
||||
addr += __SCB_DCACHE_LINE_SIZE;
|
||||
cache_lines--;
|
||||
}
|
||||
|
||||
while(cache_lines) {
|
||||
SCB->DCIMVAC = addr;
|
||||
addr += __SCB_DCACHE_LINE_SIZE;
|
||||
cache_lines--;
|
||||
}
|
||||
|
||||
row_end_addr = addr - __SCB_DCACHE_LINE_SIZE;
|
||||
row_addr += mem_area->stride;
|
||||
rows_remaining--;
|
||||
};
|
||||
|
||||
__DSB();
|
||||
__ISB();
|
||||
if(SCB->CCR & SCB_CCR_DC_Msk) {
|
||||
SCB_InvalidateDCache();
|
||||
}
|
||||
}
|
||||
|
||||
void lv_draw_dma2d_clean_cache(const lv_draw_dma2d_cache_area_t * mem_area)
|
||||
{
|
||||
if((SCB->CCR & SCB_CCR_DC_Msk) == 0) return; /* data cache is disabled */
|
||||
|
||||
uint32_t rows_remaining = mem_area->height;
|
||||
uint32_t row_addr = (uint32_t)(uintptr_t) mem_area->first_byte;
|
||||
uint32_t row_end_addr = 0;
|
||||
|
||||
__DSB();
|
||||
|
||||
while(rows_remaining) {
|
||||
uint32_t addr = row_addr & ~(__SCB_DCACHE_LINE_SIZE - 1U);
|
||||
uint32_t cache_lines = ((((row_addr + mem_area->width_bytes - 1) & ~(__SCB_DCACHE_LINE_SIZE - 1U)) - addr) /
|
||||
__SCB_DCACHE_LINE_SIZE) + 1;
|
||||
|
||||
if(addr == row_end_addr) {
|
||||
addr += __SCB_DCACHE_LINE_SIZE;
|
||||
cache_lines--;
|
||||
}
|
||||
|
||||
while(cache_lines) {
|
||||
SCB->DCCMVAC = addr;
|
||||
addr += __SCB_DCACHE_LINE_SIZE;
|
||||
cache_lines--;
|
||||
}
|
||||
|
||||
row_end_addr = addr - __SCB_DCACHE_LINE_SIZE;
|
||||
row_addr += mem_area->stride;
|
||||
rows_remaining--;
|
||||
};
|
||||
|
||||
__DSB();
|
||||
__ISB();
|
||||
if(SCB->CCR & SCB_CCR_DC_Msk) {
|
||||
SCB_CleanDCache();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -93,8 +93,9 @@ void lv_draw_dma2d_fill(lv_draw_task_t * t, void * first_pixel, int32_t w, int32
|
||||
#endif
|
||||
|
||||
uint32_t output_offset = (stride / cf_size) - w;
|
||||
|
||||
lv_draw_dma2d_configuration_t conf = {
|
||||
.mode = LV_DRAW_DMA2D_MODE_MEMORY_TO_MEMORY_WITH_BLENDING_AND_FIXED_COLOR_FG,
|
||||
.mode = LV_DRAW_DMA2D_MODE_MEMORY_TO_MEMORY_WITH_BLENDING,
|
||||
.w = w,
|
||||
.h = h,
|
||||
|
||||
@@ -103,11 +104,16 @@ void lv_draw_dma2d_fill(lv_draw_task_t * t, void * first_pixel, int32_t w, int32
|
||||
.output_cf = output_cf,
|
||||
|
||||
.fg_color = lv_color_to_u32(color),
|
||||
.fg_address = first_pixel,
|
||||
.fg_offset = output_offset,
|
||||
.fg_alpha_mode = LV_DRAW_DMA2D_ALPHA_MODE_REPLACE_ALPHA_CHANNEL,
|
||||
.fg_alpha = opa,
|
||||
.fg_cf = LV_DRAW_DMA2D_FGBG_CF_A8,
|
||||
|
||||
.bg_address = first_pixel,
|
||||
.bg_offset = output_offset,
|
||||
.bg_alpha_mode = LV_DRAW_DMA2D_ALPHA_MODE_NO_MODIFY_IMAGE_ALPHA_CHANNEL,
|
||||
.bg_alpha = opa,
|
||||
.bg_cf = (lv_draw_dma2d_fgbg_cf_t) output_cf
|
||||
};
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ extern "C" {
|
||||
#define LV_DRAW_DMA2D_ASYNC 0
|
||||
#endif
|
||||
|
||||
#if defined(__CORTEX_M) && (__CORTEX_M == 7)
|
||||
#if defined(__CORTEX_M) && ((__CORTEX_M == 7) || (__CORTEX_M == 55))
|
||||
#define LV_DRAW_DMA2D_CACHE 1
|
||||
#else
|
||||
#define LV_DRAW_DMA2D_CACHE 0
|
||||
|
||||
Reference in New Issue
Block a user