DMA for framebuffers in DPI (LCD_CAM RGB Display) #2866
-
First, a huge thank you to @Dominaezzz for the DPI driver. I've been poking around at it and I've encountered some issues that are likely a function of waiting on other features to be implemented/supported, as well as my own limited experience with RGB panel displays. I'm using a "CYB" - that is, "Cheap yellow board" that provides no I was trying to interface it quickly with Of course, playing with the timings, as well as the frequency in Unfortunately, I have been banging the keyboard for so long that I have likely confused myself about all sorts of things. So, I hope someone might be able to help me understand my I have been able to allocate buffers to PSRAM, via the HEAP. However, anything larger than 4k (within the chunk bounds, etc.) just never seems to get the data out (feels like a hang). However, switching to a For the life of me, I can't figure this out. The code base is very simple (perhaps even silly) - https://gitlab.com/jgtaylor/phils-audio-player/-/tree/mipidsi-integration?ref_type=heads . I don't think I'm using the "flash" feature that could interfere with the PSRAM DMA. I've tried sync/async LCD as well as DMA (had to change the signatures for the DPI::new() to get this), with little difference. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
If you've got a datasheet for the display I can double check your config if you like.
Good thing you shared the code, I can see what's going wrong. You have misunderstood how the DPI driver works and how DmaLoopBuf works. I've been very lazy with documenting both so I can understand why you wrote the code the way you did. The DPI driver doesn't support chunking and this is a hardware/protocol limitation. The driver can either send a full frame once or multiple full frames indefinitely. Nothing in between. DmaLoopBuf can only handle up to 4095 bytes, and then this buffer is transmitted over and over again indefinitely. It's primarily used for filling the entire frame with a single colour. To summarise, your flush code which is trying to draw a whole framebuffer in chunks, is actually sending multiple frames where the each frame only gets 3200 bytes worth of data, which is repeated several times until the end of the frame. I hope that makes some sense. |
Beta Was this translation helpful? Give feedback.
The timings look correct to me. My only note is you should probably set
hs_blank_en
to true, and increase the frequency from 6 to 25 (or at least 16). Dropping the frequency to 6 means you have to drop decrease the timings accordingly, otherwise you'll get weird artefacts on the screen. The LCD pixels need to be written to often, otherwise they lose "charge" and flicker.Bigger is better for this peripheral in particular. Try to keep it at 4092 and enable bursting.