From: Kunal Joshi <kunal1.joshi@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Kunal Joshi <kunal1.joshi@intel.com>
Subject: [PATCH i-g-t 3/6] tests/kms_pipe_crc_basic: Use cleanup framework for framebuffers
Date: Mon, 2 Feb 2026 14:15:36 +0530 [thread overview]
Message-ID: <20260202084539.2524306-4-kunal1.joshi@intel.com> (raw)
In-Reply-To: <20260202084539.2524306-1-kunal1.joshi@intel.com>
Register framebuffers with igt_cleanup_register_fb() after creation.
The exit handler will automatically clean up registered framebuffers
on test exit, including early exits from failures, skips, or assertions.
Remove manual igt_remove_fb() calls at end of test functions since
the cleanup framework handles this automatically.
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
---
tests/kms_pipe_crc_basic.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index fb2f5f8eb..455b44d38 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -32,6 +32,7 @@
#include "igt.h"
#include "igt_sysfs.h"
+#include "igt_cleanup.h"
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
@@ -158,6 +159,7 @@ static void test_read_crc(data_t *data, enum pipe pipe,
colors[c].g,
colors[c].b,
&data->fb);
+ igt_cleanup_register_fb(data->drm_fd, &data->fb);
igt_plane_set_fb(primary, &data->fb);
@@ -258,11 +260,14 @@ static void test_compare_crc(data_t *data, enum pipe pipe, igt_output_t *output,
DRM_FORMAT_MOD_LINEAR,
1.0, 1.0, 1.0,
&fb0);
+ igt_cleanup_register_fb(data->drm_fd, &fb0);
+
igt_create_color_fb(data->drm_fd,
mode->hdisplay, mode->vdisplay, plane_format,
DRM_FORMAT_MOD_LINEAR,
1.0, 1.0, 1.0,
&fb1);
+ igt_cleanup_register_fb(data->drm_fd, &fb1);
/* Flip FB0 with the primary plane & collect the CRC as ref CRC. */
igt_plane_set_fb(primary, &fb0);
@@ -284,9 +289,6 @@ static void test_compare_crc(data_t *data, enum pipe pipe, igt_output_t *output,
igt_plane_set_fb(primary, NULL);
igt_output_set_crtc(output, NULL);
igt_display_commit(display);
-
- igt_remove_fb(data->drm_fd, &fb0);
- igt_remove_fb(data->drm_fd, &fb1);
}
static void test_disable_crc_after_crtc(data_t *data, enum pipe pipe,
@@ -310,6 +312,7 @@ static void test_disable_crc_after_crtc(data_t *data, enum pipe pipe,
DRM_FORMAT_XRGB8888,
DRM_FORMAT_MOD_LINEAR,
0.0, 1.0, 0.0, &data->fb);
+ igt_cleanup_register_fb(data->drm_fd, &data->fb);
primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
igt_plane_set_fb(primary, &data->fb);
@@ -332,7 +335,6 @@ static void test_disable_crc_after_crtc(data_t *data, enum pipe pipe,
igt_plane_set_fb(primary, NULL);
igt_output_set_crtc(output, NULL);
igt_display_commit(display);
- igt_remove_fb(data->drm_fd, &data->fb);
}
static bool pipe_output_combo_valid(igt_display_t *display,
--
2.43.0
next prev parent reply other threads:[~2026-02-02 8:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-02 8:45 [PATCH i-g-t 0/6] tests/kms_pipe_crc_basic: add mst suspend-resume test Kunal Joshi
2026-02-02 8:45 ` [PATCH i-g-t 1/6] tests/intel/kms_mst_helper: Add helper to check for MST outputs Kunal Joshi
2026-02-02 8:45 ` [PATCH i-g-t 2/6] lib/igt_cleanup: Add general resource cleanup infrastructure Kunal Joshi
2026-02-02 8:45 ` Kunal Joshi [this message]
2026-02-02 8:45 ` [PATCH i-g-t 4/6] tests/kms_pipe_crc_basic: Use cleanup framework for pipe CRC Kunal Joshi
2026-02-02 8:45 ` [PATCH i-g-t 5/6] tests/kms_pipe_crc_basic: Use cleanup framework for drm_fd Kunal Joshi
2026-02-02 8:45 ` [PATCH i-g-t 6/6] tests/kms_pipe_crc_basic: Add MST suspend-resume test Kunal Joshi
2026-02-04 10:40 ` Bilal, Mohammed
2026-02-03 0:13 ` ✓ Xe.CI.BAT: success for tests/kms_pipe_crc_basic: add mst suspend-resume test (rev3) Patchwork
2026-02-03 0:19 ` ✓ i915.CI.BAT: " Patchwork
2026-02-03 7:54 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-02-03 8:55 ` ✗ i915.CI.Full: " 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=20260202084539.2524306-4-kunal1.joshi@intel.com \
--to=kunal1.joshi@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