From 8f58edc2dd3fb1ead3fef5156065db2d06132a6a Mon Sep 17 00:00:00 2001 From: Mika Kahola Date: Fri, 18 Sep 2015 08:49:52 +0300 Subject: [PATCH] i-g-t/tests: kms_pipe_crc_basic tests with one color fb It turned out that the kms_pipe_crc_basic --r read-crc-pipe-A-frame-sequence failed when multiple display connectors such as DP, HDMI, DVI etc. was connected. This patch takes a step backwards and runs the test with one color only. The patch relates to this bug report https://bugs.freedesktop.org/show_bug.cgi?id=91578 Signed-off-by: Mika Kahola --- tests/kms_pipe_crc_basic.c | 89 ++++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 47 deletions(-) diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c index a6ebf36..be1d7d7 100644 --- a/tests/kms_pipe_crc_basic.c +++ b/tests/kms_pipe_crc_basic.c @@ -38,10 +38,7 @@ typedef struct { static struct { double r, g, b; igt_crc_t crc; -} colors[2] = { - { .r = 0.0, .g = 1.0, .b = 0.0 }, - { .r = 0.0, .g = 1.0, .b = 1.0 }, -}; +} color = {.r = 0.0, .g = 1.0, .b = 0.0}; static uint64_t submit_batch(int fd, unsigned ring_id) { @@ -120,65 +117,63 @@ test_read_crc_for_output(data_t *data, int pipe, igt_output_t *output, drmModeModeInfo *mode; igt_pipe_crc_t *pipe_crc; igt_crc_t *crcs = NULL; - int c, j; + int j; - for (c = 0; c < ARRAY_SIZE(colors); c++) { - char *crc_str; + char *crc_str; - igt_output_set_pipe(output, pipe); + igt_output_set_pipe(output, pipe); - igt_debug("Clearing the fb with color (%.02lf,%.02lf,%.02lf)\n", - colors[c].r, colors[c].g, colors[c].b); + igt_debug("Clearing the fb with color (%.02lf,%.02lf,%.02lf)\n", + color.r, color.g, color.b); - mode = igt_output_get_mode(output); - igt_create_color_fb(data->drm_fd, - mode->hdisplay, mode->vdisplay, - DRM_FORMAT_XRGB8888, - LOCAL_DRM_FORMAT_MOD_NONE, - colors[c].r, - colors[c].g, - colors[c].b, - &data->fb); + mode = igt_output_get_mode(output); + igt_create_color_fb(data->drm_fd, + mode->hdisplay, mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_DRM_FORMAT_MOD_NONE, + color.r, + color.g, + color.b, + &data->fb); - primary = igt_output_get_plane(output, 0); - igt_plane_set_fb(primary, &data->fb); + primary = igt_output_get_plane(output, 0); + igt_plane_set_fb(primary, &data->fb); - igt_display_commit(display); + igt_display_commit(display); - pipe_crc = igt_pipe_crc_new(pipe, INTEL_PIPE_CRC_SOURCE_AUTO); + pipe_crc = igt_pipe_crc_new(pipe, INTEL_PIPE_CRC_SOURCE_AUTO); - igt_pipe_crc_start(pipe_crc); + igt_pipe_crc_start(pipe_crc); - /* wait for N_CRCS vblanks and the corresponding N_CRCS CRCs */ - igt_pipe_crc_get_crcs(pipe_crc, N_CRCS, &crcs); + /* wait for N_CRCS vblanks and the corresponding N_CRCS CRCs */ + igt_pipe_crc_get_crcs(pipe_crc, N_CRCS, &crcs); - igt_pipe_crc_stop(pipe_crc); + igt_pipe_crc_stop(pipe_crc); - /* - * save the CRC in colors so it can be compared to the CRC of - * other fbs - */ - colors[c].crc = crcs[0]; + /* + * save the CRC in colors so it can be compared to the CRC of + * other fbs + */ + color.crc = crcs[0]; - crc_str = igt_crc_to_string(&crcs[0]); - igt_debug("CRC for this fb: %s\n", crc_str); - free(crc_str); + crc_str = igt_crc_to_string(&crcs[0]); + igt_debug("CRC for this fb: %s\n", crc_str); + free(crc_str); - /* and ensure that they'are all equal, we haven't changed the fb */ - for (j = 0; j < (N_CRCS - 1); j++) - igt_assert_crc_equal(&crcs[j], &crcs[j + 1]); + /* and ensure that they'are all equal, we haven't changed the fb */ + for (j = 0; j < (N_CRCS - 1); j++) + igt_assert_crc_equal(&crcs[j], &crcs[j + 1]); - if (flags & TEST_SEQUENCE) - for (j = 0; j < (N_CRCS - 1); j++) - igt_assert(crcs[j].frame + 1 == crcs[j + 1].frame); + if (flags & TEST_SEQUENCE) + for (j = 0; j < (N_CRCS - 1); j++) + igt_assert(crcs[j].frame + 1 == crcs[j + 1].frame); - free(crcs); - igt_pipe_crc_free(pipe_crc); - igt_remove_fb(data->drm_fd, &data->fb); - igt_plane_set_fb(primary, NULL); + free(crcs); + igt_pipe_crc_free(pipe_crc); + igt_remove_fb(data->drm_fd, &data->fb); + igt_plane_set_fb(primary, NULL); - igt_output_set_pipe(output, PIPE_ANY); - } + igt_output_set_pipe(output, PIPE_ANY); return 1; } -- 1.9.1