Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/intel/i915_fb_tiling: convert to subtest basic-x-tiling
@ 2025-02-17 17:31 Kamil Konieczny
  2025-02-17 21:04 ` ✓ Xe.CI.BAT: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Kamil Konieczny @ 2025-02-17 17:31 UTC (permalink / raw)
  To: igt-dev; +Cc: Kamil Konieczny

Refactor test and create one subtest basic-x-tiling.
It should improve debugs logs in case of fails or skips,
also it shows which format is used for testing.

Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
 tests/intel/i915_fb_tiling.c | 36 +++++++++++++++++++++++-------------
 1 file changed, 23 insertions(+), 13 deletions(-)

diff --git a/tests/intel/i915_fb_tiling.c b/tests/intel/i915_fb_tiling.c
index 849e37164..8d95416f7 100644
--- a/tests/intel/i915_fb_tiling.c
+++ b/tests/intel/i915_fb_tiling.c
@@ -32,28 +32,38 @@
  * Functionality: object tiling
  * Feature: mapping
  *
- * SUBTEST:
+ * SUBTEST: basic-x-tiling
  */
 
 IGT_TEST_DESCRIPTION("Object tiling must be fixed after framebuffer creation.");
 
-igt_simple_main
+igt_main
 {
-	int drm_fd = drm_open_driver_master(DRIVER_INTEL);
+	int drm_fd;
 	struct igt_fb fb;
-	int ret;
 
-	igt_require(gem_available_fences(drm_fd) > 0);
+	igt_fixture {
+		drm_fd = drm_open_driver_master(DRIVER_INTEL);
+		igt_require(gem_available_fences(drm_fd) > 0);
+	}
 
-	igt_create_fb(drm_fd, 512, 512, DRM_FORMAT_XRGB8888,
-		      I915_FORMAT_MOD_X_TILED, &fb);
+	igt_subtest("basic-x-tiling") {
+		int ret, ret2;
 
-	ret = __gem_set_tiling(drm_fd, fb.gem_handle, I915_TILING_X, fb.strides[0]);
-	igt_assert_eq(ret, 0);
+		igt_create_fb(drm_fd, 512, 512, DRM_FORMAT_XRGB8888,
+			      I915_FORMAT_MOD_X_TILED, &fb);
 
-	ret = __gem_set_tiling(drm_fd, fb.gem_handle, I915_TILING_NONE, fb.strides[0]);
-	igt_assert_eq(ret, -EBUSY);
+		ret = __gem_set_tiling(drm_fd, fb.gem_handle, I915_TILING_X, fb.strides[0]);
 
-	igt_remove_fb(drm_fd, &fb);
-	drm_close_driver(drm_fd);
+		if (!ret)
+			ret2 = __gem_set_tiling(drm_fd, fb.gem_handle, I915_TILING_NONE, fb.strides[0]);
+
+		igt_remove_fb(drm_fd, &fb);
+
+		igt_assert_eq(ret, 0);
+		igt_assert_eq(ret2, -EBUSY);
+	}
+
+	igt_fixture
+		drm_close_driver(drm_fd);
 }
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-02-18 15:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-17 17:31 [PATCH i-g-t] tests/intel/i915_fb_tiling: convert to subtest basic-x-tiling Kamil Konieczny
2025-02-17 21:04 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-02-17 21:19 ` ✓ i915.CI.BAT: " Patchwork
2025-02-18  2:26 ` ✗ i915.CI.Full: failure " Patchwork
2025-02-18 15:56   ` Kamil Konieczny
2025-02-18  7:13 ` [PATCH i-g-t] " Sharma, Swati2
2025-02-18 13:45 ` ✗ Xe.CI.Full: failure for " Patchwork
2025-02-18 15:50   ` Kamil Konieczny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox