This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

EGL on GNU/Linux framebuffer: eglSwapInterval() has no effect.

Hi there,

I'm using MALI EGL/GLES driver with kernel 3.4.-67 cloned from here: linux-sunxi/linux-sunxi

I cloned the MALI driver from here: linux-sunxi/sunxi-mali

I configured, built and installed like this:

git clone https://github.com/linux-sunxi/sunxi-mali.git

cd sunxi-mali

git submodule init

git submodule update

make config ABI=armhf EGL_TYPE=framebuffer

make

sudo make install

The resulting version seems to be "r3p0".

Please NOTE that I'm using the framebuffer EGL implementation, NOT the X11 EGL. In this case, X11 is NOT an option.

EGL/GLESv2 examples seem to work fine. However, when it comes to screen refresh in my own projects, tearing is visible.

This is how I swap EGL buffers in my code:

static void gfx_ctx_swap_buffers(void)

{

       eglSwapBuffers(g_egl_dpy, g_egl_surf);

}

According to Khronos Group docs, eglSwapBuffers should wait for vsync. This is very clear if we read the eglSwapInterval() documentation:

eglSwapInterval

According to these docs, the swap interval is "1" by default, hence waiting for 1 complete frame to be shown before showing the next. There should be no tearing at all.

I even tried specifying this in my EGL init code:

if ( eglSwapInterval(g_egl_dpy,1) != EGL_TRUE ){

      printf("\neglSwapInterval failed.\n");

      goto error;

}

...but there's still tearing to be seen.

I can, of course, use the FBIO_WAITFORVYSNC ioctl before calling eglSwapBuffers(), but that's a blocking call that will take the application to it's knees. This is not a solution.

What I think is that swap interval is NOT respected on the EGL-on-framebuffer implementation. Is there any possibility to fix it at all? Without this, we'll have to say goodbye to MALI for this project

Thanks!