Part Number: PROCESSOR-SDK-AM57X
Tool/software: TI C/C++ Compiler
For every operation loop I am getting 64 bytes memory leak in libIMGegl.so.1.14.3699939.
I checked with valgrind.
I am using ti-sgx-ddk-um_1.14.3699939.bb
{
.
.
.
DESCRIPTION = "Userspace libraries for PowerVR SGX chipset on TI SoCs"
HOMEPAGE = "git.ti.com/.../omap5-sgx-ddk-um-linux"
LICENSE = "TI-TSPA"
LIC_FILES_CHKSUM = "file://TI-Linux-Graphics-DDK-UM-Manifest.doc;md5=550702a031857e0426ef7d6f6cf2d9f4"
PACKAGE_ARCH = "${MACHINE_ARCH}"
BRANCH = "ti-img-sgx/${PV}"
SRC_URI = "git://git.ti.com/graphics/omap5-sgx-ddk-um-linux.git;protocol=git;branch=${BRANCH}"
SRCREV = "cf8cd620e96c9741bfcbe7f07c95328fe2d6ece9"
.
.
.
}
Here is my code sequences
---------------------------
OPERATION LOOP
{
eglMakeCurrent(pDRMDisplayInternalContext->sDRMDisplayEGLContext.pEGLDisplay, pDRMDisplayInternalContext->sDRMDisplayEGLContext.pEGLSurface,
pDRMDisplayInternalContext->sDRMDisplayEGLContext.pEGLSurface, pDRMDisplayInternalContext->sDRMDisplayEGLContext.pEGLContext);
/* eglInitlize sheders */
pDRMDisplayShaderContext->glVertexShader = DRMDisplayLoadShader(pVertexShaderSource, GL_VERTEX_SHADER);
pDRMDisplayShaderContext->glFragmentShader = DRMDisplayLoadShader(pFragmentShaderSource, GL_FRAGMENT_SHADER);
pDRMDisplayShaderContext->glProgram = glCreateProgram();
glAttachShader(pDRMDisplayShaderContext->glProgram, pDRMDisplayShaderContext->glVertexShader);
glAttachShader(pDRMDisplayShaderContext->glProgram, pDRMDisplayShaderContext->glFragmentShader);
.
.
glLinkProgram(pDRMDisplayShaderContext->glProgram);
glUseProgram(pDRMDisplayShaderContext->glProgram);
.
pDRMDisplayEGLContext->u32TextureId = glGetUniformLocation(pDRMDisplayShaderContext->glProgram, "textureId");
pDRMDisplayEGLContext->modelviewMatrix = glGetUniformLocation(pDRMDisplayShaderContext->glProgram, "modelviewMatrix");
pDRMDisplayEGLContext->bDeviceConnectedOnHDMI = glGetUniformLocation(pDRMDisplayShaderContext->glProgram, "bDeviceConnectedOnHDMI");
...
.
.
.
/* Creating Textures for video/Image objects */
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glGenTextures(1, &pFifoBuffer->hTextureName);
glBindTexture(GL_TEXTURE_2D, pFifoBuffer->hTextureName);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, pFifoBuffer->u32BufferWidth,
pFifoBuffer->u32BufferHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE,
NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
.
.
/* Filinng video/image buffers */
glBindTexture(GL_TEXTURE_2D, hTextureName);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, pFifoBuffer->u32BufferWidth,
pFifoBuffer->u32BufferHeight, GL_RGBA, GL_UNSIGNED_BYTE,
pFifoBuffer->pBuffer);
.
.
glDrawArrays(GL_TRIANGLE_STRIP, (u32Index * 4), 4);
.
.
/* Delete textures after work completed */
glDeleteTextures(1, &(pDRMDisplayInternalContext->phTextureName[i32Counter]));
/* Deinit shaders */
glDeleteShader(pDRMDisplayShaderContext->glFragmentShader);
glDeleteShader(pDRMDisplayShaderContext->glVertexShader);
glDeleteProgram(pDRMDisplayShaderContext->glProgram);
eglMakeCurrent(pDRMDisplayInternalContext->sDRMDisplayEGLContext.pEGLDisplay, pDRMDisplayInternalContext->sDRMDisplayEGLContext.pEGLSurface,
pDRMDisplayInternalContext->sDRMDisplayEGLContext.pEGLSurface, pDRMDisplayInternalContext->sDRMDisplayEGLContext.pEGLContext);
}