summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-10-02 17:38:04 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-10-02 19:39:17 +0200
commit87f7dccab69631562fac20aa3fcc2b5762f48f24 (patch)
treecedb0f9ecada6dbda1dd548fb79a513b2407316a
parentef45b4403677ccf6207a3d80528c45f8d3a3f171 (diff)
flip_test: race against modesets, too
Even slower than dpms switching ;-)
-rw-r--r--tests/flip_test.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/flip_test.c b/tests/flip_test.c
index 7f4e880..027ef05 100644
--- a/tests/flip_test.c
+++ b/tests/flip_test.c
@@ -44,6 +44,7 @@
#define TEST_DPMS (1 << 0)
#define TEST_WITH_DUMMY_LOAD (1 << 1)
#define TEST_PAN (1 << 2)
+#define TEST_MODESET (1 << 3)
drmModeRes *resources;
int drm_fd;
@@ -184,6 +185,17 @@ static void page_flip_handler(int fd, unsigned int frame, unsigned int sec,
emit_dummy_load(o);
printf("."); fflush(stdout);
+ if (o->flags & TEST_MODESET) {
+ if (drmModeSetCrtc(drm_fd, o->crtc,
+ o->fb_ids[o->current_fb_id],
+ 0, 0,
+ &o->id, 1, &o->mode)) {
+ fprintf(stderr, "failed to restore output mode: %s\n",
+ strerror(errno));
+ exit(7);
+ }
+ }
+
if (o->flags & TEST_DPMS)
do_or_die(set_dpms(o, DRM_MODE_DPMS_ON));
@@ -193,6 +205,17 @@ static void page_flip_handler(int fd, unsigned int frame, unsigned int sec,
if (o->flags & TEST_DPMS)
do_or_die(set_dpms(o, DRM_MODE_DPMS_OFF));
+ if (o->flags & TEST_MODESET) {
+ if (drmModeSetCrtc(drm_fd, o->crtc,
+ 0, /* no fb */
+ 0, 0,
+ NULL, 0, NULL)) {
+ fprintf(stderr, "failed to disable output: %s\n",
+ strerror(errno));
+ exit(7);
+ }
+ }
+
o->last_flip = now;
}
@@ -502,6 +525,8 @@ int main(int argc, char **argv)
{ 30, TEST_DPMS | TEST_WITH_DUMMY_LOAD, "delayed flip vs. dpms" },
{ 5, TEST_PAN, "flip vs panning" },
{ 30, TEST_PAN | TEST_WITH_DUMMY_LOAD, "delayed flip vs panning" },
+ { 30, TEST_MODESET, "flip vs modeset" },
+ { 30, TEST_MODESET | TEST_WITH_DUMMY_LOAD, "delayed flip vs modeset" },
};
int i;