diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2014-05-13 13:38:20 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2014-05-13 15:14:21 +0300 |
commit | d2d0a96eca2e63a7ec75fd15b81808c42ae796b7 (patch) | |
tree | b0b58acc1de4af8e0cebe8a1c100d3f4ef63fe39 /tests/kms_fbc_crc.c | |
parent | 126b8ba72f6a6f017819e00dc2b37a7c6549a143 (diff) |
tests/kms_fbc_crc: Simplify pipe_crc mess
There's no need to keep an array of pipe_crc objects around. Just keep
one for the duration of the specific crtc/connector/test combo.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/kms_fbc_crc.c')
-rw-r--r-- | tests/kms_fbc_crc.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c index 4013510e..f415bd04 100644 --- a/tests/kms_fbc_crc.c +++ b/tests/kms_fbc_crc.c @@ -58,7 +58,7 @@ typedef struct { int drm_fd; drmModeRes *resources; igt_crc_t ref_crc[2]; - igt_pipe_crc_t **pipe_crc; + igt_pipe_crc_t *pipe_crc; drm_intel_bufmgr *bufmgr; drm_intel_context *ctx[2]; uint32_t devid; @@ -136,13 +136,10 @@ static void display_init(data_t *data) { data->resources = drmModeGetResources(data->drm_fd); igt_assert(data->resources); - - data->pipe_crc = calloc(data->resources->count_crtcs, sizeof(data->pipe_crc[0])); } static void display_fini(data_t *data) { - free(data->pipe_crc); } static void fill_blt(data_t *data, uint32_t handle, unsigned char color) @@ -249,7 +246,7 @@ static bool fbc_enabled(data_t *data) static void test_crc(data_t *data, enum test_mode mode) { - igt_pipe_crc_t *pipe_crc = data->pipe_crc[data->crtc_idx]; + igt_pipe_crc_t *pipe_crc = data->pipe_crc; igt_crc_t *crcs = NULL; uint32_t handle = data->handle[0]; @@ -376,8 +373,8 @@ static bool prepare_test(data_t *data, enum test_mode mode) return false; } - igt_pipe_crc_free(data->pipe_crc[data->crtc_idx]); - data->pipe_crc[data->crtc_idx] = NULL; + igt_pipe_crc_free(data->pipe_crc); + data->pipe_crc = NULL; pipe_crc = igt_pipe_crc_new(data->crtc_idx, INTEL_PIPE_CRC_SOURCE_AUTO); @@ -388,7 +385,7 @@ static bool prepare_test(data_t *data, enum test_mode mode) return false; } - data->pipe_crc[data->crtc_idx] = pipe_crc; + data->pipe_crc = pipe_crc; igt_wait_for_vblank(data->drm_fd, data->crtc_idx); @@ -446,8 +443,8 @@ static bool prepare_test(data_t *data, enum test_mode mode) static void finish_crtc(data_t *data, enum test_mode mode) { - igt_pipe_crc_free(data->pipe_crc[data->crtc_idx]); - data->pipe_crc[data->crtc_idx] = NULL; + igt_pipe_crc_free(data->pipe_crc); + data->pipe_crc = NULL; if (mode == TEST_CONTEXT || mode == TEST_PAGE_FLIP_AND_CONTEXT) { drm_intel_gem_context_destroy(data->ctx[0]); |