From 3d371a7284798c96bb033a449acbad7cc29c2e29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Fri, 22 Nov 2013 23:46:32 +0200 Subject: [PATCH] kms_cursor_crc: Fix crc readout after a subtest failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a subtest fails, it'll leave the pipe CRC file open, which will prevent subsequent subtests from opening the file. Make sure the file is cloesed before trying to open it again. Signed-off-by: Ville Syrjälä --- tests/kms_cursor_crc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c index 4ecc9c82..74da32eb 100644 --- a/tests/kms_cursor_crc.c +++ b/tests/kms_cursor_crc.c @@ -238,6 +238,9 @@ static bool prepare_crtc(test_data_t *test_data, uint32_t connector_id) connector_set_mode(data, &connector, &connector.config.default_mode); + igt_pipe_crc_free(data->pipe_crc[test_data->crtc_idx]); + data->pipe_crc[test_data->crtc_idx] = NULL; + pipe_crc = create_crc(data, test_data->crtc_idx); if (!pipe_crc) { printf("auto crc not supported on this connector with crtc %i\n", @@ -299,6 +302,7 @@ static void run_test(data_t *data, enum cursor_type cursor_type, bool onscreen) igt_subtest_name(), test_data.crtc_id, connector_id); igt_pipe_crc_free(data->pipe_crc[test_data.crtc_idx]); + data->pipe_crc[test_data.crtc_idx] = NULL; } }