This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EGLImageKHR destruction

Other Parts Discussed in Thread: DM3730, OMAP3530

Using OMAP SDK 4.05.00-03 on DM3730, I notice that multiple eglCreateImageKHR/eglDestroyImageKHR (type EGL_NATIVE_PIXMAP_KHR) leads to memory leak.

And after 36 eglCreateImageKHR/eglDestroyImageKHR, eglCreateImageKHR return an error 0x300c (EGL_BAD_PARAMETER).

It looks as if eglDestroyImageKHR does not do any desallocation.

Here below the loop I tested:

for (i=0; i< NB_REPEAT; i++) {

mDrawable = 0;
  mDrawable = XCreatePixmap(x11Display, x11Window,
                         disp_w, disp_h,
                         depth);
  if (!mDrawable)
        printf("XCreatePixmap failed!\n");
  else        
        printf("loop %d drawable = %d\n",i,mDrawable);
 
  XSync(x11Display, False);
 
  //create an KHR image
  khrImage = 0;
  khrImage = peglCreateImageKHR(dpy,
                        EGL_NO_CONTEXT,
                        EGL_NATIVE_PIXMAP_KHR,
                        mDrawable,  
                        NULL);
   
  if((!khrImage) || (err = eglGetError()) != EGL_SUCCESS){
    printf("Error after peglCreateImageKHR!, error = %x\n", err);
  } else {
    printf("peglCreateImageKHR Success! \n");
  }

    XFreePixmap (x11Display, mDrawable);
    XSync(x11Display, False);

    peglDestroyImageKHR(dpy, khrImage);


  if((err = eglGetError()) != EGL_SUCCESS){
    printf("Error after peglDestroyImageKHR!, error = %x\n", err);
  } else {
    printf("peglDestroyImageKHR Success! \n");
  }        

Why is the virtual memory size of the process increasing during this loop ? It isn't if no EGLImageKHR is created but only the pixmaps.

Why does eglCreateImageKHR fail (with error 0x300c) after 36 iterations ?

Thank you for your answers.

Output of script sgxperf_check.sh on our plateform:

~ # sgxperf_check.sh
WSEGL settings
[default]
WindowSystem=libpvrPVR2D_DRIWSEGL.so
DisableHWTextureUpload=1
------
ARM CPU information
Processor       : ARMv7 Processor rev 2 (v7l)
BogoMIPS        : 912.72
Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x3
CPU part        : 0xc08
CPU revision    : 2

Hardware        : OMAP3 Bsm200 Board
Revision        : 0020
Serial          : 0000000000000000
------
SGX driver information
Version 1.6.16.4117 (release) /usr/software/embedded-systems/subsystems/ti/omap/
sdk/4.05.00-03/build-innes.playzilla-and-elinux.sm2/GFX_Linux_KM
System Version String: SGX revision = 1.2.5
------
Framebuffer settings
------
Rotation settings
0
------
Kernel Module information
sierra 8125 0 - Live 0xbf158000
libertas_sdio 7919 0 - Live 0xbf150000
libertas 55044 1 libertas_sdio, Live 0xbf139000
bufferclass_ti 4978 0 - Live 0xbf132000
pvrsrvkm 163978 3 bufferclass_ti, Live 0xbf0f9000
drm 137309 3 pvrsrvkm, Live 0xbf0c3000
cmemk 21002 0 - Live 0xbf0b7000
lpm_omap3530 6381 0 - Live 0xbf0af000
dsplinkk 122621 1 lpm_omap3530, Live 0xbf083000
omap_vout 17448 0 - Live 0xbf077000
omap3_isp 90844 0 - Live 0xbf055000
videobuf_dma_contig 3234 1 omap_vout, Live 0xbf04f000
videobuf_core 13997 2 omap_vout,videobuf_dma_contig, Live 0xbf045000
omapfb 24671 2 - Live 0xbf038000
panel_sharp_ls037v7dw01 2069 0 - Live 0xbf032000
generic_bl 1783 0 - Live 0xbf02c000
panel_generic 1655 1 - Live 0xbf026000
omapdss 98581 4 omap_vout,omapfb,panel_sharp_ls037v7dw01,panel_generic, Live 0xb
f000000
------
Boot settings
smsc95xx.mac=00ffd20d7a04 psn=00000-00004 console=ttyO0,115200n8 consoleblank=0
mpurate=auto mem=414M@0x80000000 root=/dev/mmcblk0p3 rw rootfstype=ext4 rootwait
------
Linux Kernel version
Linux sma200 2.6.37-INNES_patched #1 Mon Jan 23 12:04:20 CET 2012 armv7l GNU/Linux