BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Author Topic: Bitmap truncated randomly  (Read 545 times)

Cyrilou

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Bitmap truncated randomly
« on: November 09, 2022, 03:35:14 PM »

Hi,

I'm using ESD and sometimes fonts or ESD_images are truncated when I'm doing slide animations.
I've localized where is the problem:
In file Esd_Render_Bitmap.c:

void Esd_CoDl_Bitmap_Vertex(int16_t x, int16_t y, uint8_t handle, uint16_t cell)
{
   EVE_HalContext *phost = Esd_GetHost();
   if ((EVE_CHIPID >= EVE_FT810) && (x < 0 || y < 0 || x >= 512 || y >= 512))
   {
      EVE_CoDl_vertexFormat(phost, 0);
      EVE_CoDl_bitmapHandle(phost, handle);
      Esd_CoDl_PagedBitmapSource(handle, cell >> 7);
      EVE_CoDl_cell(phost, cell & 0x7F);
      EVE_CoCmd_dl(phost, VERTEX2F(x, y));
     }
   else
   {
      Esd_CoDl_PagedBitmapSource(handle, cell >> 7);
      EVE_CoCmd_dl(phost, VERTEX2II(x, y, handle, cell));
   }
}

When I comment VERTEX2II part of code, bitmap are not truncated, otherwise I loose bottom of the bitmap randomly with slide animations.

How can we explain this? Is something missing in dl commands?
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Bitmap truncated randomly
« Reply #1 on: November 09, 2022, 04:42:54 PM »

Hello,

Thank you for your question.

Could you please let me know how large of a bitmap you are trying to place on the screen and at what screen position (X and Y value) you are placing it.

The VERTEX2II function can only render images to X=511 and Y=511 on the screen, so I suspect the code is dropping into the else section inadvertatnly.

Best Regards,
BRT Community
Logged

Cyrilou

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: Bitmap truncated randomly
« Reply #2 on: November 09, 2022, 05:05:31 PM »

I have a screen of 480x272 i'm using a picture at x,y,h,w=4,10,36,36.
Screen is sliding of 240 to the left so only x is varying to -236.
Logged

Cyrilou

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: Bitmap truncated randomly
« Reply #3 on: November 09, 2022, 05:26:34 PM »

The thing is why draw an element which is out of the screen?
if I draw only the visible part I have not the problem so I use vertex2ii
Logged

Cyrilou

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: Bitmap truncated randomly
« Reply #4 on: November 10, 2022, 10:24:42 AM »

For fonts it's another problem that I must find.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Bitmap truncated randomly
« Reply #5 on: November 10, 2022, 11:21:23 AM »

Hello,

Are you displaying the image within a ESD Scroll Image?

What issue are you seeing with fonts? is this a built-in font or a custom font added to the project?

Best Regards,
BRT Community
Logged

Cyrilou

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: Bitmap truncated randomly
« Reply #6 on: November 10, 2022, 01:20:11 PM »

It is a font added to the project. I'm using scroll panel but in a another screen. It's like a scissor would be applied on the font whereas i'm not using this.

As you see in attached, i'm using ESD label in linear layouts.

I have a main screen where font is used. When I slide the screen to the right a new screen that using scroll panel appears from the left, so at a moment font is displayed at the same time as scroll panel.
The slide is not done via scrool widget but with slide animations used by ev demo.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Bitmap truncated randomly
« Reply #7 on: November 11, 2022, 10:31:31 AM »

Hello,

I've attempted to recreate this behaviour in an ESD project btu haven't been successful currently.

Would you be able to share a cut down version of your application which shows this issue?

Best Regards,
BRT Community
Logged

Cyrilou

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: Bitmap truncated randomly
« Reply #8 on: January 19, 2023, 06:05:24 PM »

Hi, no I can't.

Fonts and pictures can rarely but randomly be glitched. I've localized and reproduced the cause.
It's in file Esd_GpuAlloc.c. If I change address of an AllocEntries it corrupt font or picture in RAM_G (this is normal, but what is the cause?).
So it can be a pb in the algorithm of esd allocation or maybe ram overwrite in my app.
I've also set safe defragmentation macro added in v4.11 but this increase a lot chances to have glitches.
Safe defragmentation doesn't work for me.
I use also gradient widget which require alloc/dealloc when it is displayed/not displayed.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Bitmap truncated randomly
« Reply #9 on: January 20, 2023, 10:26:14 AM »

Hello,

Yes, from the screenshots previously provided it appears as if there may be an overwrite of assets happening in RAM_G.

If the address for the asset has been altered this will cause EVE to attempt to render the asset from the wrong RAM_G location. For example if you have a 100kB image file at RAM_G +0 and you move the allocation to RAM_G+500 the resulting display code will still attempt to render data from RAM_G+0 thus causing corruption in the image.

Do you still experience similar issue in ESD 4.15?

Best Regards,
BRT Community
Logged