Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kamil Konieczny <kamil.konieczny@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Subject: [PATCH i-g-t] tests/intel/i915_fb_tiling: convert to subtest basic-x-tiling
Date: Mon, 17 Feb 2025 18:31:49 +0100	[thread overview]
Message-ID: <20250217173149.157360-1-kamil.konieczny@linux.intel.com> (raw)

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


             reply	other threads:[~2025-02-17 17:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-17 17:31 Kamil Konieczny [this message]
2025-02-17 21:04 ` ✓ Xe.CI.BAT: success for tests/intel/i915_fb_tiling: convert to subtest basic-x-tiling 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

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=20250217173149.157360-1-kamil.konieczny@linux.intel.com \
    --to=kamil.konieczny@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox