diff --git a/hw/kdrive/ephyr/ephyr_glamor_glx.c b/hw/kdrive/ephyr/ephyr_glamor_glx.c index 2f219141e..007123c31 100644 --- a/hw/kdrive/ephyr/ephyr_glamor_glx.c +++ b/hw/kdrive/ephyr/ephyr_glamor_glx.c @@ -57,6 +57,7 @@ static Display *dpy; static XVisualInfo *visual_info; static GLXFBConfig fb_config; Bool ephyr_glamor_gles2; +Bool ephyr_glamor_skip_present; /** @} */ /** @@ -220,6 +221,13 @@ ephyr_glamor_damage_redisplay(struct ephyr_glamor *glamor, { GLint old_vao; + /* Skip presenting the output in this mode. Presentation is + * expensive, and if we're just running the X Test suite headless, + * nobody's watching. + */ + if (ephyr_glamor_skip_present) + return; + glXMakeCurrent(dpy, glamor->glx_win, glamor->ctx); if (glamor->vao) { diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index 149ea981e..7632c2643 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -36,7 +36,7 @@ extern Bool EphyrWantResize; extern Bool EphyrWantNoHostGrab; extern Bool kdHasPointer; extern Bool kdHasKbd; -extern Bool ephyr_glamor, ephyr_glamor_gles2; +extern Bool ephyr_glamor, ephyr_glamor_gles2, ephyr_glamor_skip_present; extern Bool ephyrNoXV; @@ -148,6 +148,7 @@ ddxUseMsg(void) #ifdef GLAMOR ErrorF("-glamor Enable 2D acceleration using glamor\n"); ErrorF("-glamor_gles2 Enable 2D acceleration using glamor (with GLES2 only)\n"); + ErrorF("-glamor-skip-present Skip presenting the output when using glamor (for internal testing optimization)\n"); #endif ErrorF ("-fakexa Simulate acceleration using software rendering\n"); @@ -288,6 +289,10 @@ ddxProcessArgument(int argc, char **argv, int i) ephyrFuncs.finiAccel = ephyr_glamor_fini; return 1; } + else if (!strcmp (argv[i], "-glamor-skip-present")) { + ephyr_glamor_skip_present = TRUE; + return 1; + } #endif else if (!strcmp(argv[i], "-fakexa")) { ephyrFuncs.initAccel = ephyrDrawInit;