[PATCH xserver 03/10] ephyr: Add a mode for skipping redisplay in glamor.
Eric Anholt
eric at anholt.net
Thu Sep 22 08:45:04 UTC 2016
This speeds up headless testing of Xephyr -glamor with softpipe from
"a test per minute or so" to "a test every few seconds".
Signed-off-by: Eric Anholt <eric at anholt.net>
---
hw/kdrive/ephyr/ephyr_glamor_glx.c | 8 ++++++++
hw/kdrive/ephyr/ephyrinit.c | 7 ++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/hw/kdrive/ephyr/ephyr_glamor_glx.c b/hw/kdrive/ephyr/ephyr_glamor_glx.c
index 2f219141eccc..007123c31e48 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 149ea981ee4d..7632c2643210 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;
--
2.9.3
More information about the xorg-devel
mailing list