From: Kamil Konieczny <kamil.konieczny@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
Karthik B S <karthik.b.s@intel.com>
Subject: [PATCH i-g-t] tests/intel/kms_pwrite_crc: Create basic subtest
Date: Mon, 20 Apr 2026 17:07:52 +0200 [thread overview]
Message-ID: <20260420150753.96250-1-kamil.konieczny@linux.intel.com> (raw)
Create a basic subtests which allows to properly cleanup after
any failure or a skip. Also while at this, move an igt header
to proper place.
Cc: Karthik B S <karthik.b.s@intel.com>
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
tests/intel/kms_pwrite_crc.c | 39 +++++++++++++++++++++++-------------
1 file changed, 25 insertions(+), 14 deletions(-)
diff --git a/tests/intel/kms_pwrite_crc.c b/tests/intel/kms_pwrite_crc.c
index bd536007c..92f5292dd 100644
--- a/tests/intel/kms_pwrite_crc.c
+++ b/tests/intel/kms_pwrite_crc.c
@@ -30,15 +30,16 @@
* Mega feature: General Display Features
*/
-#include "igt.h"
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
+#include "igt.h"
+
/**
- * SUBTEST:
+ * SUBTEST: basic
* Description: Use the display CRC support to validate pwrite to an already
* uncached future scanout buffer.
*/
@@ -192,22 +193,32 @@ static void run_test(data_t *data)
igt_skip("no valid crtc/connector combinations found\n");
}
-static data_t data;
+static data_t data = { };
-int igt_simple_main()
+int igt_main()
{
- data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
- kmstest_set_vt_graphics_mode();
+ igt_fixture() {
+ data.drm_fd = -1;
+ data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
+ kmstest_set_vt_graphics_mode();
- igt_display_require(&data.display, data.drm_fd);
- igt_display_require_output(&data.display);
- igt_require_pipe_crc(data.drm_fd);
+ igt_display_require(&data.display, data.drm_fd);
+ igt_display_require_output(&data.display);
+ igt_require_pipe_crc(data.drm_fd);
- data.devid = intel_get_drm_devid(data.drm_fd);
- data.pipe_crc = NULL;
+ data.devid = intel_get_drm_devid(data.drm_fd);
+ data.pipe_crc = NULL;
+ }
- run_test(&data);
+ igt_describe("Use the display CRC support to validate pwrite "
+ "to an already uncached future scanout buffer.");
+ igt_subtest("basic")
+ run_test(&data);
- igt_display_fini(&data.display);
- drm_close_driver(data.drm_fd);
+ igt_fixture() {
+ if (data.drm_fd != -1) {
+ igt_display_fini(&data.display);
+ drm_close_driver(data.drm_fd);
+ }
+ }
}
--
2.53.0
next reply other threads:[~2026-04-20 15:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 15:07 Kamil Konieczny [this message]
2026-04-21 3:28 ` [PATCH i-g-t] tests/intel/kms_pwrite_crc: Create basic subtest Karthik B S
2026-04-21 12:05 ` 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=20260420150753.96250-1-kamil.konieczny@linux.intel.com \
--to=kamil.konieczny@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=karthik.b.s@intel.com \
/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