2024-09-19 04:48 AM
Hello
I'm working on a 320x240 SPI LCD using partial frame buffer strategy
The number of blocks is configured to 2 and the block size is configured to 19200 bytes.
The problem is that flushFrameBuffer draws only 240x20 pixels at a time, however I would expect it to draw 240x40 at a time (240x40x2(16-bits) = 19200 bytes)
Does anybody know if that's a TouchGFX limitation, or it can be changed ?
Solved! Go to Solution.
2024-10-02 04:36 AM
Hello @MSecr.1,
Yes, breaking the height into block of 20px is currently a limitation of TouchGFX, and cannot be changed by the users.
Best regards,
2024-10-02 04:36 AM
Hello @MSecr.1,
Yes, breaking the height into block of 20px is currently a limitation of TouchGFX, and cannot be changed by the users.
Best regards,
2024-10-03 04:47 AM
Hi,
Thanks for the clarification. I note that this has been raised earlier - maybe it should be documented - I also wasted some time on this.
Can you advise what is the optimal maximal allocation for partial buffers?
Is it 20 x bytes_per_pixel * display_width?
What is the optimal number of buffers?
Dan
2024-10-03 06:59 AM
I apologize for the inconvenience. We will definitely add this point to the documentation of Partial Framebuffer.
The size of the block is as what you have stated, but about the number of buffers, it depends on your use case. 2 is the minimum, and we usually use 3 in the TouchGFX Board Setups that are available in TouchGFX, and if you have enough RAM then maybe 4 would be better.
I hope this helps you!
2024-11-11 05:09 AM
Hello @MSecr.1 ,
Have you been able to move forward on your project?
Regards,
2024-11-13 02:31 AM - edited 2024-11-13 02:33 AM
Hi @GaetanGodart ,
Yes, I have changed the width to 320 pixels instead of 240, so that the whole screen can be refreshed with just 10 partial buffers instead of 12, so it decreased the screen refresh time a little.
One thing that I want to clarify, @Mohammad MORADI ESFAHANIASL mentioned that it's better to use 4 blocks, but what's the difference between using 3 and 4 blocks for example ?
2024-11-15 03:05 AM
Hello @MSecr.1 ,
Having more blocks allows you to render more area in advance.
Therefore, it is better to have more blocks to increase performance but it is a tradeoff between performances and memory usage.
The simplest way to know how many blocks to use for your application is to test different settings and use the minimum amount of blocks you need to achieve 60fps.
The best way to know how many blocks to use is to measure how long it takes to transfer one block to your display and to make sure you can always render while you are transferring to prevent idle time. Example, if it takes 10 times longer to transfer than to render, you need 10 blocks to be sure that you will always have a block that is ready to be written to. But if you have a simple GUI, you won't need as many blocks because rendering will be very fast.
So in either cases, you should test to make sure you achieve 60fps while using as few blocks as possible (unless you don't care about memory usage).
3 or 4 blocks is the standard.
You can read more about it here .
Regards,