• Armin Krezović's avatar
    gl-renderer: Always setup gl-renderer · 28d240f2
    Armin Krezović authored
    Currently, the gl-renderer setup is being done on per-output
    basis. This isn't desirable when trying to make weston run
    with zero outputs.
    
    When there are no outputs present, there is no surface available
    to attach an EGLContext to with eglMakeCurrent, which makes
    any EGL command fail.
    
    The problem is solved by using EGL_KHR_surfaceless_context to
    bind an EGLContext to EGL_NO_SURFACE, or if that is
    unavailable, creating a dummy PbufferSurface and binding an
    EGLContext to it, so EGL gets set up properly.
    
    v2:
    
    - Move PbufferSurface creation into its own function
    - Introduce a new EGLConfig with EGL_PBUFFER_BIT set
      and use it to create a PbufferSurface
    - Make PbufferSurface attributes definition static
    - Check for return of gl_renderer_setup and terminate
      in case it fails
    - Remove redundant gl_renderer_setup call from
      gl_renderer_output_create
    - Only destroy the dummy surface if it is valid
    
    This patch causes a warning from Mesa when using the i965 driver:
    libEGL warning: FIXME: egl/x11 doesn't support front buffer rendering.
    A bug has been filed about it since it seems to be spurious:
    https://bugs.freedesktop.org/show_bug.cgi?id=96694Signed-off-by: default avatarArmin Krezović <krezovic.armin@gmail.com>
    [Pekka: filed a Mesa bug and added the note in commit msg]
    Reviewed-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
    28d240f2
gl-renderer.c 84.3 KB