Skip to content

Conversation

rlouedec-microej
Copy link
Collaborator

No description provided.

This is described in :ref:`section_brs`. This "Transmit & Swap (parallel)" policy is best combined with the :ref:`section_brs_predraw`.
See details on the optimizations in :ref:`Predraw applied to Transmit & Swap <section_brs_predraw_transmitswap>`.`

.. I am not sure to understand here: to restore, we would need to perform a copy between the two back buffers. This can only be
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right but this chapter does not mention the "restore": the idea is to describe the different techs of buffering. Don't care about restoration. The choose between "serial" and "parallel" mode is an hardware restriction. Then, according to the available memory, you can use 1 or 2 buffers in RAM in addition with the "serial" buffer (on LCD side). In most of cases, the "serial" mode is slow: the transmit is slower than a copy RAM to RAM.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I think I meant "refresh", not "restore".

In most of cases, the "serial" mode is slow: the transmit is slower than a copy RAM to RAM.

That's kind of my point: in "parallel" mode, why would you use this policy? It seems inefficient: uses more memory than the single buffer policy (3 instead of 2) and has no benefit in terms of performance (it can even lower the performances with additional useless refresh/copies).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parallel 3: useful for the RT1170! :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using "Transmit & Swap (parallel)" or "Swap double (parallel)"?


To render the next frame on a different buffer, it may be needed to first restore the content of the new active back buffer.
This is described in :ref:`section_brs`. This "Transmit & Swap (serial)" policy is best combined with the :ref:`section_brs_predraw`.
See details on the optimizations in :ref:`Predraw applied to Transmit & Swap <section_brs_predraw_transmitswap>`.`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I said in another comment, this chapter does not mention the problem of restore (it is not the aim of this chapter). But I understand why you mention it here. I agree to keep your note but this note should be copied here: Swap Double Buffer (parallel) and Swap Triple Buffer (parallel),

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this should be applied to other policies 👍
Also, reword "restore" to "refresh".


This strategy considers that the drawings are always performed in a buffer, and a swap with another buffer is made by the implementation of ``LLUI_DISPLAY_IMPL_flush()``.
In this case, the restoration is mandatory because the new back buffer must contain the past before the buffer swapping.
This strategy can be used to refresh an outdated buffer to the active back buffer before they are swapped.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chapter pattern is the same for all BRS chapter. If you change one, change all

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your sentence is wrong or I don't understand what you want to say. The BB is first restored before the first drawing. It is not restored before the swap

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, indeed...
I think I re-used the previous description but it was kind of wrong too.
I'll see how to fix this 👍

.. I wonder if we could improve this by adding the actual API calls `Display.flush()`, `MyPainter.drawA()`,
`MyPainter.drawB()`, `MyPainter.drawC()`, ..
But I am not sure how to do that with a simple table (one call corresponds to multiple actions)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't care about the java code: here the LLAPI code is enough according to me (vee port guy). Maybe we can add another chapter that describes the calls java -> llapi -> driver to not overload this table (which is enough complex to understand)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well obviously we have different perspectives here. As a Java developer, I would be interested with having this extra info.
Main reason I think was that, with just the current table, it was not clear what triggered the implicit region calls. (after looking more into it, I think I got it but it's not obvious.)
Anyway, I am not sure if I would have a better way to present this including the high level API calls.

- Back Buffer
- Front Buffer
* - Startup
* - Initial State
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok for this change but must be copied everywhere


The two buffers have the same role alternatively: back buffer and transmission buffer.
On startup, the transmission buffer has yet to be used.
In this policy, the newly active back buffer is refreshed after a swap.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cf above: I think you have not understand when the BB is updated... maybe we can discuss together because your approach seems better.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my understanding, it is refreshed after a swap, just before the first drawing.
Sure, we can discuss that.


14. The BSP should notify the Graphics Engine again by calling ``LLUI_DISPLAY_setBackBuffer()``, giving the transmission buffer address: the Graphics Engine will reuse this buffer for future drawings, and the strategy will not need to restore anything.
.. I understand that I am removing some (maybe useful) documentation on the details of the sequence of native API calls.
I think this helps to clarify the concept. We may add this back in the typical implementations section?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not agreed to remove all steps. These are the steps that occur between the driver, the interrupt, the graphics engine, etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about moving those steps to a different section and keeping only what is necessary to understand the concepts here (+ link to the different section with implementation details and the driver/graphics engine calls timeline)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants