kms: Check for EGL_KHR_surfaceless_opengl extension

This adds a check for the EGL_KHR_surfaceless_opengl extension which we
depend on for being able to MakeCurrent (NO_SURFACE) as well as create a
context without and EGLConfig.

Reviewed-by: Rob Bradford <rob@linux.intel.com>
This commit is contained in:
Robert Bragg 2011-11-28 16:22:46 +00:00
parent 7a91c91994
commit aa6433d8c5
3 changed files with 16 additions and 1 deletions

View File

@ -88,3 +88,8 @@ COGL_WINSYS_FEATURE_FUNCTION (EGLBoolean, eglUnbindWaylandDisplay,
struct wl_display *wayland_display)) struct wl_display *wayland_display))
COGL_WINSYS_FEATURE_END () COGL_WINSYS_FEATURE_END ()
#endif #endif
COGL_WINSYS_FEATURE_BEGIN (surfaceless_opengl,
"KHR\0",
"surfaceless_opengl\0",
COGL_EGL_WINSYS_FEATURE_SURFACELESS_OPENGL)
COGL_WINSYS_FEATURE_END ()

View File

@ -33,7 +33,8 @@ typedef enum _CoglEGLWinsysFeature
{ {
COGL_EGL_WINSYS_FEATURE_SWAP_REGION =1L<<0, COGL_EGL_WINSYS_FEATURE_SWAP_REGION =1L<<0,
COGL_EGL_WINSYS_FEATURE_EGL_IMAGE_FROM_X11_PIXMAP =1L<<1, COGL_EGL_WINSYS_FEATURE_EGL_IMAGE_FROM_X11_PIXMAP =1L<<1,
COGL_EGL_WINSYS_FEATURE_EGL_IMAGE_FROM_WAYLAND_BUFFER =1L<<2 COGL_EGL_WINSYS_FEATURE_EGL_IMAGE_FROM_WAYLAND_BUFFER =1L<<2,
COGL_EGL_WINSYS_FEATURE_SURFACELESS_OPENGL =1L<<3
} CoglEGLWinsysFeature; } CoglEGLWinsysFeature;
typedef struct _CoglRendererEGL typedef struct _CoglRendererEGL

View File

@ -120,6 +120,15 @@ _cogl_winsys_kms_display_setup (CoglDisplay *display, GError **error)
drmModeEncoder *encoder; drmModeEncoder *encoder;
int i; int i;
if (!(egl_renderer->private_features &
COGL_EGL_WINSYS_FEATURE_SURFACELESS_OPENGL))
{
g_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_INIT,
"EGL_KHR_surfaceless_opengl extension not available");
return FALSE;
}
resources = drmModeGetResources (kms_renderer->fd); resources = drmModeGetResources (kms_renderer->fd);
if (!resources) if (!resources)
{ {