From 0699dc725925d36f49b833735c21f19f7cf498aa Mon Sep 17 00:00:00 2001 From: Imre Deak Date: Wed, 10 Oct 2012 14:47:51 +0300 Subject: [PATCH] flip_test: move output panning inside the flip_handler Move the panning to a more logical place where the rest of the test steps are performed. As Daniel Vetter pointed it out, the proper place is _after_ the flip command is sent, so that fb_set_base correctly waits for any outstanding flip. So move the function between the flip and the dpms/modeset off calls. Signed-off-by: Imre Deak --- tests/flip_test.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/tests/flip_test.c b/tests/flip_test.c index 66dcc30c..bf9f9be2 100644 --- a/tests/flip_test.c +++ b/tests/flip_test.c @@ -250,6 +250,20 @@ static void page_flip_handler(int fd, unsigned int frame, unsigned int sec, if (o->flags & TEST_EBUSY) assert(do_page_flip(o, new_fb_id) == -EBUSY); + /* 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", + o->fb_width, o->fb_height, + o->mode.vrefresh, strerror(errno)); + exit(7); + } + } + if (o->flags & TEST_DPMS) do_or_die(set_dpms(o, DRM_MODE_DPMS_OFF)); @@ -481,21 +495,6 @@ 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", - o->fb_width, o->fb_height, - o->mode.vrefresh, strerror(errno)); - exit(7); - } - } - do_or_die(drmHandleEvent(drm_fd, &evctx)); }