[igt-dev] [PATCH] tests/kms_plane: Fix skips/fails vs CRC cleanup

Rob Clark robdclark at gmail.com
Wed Oct 11 21:03:52 UTC 2023


From: Rob Clark <robdclark at chromium.org>

test_fini() isn't necessarily called if a subtest skips/fails, leaving
the kernel drm_crtc_crc still in the open state, causing further
attempts to open/configure the crc to fail.

Signed-off-by: Rob Clark <robdclark at chromium.org>
---
 tests/kms_plane.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 9a515559c9b0..b3d6043496b1 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -84,6 +84,8 @@ static color_t blue  = { 0.0f, 0.0f, 1.0f };
 static void test_init(data_t *data, enum pipe pipe)
 {
 	igt_require(data->display.pipes[pipe].n_planes > 0);
+	if (data->pipe_crc)
+		igt_pipe_crc_free(data->pipe_crc);
 	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
 					  IGT_PIPE_CRC_SOURCE_AUTO);
 	igt_display_reset(&data->display);
@@ -92,6 +94,7 @@ static void test_init(data_t *data, enum pipe pipe)
 static void test_fini(data_t *data)
 {
 	igt_pipe_crc_free(data->pipe_crc);
+	data->pipe_crc = NULL;
 }
 
 enum {
-- 
2.41.0



More information about the igt-dev mailing list