924 views
in System Integration by
I am trying to optimize my display by sending only updated rectangle! I am unable to clearly identify if the update rect coordinates I receive inside EWupdate refer to Frame buffer or double frame buffer.. is there any way I can confirm or check it before transfer? Right now I am swapping framebuffer addresses inside EWupdate  initiating currentframeBufferAddr=FrameBufferAddr; inside EWInit function.

here is a part of EWupdate code I have;

XBitmap*       bitmap     = EwBeginUpdate( aViewport );
  GraphicsCanvas canvas     = EwNewObject( GraphicsCanvas, 0 );
  XRect          updateRect = {{ 0, 0 }, { 0, 0 }};

  /* let's redraw the dirty area of the screen. Cover the returned bitmap
     objects within a canvas, so Mosaic can draw to it. */
  if ( bitmap && canvas )
  {
    GraphicsCanvas__AttachBitmap( canvas, (XUInt32)bitmap );
    updateRect = CoreRoot__UpdateGE20( aApplication, canvas );
    GraphicsCanvas__DetachBitmap( canvas );
  }

 

  if(currentframeBufferAddr==FrameBufferAddr)
  {
   ILI9341_transferFrameBuffer(&currentframeBufferAddr, updateRect);
   currentframeBufferAddr=DoubleBufferAddr;
  }
  else
  {
   ILI9341_transferFrameBuffer(&currentframeBufferAddr, updateRect);
   currentframeBufferAddr=FrameBufferAddr;
  }

   #endif
  /* complete the update */
  if ( bitmap )
    EwEndUpdate( aViewport, updateRect );

1 Answer

0 votes
by
HI,

which target are you using? Within all our Build Environments which are using an external display controller like ILI9341, we are only transferring the dirty rectangle.

Maybe you should take one of these as foundation for your project.

Let me know.

Best regards,

Manfred.
by
Hi Manfred,

Sorry to get back to you late!

I have main issue swapping framebuffers in case of double buffering.

I have to send the framebuffer address to the FPGA. and I am simply accessing framebuffers one by one! Initializing current framebuffer to currentframeBufferAddr=FrameBufferAddr; inside EwInit().

And swapping is done inside EwUpdate() which looks like this:

 if(currentframeBufferAddr==FrameBufferAddr)
  {
   ILI9341_transferFrameBuffer(&currentframeBufferAddr, updateRect);
   currentframeBufferAddr=DoubleBufferAddr;
  }
  else
  {
   ILI9341_transferFrameBuffer(&currentframeBufferAddr, updateRect);
   currentframeBufferAddr=FrameBufferAddr;
  }
 

everything seems ok when I switch on the device first few screens are also updated correctly, UNTIL an event occurs and it seems like I am accessing the wrong framebuffer and image corresponding to that event is in the other framebuffer.

Am I making things more complicated? I think there might be a simple solution to this.

Also, is there any way to know which framebuffer is written by Embedded Wizard corresponding to an event?

I hope I am able to explain the issue, The information I found on your website is "Once the update is complete, the two buffers (front and back) can be exchanged by hardware. This so called 'swapping' or 'flipping' of the two buffers has to be done on V-sync."

Your help and suggestions would be highly appreciated!

Thanks in advance!
by
Hi Mariam,

first of all, we should clarify if it makes sense to use single-buffering or double-buffering: In case you have a DMA that transfers the framebuffer content it makes sense to use double-buffering, because the CPU can work in parallel. In case the CPU has to transfer the framebuffer content to your display driver, it is easier to use single-buffering.

The swapping is only necessary when there is an internal display controller which is reading the framebuffer content continuously, so that you have to change the framebuffer address on V-Sync. In case of an external display controller (e.g. ILI9341) you have no V-Sync information within the MCU.

The Graphics Engine takes care to use the correct framebuffer (single or double-buffering). Each time a framebuffer is prepared, the function EwBspDisplayCommitBuffer() is called, which provides you the address and the rectangular area. This can then be transferred to the external display controller.

Have you adapted the module ew_bsp_display.c to your target?

Best regards,

Manfred.

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...