[PATCH i-g-t v1 1/2] tests/kms_atomic: Add necessary checks to ensure proper cleanup
Naladala Ramanaidu
ramanaidu.naladala at intel.com
Fri Jan 31 19:16:12 UTC 2025
Stop CRC and free up CRC resources to prevent memory leaks.
Signed-off-by: Naladala Ramanaidu <ramanaidu.naladala at intel.com>
---
tests/kms_atomic.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c
index 489b0d709..8fb26a079 100644
--- a/tests/kms_atomic.c
+++ b/tests/kms_atomic.c
@@ -506,6 +506,10 @@ plane_immutable_zpos(data_t *data, igt_output_t *output, enum pipe pipe, int n_p
DRM_FORMAT_XRGB8888,
DRM_FORMAT_MOD_LINEAR,
0.0, 0.0, 1.0, &fb_lower);
+ if (!fb_id_lower) {
+ igt_pipe_crc_stop(pipe_crc);
+ igt_pipe_crc_free(pipe_crc);
+ }
igt_assert(fb_id_lower);
fb_id_upper = igt_create_color_fb(data->drm_fd,
@@ -513,6 +517,10 @@ plane_immutable_zpos(data_t *data, igt_output_t *output, enum pipe pipe, int n_p
DRM_FORMAT_XRGB8888,
DRM_FORMAT_MOD_LINEAR,
1.0, 1.0, 0.0, &fb_upper);
+ if (!fb_id_upper) {
+ igt_pipe_crc_stop(pipe_crc);
+ igt_pipe_crc_free(pipe_crc);
+ }
igt_assert(fb_id_upper);
/*
@@ -560,6 +568,8 @@ plane_immutable_zpos(data_t *data, igt_output_t *output, enum pipe pipe, int n_p
igt_plane_set_fb(plane_upper, NULL);
}
+ igt_pipe_crc_stop(pipe_crc);
+ igt_pipe_crc_free(pipe_crc);
igt_remove_fb(data->drm_fd, &fb_ref);
igt_remove_fb(data->drm_fd, &fb_lower);
igt_remove_fb(data->drm_fd, &fb_upper);
--
2.25.1
More information about the igt-dev
mailing list