gl-renderer: add EGL surfaceless platform support

This allows passing EGL_PLATFORM_SURFACELESS_MESA to
gl_renderer_display_create(). It is not useful on its own, because the
surfaceless platform has no window surfaces.

This feature will be used by the headless backend.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
dev
Pekka Paalanen 5 years ago committed by Pekka Paalanen
parent 53b7fd70b8
commit ecdf50d38e
  1. 6
      libweston/renderer-gl/gl-renderer.c
  2. 5
      shared/weston-egl-ext.h

@ -3303,6 +3303,8 @@ platform_to_extension(EGLenum platform)
return "wayland";
case EGL_PLATFORM_X11_KHR:
return "x11";
case EGL_PLATFORM_SURFACELESS_MESA:
return "surfaceless";
default:
assert(0 && "bad EGL platform enum");
}
@ -3369,6 +3371,10 @@ gl_renderer_display_create(struct weston_compositor *ec,
return -1;
}
/* Surfaceless is unusable without platform_base extension */
if (supports == 0 && platform == EGL_PLATFORM_SURFACELESS_MESA)
return -1;
gr = zalloc(sizeof *gr);
if (gr == NULL)
return -1;

@ -176,6 +176,10 @@ typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLD
#define EGL_PLATFORM_X11_KHR 0x31D5
#endif
#ifndef EGL_PLATFORM_SURFACELESS_MESA
#define EGL_PLATFORM_SURFACELESS_MESA 0x31DD
#endif
#ifndef EGL_KHR_cl_event2
#define EGL_KHR_cl_event2 1
typedef void *EGLSyncKHR;
@ -210,6 +214,7 @@ typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy,
#define EGL_PLATFORM_GBM_KHR 0x31D7
#define EGL_PLATFORM_WAYLAND_KHR 0x31D8
#define EGL_PLATFORM_X11_KHR 0x31D5
#define EGL_PLATFORM_SURFACELESS_MESA 0x31DD
#endif /* ENABLE_EGL */

Loading…
Cancel
Save