From 2238361afbfee71827e2ee6e71fc43f1a39dcefe Mon Sep 17 00:00:00 2001 From: Ville Syrjälä Date: Tue, 17 Jul 2018 18:32:38 +0300 Subject: lib/igt_fb: Pass around igt_fb internally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of passing around a boatload of integers everywhere let's just pass around the igt_fb struct. That obviously means we have to populate it first sufficiently, to which end we'll add a small helper. Later on the stride/size calculations will consult the already pre-populated igt_fb and fill in the rest as needed. This makes the whole thing a lot less error prone as it's impossible to accidentally pass the arguments in the wrong order when there's just the one of them, and it's a pointer. v2: Rebase due to uint64_t size Cc: Paulo Zanoni Signed-off-by: Ville Syrjälä Reviewed-by: Paulo Zanoni --- tests/kms_frontbuffer_tracking.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/kms_frontbuffer_tracking.c') diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index 1bce6760..265c313a 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -1157,7 +1157,7 @@ static void start_busy_thread(struct igt_fb *fb) busy_thread.stop = false; busy_thread.handle = fb->gem_handle; busy_thread.size = fb->size; - busy_thread.stride = fb->stride; + busy_thread.stride = fb->strides[0]; busy_thread.width = fb->width; busy_thread.height = fb->height; busy_thread.color = pick_color(fb, COLOR_PRIM_BG); @@ -2859,7 +2859,7 @@ static void badstride_subtest(const struct test_mode *t) create_fb(t->format, params->primary.fb->width + 4096, params->primary.fb->height, opt.tiling, t->plane, &wide_fb); - igt_assert(wide_fb.stride > 16384); + igt_assert(wide_fb.strides[0] > 16384); fill_fb(&wide_fb, COLOR_PRIM_BG); @@ -2928,7 +2928,7 @@ static void stridechange_subtest(const struct test_mode *t) opt.tiling, t->plane, &new_fb); fill_fb(&new_fb, COLOR_PRIM_BG); - igt_assert(old_fb->stride != new_fb.stride); + igt_assert(old_fb->strides[0] != new_fb.strides[0]); /* We can't assert that FBC will be enabled since there may not be * enough space for the CFB, but we can check the CRC. */ -- cgit v1.2.3