Apalis imx6 EGL driver causes screen flicker

I am using the Apalis iMX6 module running yocto with 4.14 kernel. I have a display connected to the HDMI output, and am using eglfs.
I want to use psplash to show an image while the main application is starting, and have the main application take over.
I noticed that whenever the main application is started, the screen flickers black for a moment, causing a degradaded UX.
After some digging around, I tracked this down to the fbGetDisplayByIndex(int) function call, defined in EGL/eglvivante.h.
A minimal example that causes this flicker is:

#include <EGL/eglvivante.h>
#include <unistd.h>

int main()
std::cout << “Flicker in 1 second” << std::endl;
std::cout << “Flickered”<<std::endl;
std::cout << “Exit” << std::endl;
return 0;

Can anyone provide any assistance with this? Is there a way to prevent this flicker?

Hello @tlugaric

I think the problem is, that this function fbGetDisplayByIndex will reconfigure the display. If one just does this fbGetDisplayByIndex, he will get a framebuffer for that display and it will probably show black because there is no data in the framebuffer.
I’m not sure if it is easily possible to avoid that. Maybe you could try to do something with multi buffer or switch to the mainline driver (etnaviv) with KMS support. However, I must warn you of the new problems appearing with that kind of a switch.

If you still like to check multi buffer support, you can have a look at this document:

I hope this helps!