summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-02-12 21:10:25 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2015-02-12 21:10:25 +0000
commit35ab0afd04c3d526a26b2ef0d937c25d7eead506 (patch)
tree3bb2054211e850ccde4f7f4bdda642775c6d2228 /test
parent9eb0ab15b1ab09cd6a4e8666b6f488fad1dc36b4 (diff)
test/present: Automatically disable DPMS
DPMS plays havoc with Present timings, make sure the screen doesn't turn off. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'test')
-rw-r--r--test/present-test.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/present-test.c b/test/present-test.c
index ec8db6b3..651df4aa 100644
--- a/test/present-test.c
+++ b/test/present-test.c
@@ -31,6 +31,7 @@
#include <X11/xshmfence.h>
#include <X11/Xutil.h>
#include <X11/Xlibint.h>
+#include <X11/extensions/dpms.h>
#include <X11/extensions/randr.h>
#include <X11/extensions/Xrandr.h>
#include <X11/extensions/Xrender.h>
@@ -220,6 +221,7 @@ static void teardown_msc(Display *dpy, void *q)
{
xcb_unregister_for_special_event(XGetXCBConnection(dpy), q);
}
+
static int test_whole(Display *dpy)
{
xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -1344,6 +1346,7 @@ int main(void)
{
Display *dpy;
Window root;
+ int dummy;
int error = 0;
uint64_t last_msc;
void *queue;
@@ -1355,6 +1358,9 @@ int main(void)
if (!has_present(dpy))
return 77;
+ if (DPMSQueryExtension(dpy, &dummy, &dummy))
+ DPMSDisable(dpy);
+
root = DefaultRootWindow(dpy);
signal(SIGALRM, SIG_IGN);
@@ -1392,5 +1398,7 @@ int main(void)
teardown_msc(dpy, queue);
+ if (DPMSQueryExtension(dpy, &dummy, &dummy))
+ DPMSEnable(dpy);
return !!error;
}