diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-09-02 13:50:56 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-09-02 13:53:29 +0100 |
commit | 472c9dac034479fe5c740a33022fbb19e4dbe381 (patch) | |
tree | fdaaa717110b0fa670c3888d821e19cf93a244c5 | |
parent | 6f118bf96a4d7236f8324dd53cf0c85390605bb0 (diff) |
kms_flip: Fix use of fb_width for PAN subtests
We need to be careful to remember that fb-width is not always the same
as hdisplay, since for panning we allocate a larger framebuffer. So fix
up the printfs to use hdisplay/vsisplay since that should be uniform
across the array.
Regression from
commit 919d68901187fa797a9b648fcf87c838fae22fa3
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Aug 29 15:33:53 2013 +0100
kms_flips: Operate on an array of crtc
Buzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68832
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | tests/kms_flip.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/kms_flip.c b/tests/kms_flip.c index 55c45099..5103bf76 100644 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -848,12 +848,12 @@ static unsigned int run_test_step(struct test_output *o) if (o->flags & TEST_PAN) { int count = do_flip ? o->flip_state.count : o->vblank_state.count; - int x_ofs = count * 10 > o->fb_width ? o->fb_width : count * 10; + int x_ofs = count * 10 > o->fb_width - o->kmode[0].hdisplay ? o->fb_width - o->kmode[0].hdisplay : count * 10; if (set_mode(o, o->fb_ids[o->current_fb_id], x_ofs, 0)){ - fprintf(stderr, "failed to pan (%dx%d@%dHz): %s\n", - o->fb_width, o->fb_height, - o->kmode[0].vrefresh, strerror(errno)); + fprintf(stderr, "failed to pan (%dx%d@%dHz)+%d: %s\n", + o->kmode[0].hdisplay, o->kmode[0].vdisplay, o->kmode[0].vrefresh, + x_ofs, strerror(errno)); igt_fail(7); } } @@ -923,7 +923,6 @@ static void connector_find_preferred_mode(uint32_t connector_id, int crtc_idx, o->fb_width = o->kmode[0].hdisplay; o->fb_height = o->kmode[0].vdisplay; - } static bool mode_compatible(const drmModeModeInfo *a, const drmModeModeInfo *b) @@ -1148,7 +1147,7 @@ static void run_test_on_crtc(struct test_output *o, int crtc_idx, int duration) igt_subtest_name(), o->_crtc[0], o->_connector[0]); if (o->flags & TEST_PAN) - o->fb_width *= 2; + o->fb_width <<= 1; o->fb_ids[0] = kmstest_create_fb(drm_fd, o->fb_width, o->fb_height, o->bpp, o->depth, false, &o->fb_info[0]); @@ -1156,7 +1155,6 @@ static void run_test_on_crtc(struct test_output *o, int crtc_idx, int duration) o->bpp, o->depth, false, &o->fb_info[1]); o->fb_ids[2] = kmstest_create_fb(drm_fd, o->fb_width, o->fb_height, o->bpp, o->depth, true, &o->fb_info[2]); - if (!o->fb_ids[0] || !o->fb_ids[1] || !o->fb_ids[2]) { fprintf(stderr, "failed to create fbs\n"); igt_fail(3); @@ -1175,7 +1173,7 @@ static void run_test_on_crtc(struct test_output *o, int crtc_idx, int duration) */ if (0) { fprintf(stderr, "failed to set mode (%dx%d@%dHz): %s\n", - o->fb_width, o->fb_height, o->kmode[0].vrefresh, + o->kmode[0].hdisplay, o->kmode[0].vdisplay, o->kmode[0].vrefresh, strerror(errno)); } goto out; @@ -1246,7 +1244,6 @@ static void run_test_on_crtc_pair(struct test_output *o, int crtc_idx0, int crtc o->bpp, o->depth, false, &o->fb_info[1]); o->fb_ids[2] = kmstest_create_fb(drm_fd, o->fb_width, o->fb_height, o->bpp, o->depth, true, &o->fb_info[2]); - if (!o->fb_ids[0] || !o->fb_ids[1] || !o->fb_ids[2]) { fprintf(stderr, "failed to create fbs\n"); igt_fail(3); @@ -1266,7 +1263,7 @@ static void run_test_on_crtc_pair(struct test_output *o, int crtc_idx0, int crtc */ if (0) { fprintf(stderr, "failed to set mode (%dx%d@%dHz): %s\n", - o->fb_width, o->fb_height, o->kmode[0].vrefresh, + o->kmode[0].hdisplay, o->kmode[0].vdisplay, o->kmode[0].vrefresh, strerror(errno)); } goto out; |