Skip to content
Snippets Groups Projects
Commit 8f143923 authored by Pierre Lamot's avatar Pierre Lamot Committed by Jean-Baptiste Kempf
Browse files

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.
parent a63946b5
No related branches found
No related tags found
1 merge request!4868egl_gbm: fix gbm surface creation with NVidia drivers
Pipeline #433071 passed with stage
in 13 minutes and 53 seconds
......@@ -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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment