ephyr: Add a mode for skipping redisplay in glamor

This speeds up headless testing of Xephyr -glamor with softpipe from
"a test per minute or so" to "a test every few seconds".

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Eric Anholt 2016-09-25 13:30:15 -07:00 committed by Adam Jackson
parent 453f813bb4
commit add4979260
2 changed files with 14 additions and 1 deletions

View File

@ -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) {

View File

@ -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;