kms_cursor_crc: Fix crc readout after a subtest failure
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 22 Nov 2013 21:46:32 +0000 (23:46 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 27 Nov 2013 14:20:09 +0000 (16:20 +0200)
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ä <ville.syrjala@linux.intel.com>
tests/kms_cursor_crc.c

index 4ecc9c8..74da32e 100644 (file)
@@ -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;
                }
        }