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.

Linux/AM5728: DMA buffer to SGX544 using EGL Image

Part Number: AM5728

Tool/software: Linux

Hello,

I'm working the AM5728's write-back image to LCD display using OpenGl ES 2.0 (via dma-buf)

It is in capture mode and queuing and dequeuing frames just fine. But the problem is that glTexImage2D() api is too slow.

I found that SGX DDK support

EGL_EXT_image_dma_buf_import (https://git.ti.com/graphics/omap5-sgx-ddk-um-linux/commit/fccafce7d0a023e36c064ccbaa7d33e89252ea00),

but it seems there is no GL_OES_EGL_image extension in DDK(which bind an EGLImage to a texture, glEGLImageTargetTexture2DOES() returns INVALID_OPERATION)

I'm not familiar with EGLImage... is there any way to draw a eglImage to texture or frame buffer?

 

sdk version:

PSDK 03.01.00.06

 

Thanks and regards

  • The software team have been notified. They will respond here.
  • Here's my code:

     EGLint Fd = m_lpWriteback->wbparams.output_buf_dmafd[m_lpWriteback->m_QbufIndex];
     EGLint Attribs[30] = {0,};
     DWORD Idx = 0;
     Attribs[Idx++] = EGL_WIDTH;                     Attribs[Idx++] = SrcWidth;
     Attribs[Idx++] = EGL_HEIGHT;                    Attribs[Idx++] = SrcHeight;
     Attribs[Idx++] = EGL_LINUX_DRM_FOURCC_EXT;      Attribs[Idx++] = DRM_FORMAT_YUYV;
     Attribs[Idx++] = EGL_DMA_BUF_PLANE0_FD_EXT;     Attribs[Idx++] = Fd;
     Attribs[Idx++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT; Attribs[Idx++] = 0;
     Attribs[Idx++] = EGL_DMA_BUF_PLANE0_PITCH_EXT;  Attribs[Idx++] = SrcWidth * 2;
     Attribs[Idx++] = EGL_NONE;
    
     EGLImageKHR Image = lpGl->lpeglCreateImageKHR( lpGl->Display, EGL_NO_CONTEXT,
                                                    EGL_LINUX_DMA_BUF_EXT,
                                                    static_cast<EGLClientBuffer>(NULL), Attribs );
     glBindTexture( GL_TEXTURE_2D, lpGl->TbYUV );
     printf("glBindTexture() returned %d\n", glGetError());
     
     lpGl->lpglEGLImageTargetTexture2DOES( GL_TEXTURE_2D, Image );
     printf("EGLImageTargetTexture2DOES() returned %d\n", glGetError());
    
     glUseProgram( lpGl->TexProg );
     glVertexAttribPointer( 0, 3, GL_FLOAT, GL_FALSE, 0, lpPos );
     glEnableVertexAttribArray( 0 );
    
     glVertexAttribPointer( 1, 2, GL_FLOAT, GL_FALSE, 0, lpTexUI );
     glEnableVertexAttribArray( 1 );
    
     glActiveTexture( GL_TEXTURE0 + 0 );
     glBindTexture( GL_TEXTURE_2D, lpGl->TbYUV );
     glUniform1i( lpGl->SamplerLoc, 0 );
    
     glViewport( 0, 1080 - 480, 800, 480 );
     glDrawArrays( GL_TRIANGLE_STRIP, 0, 4);

    ///////
    glGetError() returns '0', Fd's YUV data is also fine, but It's not working(only black screen). Am I doing something wrong??