All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 06/11] tests/kms_big_fb: Move batch creation into lower level functions
Date: Thu,  2 Sep 2021 19:45:03 +0300	[thread overview]
Message-ID: <20210902164508.20104-7-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20210902164508.20104-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

At some point the back creation from moved form the fixture
into each subtest, on account of something going bad between
subtests (not really sure what that was). But when the hw stride
tests were added they stuffed the batch back into the fixture,
and indeed I get a segfault when running this stuff. So let's move
all the batch stuff to the lowe level functions that actually need
it.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_big_fb.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/tests/kms_big_fb.c b/tests/kms_big_fb.c
index 308227c9113a..9e98ed3f9edc 100644
--- a/tests/kms_big_fb.c
+++ b/tests/kms_big_fb.c
@@ -410,6 +410,8 @@ static bool test_pipe(data_t *data)
 				   IGT_CRTC_GAMMA_LUT))
 		return false;
 
+	data->ibb = intel_bb_create(data->drm_fd, 4096);
+
 	mode = igt_output_get_mode(data->output);
 
 	data->width = mode->hdisplay;
@@ -470,6 +472,8 @@ static bool test_pipe(data_t *data)
 
 	igt_remove_fb(data->drm_fd, &data->small_fb);
 
+	intel_bb_destroy(data->ibb);
+
 	return ret;
 }
 
@@ -492,6 +496,8 @@ max_hw_stride_async_flip_test(data_t *data)
 	igt_require_f(igt_display_try_commit2(&data->display, COMMIT_ATOMIC) == 0,
 		      "rotation/flip not supported\n");
 
+	data->ibb = intel_bb_create(data->drm_fd, 4096);
+
 	setup_fb(data, &data->big_fb, data->big_fb_width, data->big_fb_height,
 		 data->format, data->modifier, data->hw_stride);
 	generate_pattern(data, &data->big_fb, 640, 480);
@@ -559,6 +565,9 @@ max_hw_stride_async_flip_test(data_t *data)
 	igt_remove_fb(data->drm_fd, &data->big_fb);
 	igt_remove_fb(data->drm_fd, &data->big_fb_flip[0]);
 	igt_remove_fb(data->drm_fd, &data->big_fb_flip[1]);
+
+	intel_bb_destroy(data->ibb);
+
 	return true;
 }
 
@@ -841,7 +850,6 @@ igt_main
 			data.render_copy = igt_get_render_copyfunc(data.devid);
 
 		data.bops = buf_ops_create(data.drm_fd);
-		data.ibb = intel_bb_create(data.drm_fd, 4096);
 
 		data.planeclearrgb[0] = 0.0;
 		data.planeclearrgb[1] = 0.0;
@@ -862,9 +870,7 @@ igt_main
 		igt_subtest_f("%s-addfb-size-overflow",
 			      modifiers[i].name) {
 			data.modifier = modifiers[i].modifier;
-			data.ibb = intel_bb_create(data.drm_fd, 4096);
 			test_size_overflow(&data);
-			intel_bb_destroy(data.ibb);
 		}
 	}
 
@@ -873,9 +879,7 @@ igt_main
 		igt_subtest_f("%s-addfb-size-offset-overflow",
 			      modifiers[i].name) {
 			data.modifier = modifiers[i].modifier;
-			data.ibb = intel_bb_create(data.drm_fd, 4096);
 			test_size_offset_overflow(&data);
-			intel_bb_destroy(data.ibb);
 		}
 	}
 
@@ -883,9 +887,7 @@ igt_main
 	for (int i = 0; i < ARRAY_SIZE(modifiers); i++) {
 		igt_subtest_f("%s-addfb", modifiers[i].name) {
 			data.modifier = modifiers[i].modifier;
-			data.ibb = intel_bb_create(data.drm_fd, 4096);
 			test_addfb(&data);
-			intel_bb_destroy(data.ibb);
 		}
 	}
 
@@ -905,9 +907,7 @@ igt_main
 					igt_require(data.format == DRM_FORMAT_C8 ||
 						    igt_fb_supported_format(data.format));
 					igt_require(igt_display_has_format_mod(&data.display, data.format, data.modifier));
-					data.ibb = intel_bb_create(data.drm_fd, 4096);
 					test_scanout(&data);
-					intel_bb_destroy(data.ibb);
 				}
 			}
 
-- 
2.31.1

  parent reply	other threads:[~2021-09-02 16:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02 16:44 [igt-dev] [PATCH i-g-t 00/11] kms: Clean up the supported rotations mess Ville Syrjala
2021-09-02 16:44 ` [igt-dev] [PATCH i-g-t 01/11] lib/kms: Add igt_plane_has_rotation() Ville Syrjala
2021-09-02 16:44 ` [igt-dev] [PATCH i-g-t 02/11] tests/kms_rotation_crc: Use igt_plane_has_rotation() Ville Syrjala
2021-09-09 14:59   ` [igt-dev] [PATCH i-g-t v2 02/12] " Ville Syrjala
2021-09-02 16:45 ` [igt-dev] [PATCH i-g-t 03/11] tests/kms_plane_scaling: " Ville Syrjala
2021-09-02 16:45 ` [igt-dev] [PATCH i-g-t 04/11] tests/kms_big_fb: " Ville Syrjala
2021-09-02 16:45 ` [igt-dev] [PATCH i-g-t 05/11] tests/kms_big_fb: Use igt_has_drm_cap() Ville Syrjala
2021-09-02 16:45 ` Ville Syrjala [this message]
2021-09-02 16:45 ` [igt-dev] [PATCH i-g-t 07/11] tests/kms_big_fb: Move format/modifier checks lower Ville Syrjala
2021-09-02 16:45 ` [igt-dev] [PATCH i-g-t 08/11] tests/kms_big_fb: Nuke the stride/format overrides Ville Syrjala
2021-09-02 16:45 ` [igt-dev] [PATCH i-g-t 09/11] tests/kms_big_fb: Check whether the rotation is supposed in the async flip test Ville Syrjala
2021-09-02 16:45 ` [igt-dev] [PATCH i-g-t 10/11] tests/kms_plane: Abstract single vs. multiple crsc better Ville Syrjala
2021-09-02 16:45 ` [igt-dev] [PATCH i-g-t 11/11] tests/kms_plane: Use single colors during extended test Ville Syrjala
2021-09-02 17:48 ` [igt-dev] ✓ Fi.CI.BAT: success for kms: Clean up the supported rotations mess Patchwork
2021-09-02 21:43 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210902164508.20104-7-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.