A More Complete EGL Implementation for iMX6 (WEC 2013)

I’ve been using OpengGL ES and EGL with the Colibri iMX6 and WEC 2013 with reasonably good results, but I’ve come across some shortcomings.

  1. For my application, I need to have a way to share the image buffer between the GPU and CPU as documented here https://software.intel.com/en-us/articles/using-opengl-es-to-accelerate-apps-with-legacy-2d-guis. Unfortunately, while the necessary functions like eglCreateImageKHR exist in the .h files, they don’t exist in the .lib files, so I can’t link my application.
  2. eglCreatePixmapSurface compiles, links, and executes fine, but after drawing, the resulting buffer is always black. If I call glFinish to force the completion of the OpenGL pipeline, the program crashes without any error. It just closes and disappears without any information in the debugger or elsewhere. However, if I call eglCopyBuffers, I can get pixel buffer… but it is SLOOOOOW.

I have the following questions.

  1. Who is the author of the iMX6 OpenGL ES and EGL implementation for WEC 2013?
  2. Where can I get more information about what features are or are not implemented?
  3. Where can I file bug reports for the OpengGL ES/EGL implementation with hope that they may actually be addressed?
  4. Most Important - According to Issue 14125 (http://developer.toradex.com/software/windows-embedded-compact/imx6-wec-software/release-details) a new 2D/3D acceleration driver is being provided in the upcoming Q2 2016 release. Will either of the above 2 issues be addressed in that release?

Thank you!

  1. on i.MX6 the CPU and GPU access the same DDR memory, on Intel architectures you may have separate memories for CPU and GPU or a GPU that can access only part of the available memory. I suppose that those functions are not needed on ARM-based devices.
  2. Can you please upload some sample code on share.toradex.com, so we can test the issue?

(now questions, restarting from 1)

  1. GPU driver is provided by Freescale and comes from Vivante.
  2. You can ask here, we will try to reply and collect information from our contacts.
  3. Here, we can’t grant a quick solution, but we will try our best to address your issues
  4. This is a minor update, if you can provide us sample code we can test if the issues are fixed. I don’t see specific comments about those in the release notes.

It’s a long shot, but have you tried generating the lib file yourself?

from a developer command prompt dumpbin /exports libegl.dll > myegl.def

edit the myegl.defs file – add
LIBRARY libEGL.dll
EXPORTS
at the top and remove the information before the function names, and the summary, then

lib /def:myegl.def /out:myegl.lib

Fingers crossed that it wasn’t omitted because it wasn’t implemented.

Cheers

John

I tried and the function is exported by the libEGL.dll we have in the image.
You can generate the lib yourself by installing the binary BSP, the DLL (and all other DLLs involved in openGL) are in the FILES subfolder. In this way you can re-generate import libraries matching the version you are using.

Thanks Valter. I will begin posting each issue separately on this forum so they can be discussed and addressed in isolation. The first of which is here: https://www.toradex.com/community/questions/3683/cant-get-egl-pixmap-surface-to-work-in-wec-2013.html

While this is a clever technique (and one which I may need), I would prefer to have the SDK released with matching .h, .lib, and .dll files so I don’t have to resort to such hackery.

I’ve been playing a little more with this API, and it appears the functions that are not in the .lib files are supposed to be resolved at runtime with functions like eglGetProcAddress. If you look in the eglext.h file, all of those missing functions have alternate prototypes cast to types like EGLAPIENTRYP PFNEGLBEGINCOMPOSITIONMSFTPROC.

However, I don’t see an equivalent function to eglGetProcAddress for gl2ext.h and its functions. Instead, I have resolved those functions at runtime with GetModuleHandle and GetProcAddress from the Win32 API.

Are there any release notes or documentation that accompanies the Microsoft/Freescale/NXP/Vivante release that I can download from somewhere to better understand the intended usage of this library?