cancel
Showing results for 
Search instead for 
Did you mean: 

Partial Buffer draws only 20 lines of pixels at a time

MSecr.1
Associate III

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 ?

1 ACCEPTED SOLUTION

Accepted Solutions

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,

Mohammad MORADI
ST Software Developer | TouchGFX

View solution in original post

6 REPLIES 6

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,

Mohammad MORADI
ST Software Developer | TouchGFX
codebuk
Associate III

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.

https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/partial-frame-buffer-4-15-maximum-transmitted-lines/m-p/175466

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

 

 

 

 

 

 

 

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!

Mohammad MORADI
ST Software Developer | TouchGFX
GaetanGodart
ST Employee

Hello @MSecr.1 ,


Have you been able to move forward on your project?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

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 ?

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,

Gaetan Godart
Software engineer at ST (TouchGFX)