summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-10-02 17:17:40 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-10-02 17:17:40 +0200
commit66fe119afd1cec2fdd47cec77523b4af2526df47 (patch)
treea4e2a36f8af4a7139c4c813f2e6bc7b85da6704d
parent3441ad29bf82057db814d60f35c146f24c5896b9 (diff)
tests/flip_test: test interaction with panning
Since panning with set_crtc is synchronous, we need to stall for any outstanding pageflips. This new testcase exercise that code. Unfortunately we still need eyes to check whether we don't loose the offset :(
-rw-r--r--tests/flip_test.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/flip_test.c b/tests/flip_test.c
index b9e55c1..57e4a6b 100644
--- a/tests/flip_test.c
+++ b/tests/flip_test.c
@@ -43,6 +43,7 @@
#define TEST_DPMS (1 << 0)
#define TEST_WITH_DUMMY_LOAD (1 << 1)
+#define TEST_PAN (1 << 2)
drmModeRes *resources;
int drm_fd;
@@ -340,6 +341,9 @@ static void flip_mode(struct test_output *o, int crtc, int duration)
width = o->mode.hdisplay;
height = o->mode.vdisplay;
+ if (o->flags & TEST_PAN)
+ width *= 2;
+
o->fb_ids[0] = kmstest_create_fb(drm_fd, width, height, bpp, depth,
false, &o->fb_info[0],
paint_flip_mode, (void *)false);
@@ -407,6 +411,21 @@ static void flip_mode(struct test_output *o, int crtc, int duration)
break;
}
+ /* pan before the flip completes */
+ if (o->flags & TEST_PAN) {
+ int x_ofs = o->count * 10 > o->mode.hdisplay ? o->mode.hdisplay :
+ o->count * 10;
+
+ if (drmModeSetCrtc(drm_fd, o->crtc, o->fb_ids[o->current_fb_id],
+ x_ofs, 0,
+ &o->id, 1, &o->mode)) {
+ fprintf(stderr, "failed to pan (%dx%d@%dHz): %s\n",
+ width, height, o->mode.vrefresh,
+ strerror(errno));
+ exit(7);
+ }
+ }
+
drmHandleEvent(drm_fd, &evctx);
}
@@ -477,6 +496,7 @@ int main(int argc, char **argv)
{ 5, 0 , "plain flip" },
{ 30, TEST_DPMS, "flip vs dpms" },
{ 30, TEST_DPMS | TEST_WITH_DUMMY_LOAD, "delayed flip vs. dpms" },
+ { 5, TEST_PAN, "flip vs panning" },
};
int i;