[vlc-commits] [Git][videolan/vlc][master] egl_gbm: fix GBM surface creation with Nvidia drivers

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Thu Feb 1 21:45:22 UTC 2024



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
8f143923 by Pierre Lamot at 2024-02-01T21:20:53+00:00
egl_gbm: fix GBM surface creation with Nvidia drivers

Nvidia proprietary driver don't support creation flags

In the regular scenario (without Nvidia hack), if we allocate the surface
without GBM_BO_USE_RENDERING flag, the eglCreatePlatformWindowSurface (that we
call right after) is supposed to fail.

from https://registry.khronos.org/EGL/extensions/KHR/EGL_KHR_platform_gbm.txt

  To obtain a rendering surface from a GBM surface, call
  eglCreatePlatformWindowSurface with a <dpy> that belongs to the GBM
  platform and a <native_window> that points to a `struct gbm_surface`.
  If <native_window> was created without the GBM_BO_USE_RENDERING flag, or if
  the color format of <native_window> differs from the EGL_NATIVE_VISUAL_ID
  of <config>, then the function fails and generates EGL_BAD_MATCH.

- - - - -


1 changed file:

- modules/video_output/opengl/egl_gbm.c


Changes:

=====================================
modules/video_output/opengl/egl_gbm.c
=====================================
@@ -138,6 +138,17 @@ static EGLSurface CreateSurface(vlc_gl_t* gl, unsigned int width, unsigned int h
         width, height,
         sys->gbm.format,
         GBM_BO_USE_RENDERING | GBM_BO_USE_SCANOUT);
+
+    if (!sys->gbm.surface)
+    {
+        // Nvidia proprietary driver doesn't support creation flags
+        sys->gbm.surface =  gbm_surface_create(
+           sys->gbm.device,
+           width, height,
+           sys->gbm.format,
+           0);
+    }
+
     if (!sys->gbm.surface)
     {
         msg_Err(gl, "can't create gbm surface");



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/8f1439234baf250c767ba2b84139c30b362a7032

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/8f1439234baf250c767ba2b84139c30b362a7032
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list