Xwayland: add "glamor" command line option
This will force Glamor run on GL or GL ES independently from GL version set. Signed-off-by: Konstantin <ria.freelander@gmail.com>
This commit is contained in:
parent
8fd24a121a
commit
f815f682ab
|
@ -1115,7 +1115,7 @@ xwl_glamor_try_gles_api(struct xwl_screen *xwl_screen)
|
|||
EGL_NONE,
|
||||
};
|
||||
|
||||
if (!(xwl_screen->glamor & XWL_GLAMOR_GL))
|
||||
if (!(xwl_screen->glamor & XWL_GLAMOR_GLES))
|
||||
return FALSE;
|
||||
|
||||
eglBindAPI(EGL_OPENGL_ES_API);
|
||||
|
|
|
@ -44,6 +44,8 @@ typedef enum _xwl_egl_backend_flags {
|
|||
typedef enum _xwl_glamor_mode_flags{
|
||||
XWL_GLAMOR_NONE = 0,
|
||||
XWL_GLAMOR_GL = (1 << 0),
|
||||
XWL_GLAMOR_GLES = (1 << 1),
|
||||
XWL_GLAMOR_DEFAULT = XWL_GLAMOR_GL | XWL_GLAMOR_GLES,
|
||||
} xwl_glamor_mode_flags;
|
||||
|
||||
struct xwl_egl_backend {
|
||||
|
|
|
@ -760,7 +760,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
|
|||
#endif
|
||||
|
||||
#ifdef XWL_HAS_GLAMOR
|
||||
xwl_screen->glamor = XWL_GLAMOR_GL;
|
||||
xwl_screen->glamor = XWL_GLAMOR_DEFAULT;
|
||||
#endif
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
|
@ -790,6 +790,18 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
|
|||
ErrorF("Xwayland glamor: this build does not have EGLStream support\n");
|
||||
#endif
|
||||
}
|
||||
#ifdef XWL_HAS_GLAMOR
|
||||
else if (strcmp(argv[i], "-glamor") == 0) {
|
||||
if (strncmp(argv[i + 1], "es", 2) == 0)
|
||||
xwl_screen->glamor = XWL_GLAMOR_GLES;
|
||||
else if (strncmp(argv[i + 1], "gl", 2) == 0)
|
||||
xwl_screen->glamor = XWL_GLAMOR_GL;
|
||||
else if (strncmp(argv[i + 1], "off", 3) == 0)
|
||||
xwl_screen->glamor = XWL_GLAMOR_NONE;
|
||||
else
|
||||
ErrorF("Xwayland glamor: unknown rendering API selected\n");
|
||||
}
|
||||
#endif
|
||||
else if (strcmp(argv[i], "-force-xrandr-emulation") == 0) {
|
||||
xwl_screen->force_xrandr_emulation = 1;
|
||||
}
|
||||
|
|
|
@ -102,6 +102,9 @@ ddxUseMsg(void)
|
|||
ErrorF("-eglstream use eglstream backend for nvidia GPUs\n");
|
||||
#endif
|
||||
ErrorF("-shm use shared memory for passing buffers\n");
|
||||
#ifdef XWL_HAS_GLAMOR
|
||||
ErrorF("-glamor [gl|es|off] use given API for Glamor acceleration. Incompatible with -shm option\n");
|
||||
#endif
|
||||
ErrorF("-verbose [n] verbose startup messages\n");
|
||||
ErrorF("-version show the server version and exit\n");
|
||||
ErrorF("-noTouchPointerEmulation disable touch pointer emulation\n");
|
||||
|
@ -207,6 +210,13 @@ ddxProcessArgument(int argc, char *argv[], int i)
|
|||
else if (strcmp(argv[i], "-shm") == 0) {
|
||||
return 1;
|
||||
}
|
||||
#ifdef XWL_HAS_GLAMOR
|
||||
else if (strcmp(argv[i], "-glamor") == 0) {
|
||||
CHECK_FOR_REQUIRED_ARGUMENTS(1);
|
||||
/* Only check here, actual work inside xwayland-screen.c */
|
||||
return 2;
|
||||
}
|
||||
#endif
|
||||
else if (strcmp(argv[i], "-verbose") == 0) {
|
||||
if (++i < argc && argv[i]) {
|
||||
char *end;
|
||||
|
|
Loading…
Reference in New Issue