2019-08-19 02:16 AM
I am working on a custom board with TouchGFX, and the custom board connects to a SPI LCD. I found an issue that TouchGFX will call flushFrameBuffer(const touchgfx::Rect& rect) function twice when making a screen transition. I just wondering if the behavior is normal, and why.
Best Regards!
Solved! Go to Solution.
2019-08-23 02:30 AM
You can override beginFrame() and endFrame() in your concrete hal:
void MyHal::beginFrame()
{
//set some global variable here. In flushFrameBuffer() check if you're transferring the same frame twice.
HAL::beginFrame();
}
If the frame number is different then it's a problem we have to solve in TouchGFX unless you want to compare the entire Rect with what's in the other framebuffer. Not a good idea.
Edit: This is verified in 4.10.0 and will be fixed. Until then you can use the above to ensure that you're only transferring the same frame once.
/Martin
2019-08-19 04:23 AM
Hi L4Y,
I'm assuming this is a screen transition with no effct (Slide, Cover) and you're wondering why we're trying to transfer the same framebuffer contents twice?
Is rect identical between calls?
/Martin
2019-08-19 05:43 PM
Hi Martin,
Yes, it's exactly as what you said. And the size of the Rect is always full screen between each calls when making screen transition
Best Regards!
2019-08-22 01:14 AM
@Martin KJELDSEN
Hi Martin,
Any update about the issue?
Best Regards!
2019-08-22 12:25 PM
Hi @L4Y,
I think it's because, usually, if people use an animation to transfer to a different screen, the very last frame of that animation will be the same as the screen being switched in. For noTransition this essentially the same, since there's just 1 step to the transition and then the new frame.
This may be something we haven't thought fully through for flushFrameBuffer(). I suppose what you could do is remember if you've already transferred a particular Rect within a certain frame. Then don't do that again.
Does that make sense?
/Martin
2019-08-23 02:16 AM
Hi Martin,
I don't think we could know the particular frame that we've already transferred since we just know the size of Rect from flushFrameBuffer() perspective.
Best Regards
2019-08-23 02:30 AM
You can override beginFrame() and endFrame() in your concrete hal:
void MyHal::beginFrame()
{
//set some global variable here. In flushFrameBuffer() check if you're transferring the same frame twice.
HAL::beginFrame();
}
If the frame number is different then it's a problem we have to solve in TouchGFX unless you want to compare the entire Rect with what's in the other framebuffer. Not a good idea.
Edit: This is verified in 4.10.0 and will be fixed. Until then you can use the above to ensure that you're only transferring the same frame once.
/Martin
2019-08-25 07:41 PM
Hi Martin,
Yes, that's maybe a workaround even though it's not perfect. Hope it can be improved in next TouchGFX release.
Best Regards!
2019-08-25 11:41 PM
Right. I'll investigate whether or not we're 100% right in our assumptions here :) And then it will definitely be improved.
/Martin
2019-08-25 11:50 PM
Hi again,
Okay, verified. We're working on a fix.
/Martin