kms: Check for the right surfaceless extension depending on driver
There are three separate EGL_KHR_surfaceless_* extensions depending on which GL API is being used so we should probably check the right one depending on which driver Cogl has selected. Reviewed-by: Robert Bragg <robert@linux.intel.com>
This commit is contained in:
parent
7adf7c5e38
commit
889e4aba9c
@ -93,3 +93,13 @@ COGL_WINSYS_FEATURE_BEGIN (surfaceless_opengl,
|
||||
"surfaceless_opengl\0",
|
||||
COGL_EGL_WINSYS_FEATURE_SURFACELESS_OPENGL)
|
||||
COGL_WINSYS_FEATURE_END ()
|
||||
COGL_WINSYS_FEATURE_BEGIN (surfaceless_gles1,
|
||||
"KHR\0",
|
||||
"surfaceless_gles1\0",
|
||||
COGL_EGL_WINSYS_FEATURE_SURFACELESS_GLES1)
|
||||
COGL_WINSYS_FEATURE_END ()
|
||||
COGL_WINSYS_FEATURE_BEGIN (surfaceless_gles2,
|
||||
"KHR\0",
|
||||
"surfaceless_gles2\0",
|
||||
COGL_EGL_WINSYS_FEATURE_SURFACELESS_GLES2)
|
||||
COGL_WINSYS_FEATURE_END ()
|
||||
|
@ -45,7 +45,9 @@ typedef enum _CoglEGLWinsysFeature
|
||||
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_WAYLAND_BUFFER =1L<<2,
|
||||
COGL_EGL_WINSYS_FEATURE_SURFACELESS_OPENGL =1L<<3
|
||||
COGL_EGL_WINSYS_FEATURE_SURFACELESS_OPENGL =1L<<3,
|
||||
COGL_EGL_WINSYS_FEATURE_SURFACELESS_GLES1 =1L<<4,
|
||||
COGL_EGL_WINSYS_FEATURE_SURFACELESS_GLES2 =1L<<5
|
||||
} CoglEGLWinsysFeature;
|
||||
|
||||
typedef struct _CoglRendererEGL
|
||||
|
@ -115,17 +115,35 @@ _cogl_winsys_kms_display_setup (CoglDisplay *display, GError **error)
|
||||
CoglDisplayKMS *kms_display = &egl_display->kms_display;
|
||||
CoglRendererEGL *egl_renderer = display->renderer->winsys;
|
||||
CoglRendererKMS *kms_renderer = &egl_renderer->kms_renderer;
|
||||
CoglEGLWinsysFeature surfaceless_feature = 0;
|
||||
const char *surfaceless_feature_name = "";
|
||||
drmModeRes *resources;
|
||||
drmModeConnector *connector;
|
||||
drmModeEncoder *encoder;
|
||||
int i;
|
||||
|
||||
if (!(egl_renderer->private_features &
|
||||
COGL_EGL_WINSYS_FEATURE_SURFACELESS_OPENGL))
|
||||
switch (display->renderer->driver)
|
||||
{
|
||||
case COGL_DRIVER_GL:
|
||||
surfaceless_feature = COGL_EGL_WINSYS_FEATURE_SURFACELESS_OPENGL;
|
||||
surfaceless_feature_name = "opengl";
|
||||
break;
|
||||
case COGL_DRIVER_GLES1:
|
||||
surfaceless_feature = COGL_EGL_WINSYS_FEATURE_SURFACELESS_GLES1;
|
||||
surfaceless_feature_name = "gles1";
|
||||
break;
|
||||
case COGL_DRIVER_GLES2:
|
||||
surfaceless_feature = COGL_EGL_WINSYS_FEATURE_SURFACELESS_GLES2;
|
||||
surfaceless_feature_name = "gles2";
|
||||
break;
|
||||
}
|
||||
|
||||
if (!(egl_renderer->private_features & surfaceless_feature))
|
||||
{
|
||||
g_set_error (error, COGL_WINSYS_ERROR,
|
||||
COGL_WINSYS_ERROR_INIT,
|
||||
"EGL_KHR_surfaceless_opengl extension not available");
|
||||
"EGL_KHR_surfaceless_%s extension not available",
|
||||
surfaceless_feature_name);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user