nathanwiebe Posted June 22, 2021 Report Posted June 22, 2021 Line 545 of gdisp_lld_STM32LTDC.c currently reads: srcstart = LTDC_PIXELBYTES * ((gU32)g->p.x2 * g->p.y1 * + g->p.x1) + (gU32)g->p.ptr; Given that the operator "* +" clearly compiles but is nonsense, the correct line of code should be: srcstart = LTDC_PIXELBYTES * ((gU32)g->p.x2 * g->p.y1 + g->p.x1) + (gU32)g->p.ptr; I think this is a plain and simple typo, but it has been there since uGFX 2.7 or earlier. This means the srcstart (the starting address of the blit source) is not being calculated correctly. I believe the reason this slipped passed the radar in v2.7 is that, for some unknown reason, this same calculation was repeated (without the typo) in line 578, where DMA2D->FGMAR was set to the source address. So in 2.7, the only time the erroneous value was used was in cache flushing and invalidation. In the latest (2.9 release and guthub) version, the erroneously-calculated srcstart is being used directly to set FGMAR (as it should), but due to the typo, the resulting blit regions are copying essentially from random areas as their source. As for reproduction steps, any blit from a pixmap to the display will calculate incorrectly except for, I suppose, blits with a source of (0,0) and a few other lucky combinations. I just thought I would report this to be helpful.
Joel Bodenmann Posted June 29, 2021 Report Posted June 29, 2021 Thank you for bringing this to our attention. Any form of feedback & possible bug report is welcomed I'll be working the STM32LTDC driver in an upcoming project (few days/weeks from now). I will look into it then.
Joel Bodenmann Posted August 18, 2021 Report Posted August 18, 2021 Took a bit longer than expected to get to this but yeah: This is definitely a typo. Fixed in commit 888c7e8640caf02082adc23c967c5c0ba49a5146 Thank you for reporting this! There were some other improvements to the STM32LTDC driver in the meantime (which is why getting to this took a bit longer):
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now