diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-12-13 21:30:43 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-12-17 15:30:53 +0100 |
commit | df41e1a6bbe75f047e83bb543e0b0564ed10862b (patch) | |
tree | 979993012ec49da007c11583e00e20c7d250b02f | |
parent | 8ed0112f88a8738d3e813428e5045333a6e07fbf (diff) |
flip_test: recreate fb
... to test the latency of rmfb, getfb and addfb. Since if those still
can cause spikes, we have a problem.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | tests/flip_test.c | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/tests/flip_test.c b/tests/flip_test.c index c3615e1fb..2b0346c35 100644 --- a/tests/flip_test.c +++ b/tests/flip_test.c @@ -55,2 +55,3 @@ #define TEST_VBLANK_EXPIRED_SEQ (1 << 11) +#define TEST_FB_RECREATE (1 << 12) @@ -117,2 +118,3 @@ struct test_output { unsigned int fb_ids[2]; + int bpp, depth; struct kmstest_fb fb_info[2]; @@ -466,2 +468,24 @@ static void check_all_state(struct test_output *o, +static void recreate_fb(struct test_output *o) +{ + drmModeFBPtr r; + struct kmstest_fb *fb_info = &o->fb_info[o->current_fb_id]; + uint32_t new_fb_id; + + /* Call rmfb/getfb/addfb to ensure those don't introduce stalls */ + r = drmModeGetFB(drm_fd, fb_info->fb_id); + assert(r); + + do_or_die(drmModeAddFB(drm_fd, o->fb_width, o->fb_height, o->depth, + o->bpp, fb_info->stride, + r->handle, &new_fb_id)); + + drmFree(r); + gem_close(drm_fd, r->handle); + do_or_die(drmModeRmFB(drm_fd, fb_info->fb_id)); + + o->fb_ids[o->current_fb_id] = new_fb_id; + o->fb_info[o->current_fb_id].fb_id = new_fb_id; +} + /* Return mask of completed events. */ @@ -496,2 +520,4 @@ static unsigned int run_test_step(struct test_output *o) o->current_fb_id = !o->current_fb_id; + if (o->flags & TEST_FB_RECREATE) + recreate_fb(o); new_fb_id = o->fb_ids[o->current_fb_id]; @@ -832,5 +858,7 @@ static void run_test_on_crtc(struct test_output *o, int crtc, int duration) { - int bpp = 32, depth = 24; unsigned ellapsed; + o->bpp = 32; + o->depth = 24; + connector_find_preferred_mode(o, crtc); @@ -848,7 +876,7 @@ static void run_test_on_crtc(struct test_output *o, int crtc, int duration) - o->fb_ids[0] = kmstest_create_fb(drm_fd, o->fb_width, o->fb_height, bpp, - depth, false, &o->fb_info[0], + o->fb_ids[0] = kmstest_create_fb(drm_fd, o->fb_width, o->fb_height, + o->bpp, o->depth, false, &o->fb_info[0], paint_flip_mode, (void *)false); - o->fb_ids[1] = kmstest_create_fb(drm_fd, o->fb_width, o->fb_height, bpp, - depth, false, &o->fb_info[1], + o->fb_ids[1] = kmstest_create_fb(drm_fd, o->fb_width, o->fb_height, + o->bpp, o->depth, false, &o->fb_info[1], paint_flip_mode, (void *)true); @@ -987,2 +1015,4 @@ int main(int argc, char **argv) { 15, TEST_FLIP | TEST_CHECK_TS | TEST_EBUSY , "plain-flip-ts-check" }, + { 15, TEST_FLIP | TEST_CHECK_TS | TEST_EBUSY | TEST_FB_RECREATE, + "plain-flip-fb-recreate" }, { 30, TEST_FLIP | TEST_DPMS | TEST_EINVAL, "flip-vs-dpms" }, |