lib/igt.cocci: Add s/assert/igt_assert/
[platform/upstream/intel-gpu-tools.git] / tests / kms_plane.c
index 7437641..93a05bb 100644 (file)
@@ -63,12 +63,15 @@ static void test_fini(data_t *data)
 }
 
 static void
-test_grab_crc(data_t *data, igt_output_t *output, color_t *fb_color,
-             igt_crc_t *crc /* out */)
+test_grab_crc(data_t *data, igt_output_t *output, enum pipe pipe,
+             color_t *fb_color, igt_crc_t *crc /* out */)
 {
        struct igt_fb fb;
        drmModeModeInfo *mode;
        igt_plane_t *primary;
+       char *crc_str;
+
+       igt_output_set_pipe(output, pipe);
 
        primary = igt_output_get_plane(output, 0);
 
@@ -88,6 +91,11 @@ test_grab_crc(data_t *data, igt_output_t *output, color_t *fb_color,
        igt_display_commit(&data->display);
 
        igt_remove_fb(data->drm_fd, &fb);
+
+       crc_str = igt_crc_to_string(crc);
+       igt_debug("CRC for a (%.02f,%.02f,%.02f) fb: %s\n", fb_color->red,
+                 fb_color->green, fb_color->blue, crc_str);
+       free(crc_str);
 }
 
 /*
@@ -156,7 +164,7 @@ test_plane_position_with_output(data_t *data,
 
        test_init(data, pipe);
 
-       test_grab_crc(data, output, &green, &test.reference_crc);
+       test_grab_crc(data, output, pipe, &green, &test.reference_crc);
 
        igt_output_set_pipe(output, pipe);
 
@@ -276,13 +284,12 @@ test_plane_panning_with_output(data_t *data,
        drmModeModeInfo *mode;
        igt_crc_t crc;
 
-       fprintf(stdout, "Testing connector %s using pipe %c plane %d\n",
-               igt_output_name(output), pipe_name(pipe), plane);
+       igt_info("Testing connector %s using pipe %c plane %d\n", igt_output_name(output), pipe_name(pipe), plane);
 
        test_init(data, pipe);
 
-       test_grab_crc(data, output, &red, &test.red_crc);
-       test_grab_crc(data, output, &blue, &test.blue_crc);
+       test_grab_crc(data, output, pipe, &red, &test.red_crc);
+       test_grab_crc(data, output, pipe, &blue, &test.blue_crc);
 
        igt_output_set_pipe(output, pipe);