caramelli / yagears

Yet Another Gears OpenGL / Vulkan demo
MIT License
25 stars 6 forks source link

libEGL warning: failed to find any driver #2

Closed camel007 closed 2 years ago

camel007 commented 2 years ago

As you tell in your ppt:

The Mesa 3D project makes OpenGL and OpenGL ES rendering possible using CPU operations only and the Linux Framebuffer (without requiring a GPU)

my device has arm a53 without gpu. I build mesa-7.11.2 and yagear

    Usage: ./test/yagears2 -b Backend -e Engine

        Backends: egl-fbdev

        Engines:  glesv1_cm

when i run ./test/yagears2 -b egl-fbdev -e glesv1_cm, it gives me:

libEGL warning: failed to find any driver
libEGL warning: failed to find any driver
eglInitialize failed: 0x3001
caramelli commented 2 years ago

Hi,

Be sure that:

But yes, it can be tricky to have a Mesa version correctly built to work with EGL based on the fbdev platform. It would be easier if the fbdev platform was still maintained in Mesa (its support has been removed since version 10.6.0): I'm putting this on my TODO list.

camel007 commented 2 years ago

Thank you! Finally, I run yagears1(EGL with fbdev) on my device successfully. Share my configurations:

environment:

  1. arm53 without mali gpu.
  2. linux kernel 4.14
  3. mesa 7.11.2
  4. yagears-1 branch.

steps:

  1. before execute ./configure, should export CC, CXX.
  2. configuration for mesa:
./configure --prefix=PREFIX --host=aarch64-unknown-linux-gnu --enable-debug --enable-gles1 --enable-gles2 --enable-egl --disable-gbm --enable-shared-glapi --with-egl-platforms=fbdev --with-gallium-drivers=swrast -enable-shared --disable-openvg --enable-gallium-egl --disable-xorg  --disable-glu --disable-glw --enable-opengl CFLAGS=-DMESA_EGL_NO_X11_HEADERS --disable-driglx-direct --with-driver=osmesa
image
  1. modify yagears1
    change the main.c as bellow

    if (!strcmp(backend, "egl-fbdev")) {
    egl_win = eglCreateWindowSurface(egl_dpy, egl_config, (EGLNativeWindowType)fb_win, NULL);
    }

    to.

    if (!strcmp(backend, "egl-fbdev")) {
    egl_win = eglCreateWindowSurface(egl_dpy, egl_config, (EGLNativeWindowType)0, NULL);
    }

    if window is not zero, create window surface wiil fail. mesa has judegement logic in native_fbdev.c

    /* there is only one native window: NULL */
    if (win)
      return NULL;
  2. configuration for yagears1:

    ./configure --host=aarch64-linux-gnu --disable-gl --disable-gl-x11 --disable-gl-directfb --disable-gl-fbdev --disable-egl-x11 --disable-egl-directfb --disable-egl-wayland --disable-egl-drm --disable-egl-rpi --disable-egl-xcb --disable-qt --disable-gtk --disable-sfml --disable-png --with-sysroot=/xxxx/staging
caramelli commented 2 years ago

Great!

I now remember using EGL with the Linux Framebuffer on an embedded system but having a Mali GPU. The proprietary OpenGL implementation allowed to specify an EGLNativeWindowType when calling eglCreateWindowSurface() and I slightly modified the Mesa implementation in order to have the same possibility in Mesa.

But I should work on that again: I'd like to see fbdev platform support in Mesa again.