From 888c7e8640caf02082adc23c967c5c0ba49a5146 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Wed, 18 Aug 2021 20:58:53 +0200 Subject: [PATCH] STM32LTDC: Fix bug in DMA2D blitting Thanks to @nathanwiebe for reporting this: https://community.ugfx.io/topic/3159-a-bug-in-the-stm32-ltdc-driver --- changelog.txt | 1 + drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 36657d48..a7dfbf34 100644 --- a/changelog.txt +++ b/changelog.txt @@ -16,6 +16,7 @@ CHANGE: STM32LTDC driver: Rename ALLOW_2ND_LAYER to STM32LTDC_USE_LAYER2. CHANGE: STM32LTDC driver: Rename LTDC_DMA_CACHE_FLUSH to STM32LTDC_DMA_CACHE_FLUSH. CHANGE: STM32LTDC driver: Rename GDISP_LTDC_USE_RGB565 to STM32LTDC_USE_RGB565. FEATURE: STM32LTDC driver: Support double buffering. This introduces STM32LTDC_USE_DOUBLEBUFFERING. +FIX: STM32LTDC driver: Fix bug in gdisp_lld_blit_area() which affected blits with source coordinates other than (0, 0). FIX: Improve /demos/benchmarks/rectangles diff --git a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c index d7b37a3e..a2c5955f 100644 --- a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c +++ b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c @@ -564,7 +564,7 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { LLDSPEC void gdisp_lld_blit_area(GDisplay* g) { gU32 srcstart, dststart; - srcstart = LTDC_PIXELBYTES * ((gU32)g->p.x2 * g->p.y1 * + g->p.x1) + (gU32)g->p.ptr; + srcstart = LTDC_PIXELBYTES * ((gU32)g->p.x2 * g->p.y1 + g->p.x1) + (gU32)g->p.ptr; dststart = (gU32)PIXEL_ADDR(g, PIXEL_POS(g, g->p.x, g->p.y)); #if STM32LTDC_DMA_CACHE_FLUSH