caramelli / yagears

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

Backend support for DirectFB and Linux framebuffer with GLESv1-CM and GLESv2 as engines #4

Open shengwen-tw opened 1 week ago

shengwen-tw commented 1 week ago

Hi, inspired by the works "Back to the Linux Framebuffer! (2020)" and "Back to DirectFB! (2022)", we are currently developing our RISC-V system simulator, semu, using DirectFB2 as one of the test platforms.

As part of implementing GPU virtualization for our emulator, we require graphics test programs that leverage GPU acceleration. To address this, we began exploring yagears with DirectFB2 as the backend and GLESv1-CM/GLESv2 as the graphics engine.

While we've successfully set up the environment, we have not yet been able to run yagears successfully:

# yagears2 -b egl-directfb -e glesv2

   ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 2.0.0  |~~~~~~~~~~~~~~~~~~~~~~~~~~
        (c) 2017-2023  DirectFB2 Open Source Project (fork of DirectFB)
        (c) 2012-2016  DirectFB integrated media GmbH
        (c) 2001-2016  The world wide DirectFB Open Source Community
        (c) 2000-2004  Convergence (integrated media) GmbH
      ----------------------------------------------------------------
...
[ 1729.633787] virtio-mmio f4400000.virtio: [drm] drm_plane_enable_fb_damage_clips() not called
libEGL warning: invalid EGL_PLATFORM given
libEGL warning: egl: failed to create dri2 screen
libEGL warning: egl: failed to create dri2 screen
eglChooseConfig failed: 0x3000, 0

We are aware that setting the EGL_PLATFORM environment variable is necessary, but it seems both DirectFB and FBDev have been removed from Mesa support.

According to the current Mesa documentation:

The available platforms are x11, wayland, android, and haiku. The android platform can either be built as a system component, part of AOSP, using Android.mk files, or cross-compiled using appropriate options. Unless for special needs, the build system should select the right platforms automatically.

I'm wondering if you could share any insights on the topic?

Thanks!

caramelli commented 1 week ago

Some information on historical OpenGL support for DirectFB: https://github.com/directfb2/DirectFB2/issues/23

To test on my HiGFXback system, I use two implementations:

shengwen-tw commented 3 days ago

Some information on historical OpenGL support for DirectFB: directfb2/DirectFB2#23

To test on my HiGFXback system, I use two implementations:

Hi, thanks for this useful information.

I'm also wondering if it is still possible to run yagears with Linux framebuffer device as you demonstrated in FOSDEM 2020?

caramelli commented 3 days ago

Simply apply the following patch: https://github.com/caramelli/higfxback/blob/master/patches/fb/Mesa-7.11.2.patch The "patch header" contains the configure command that you can call before running make

The generated Mesa implementation can then be used to run yagears on the Linux Framebuffer (either via GLFBDev or via EGL).

shengwen-tw commented 2 days ago

Thanks, we will give it a try.