[Intel-gfx] [PATCH i-g-t 1/2] tests/kms_color: Unset plane fb on teardown

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Tue Oct 3 14:11:41 UTC 2017


Valgrind is slightly unhappy when we leave the fb set:
==1804== Invalid read of size 4
==1804==    at 0x122F83: igt_plane_get_fb_id (igt_kms.c:2074)
==1804==    by 0x122F83: igt_primary_plane_commit_legacy
(igt_kms.c:2339)
==1804==    by 0x122F83: igt_plane_commit (igt_kms.c:2394)
==1804==    by 0x122F83: igt_pipe_commit (igt_kms.c:2435)
==1804==    by 0x122F83: do_display_commit (igt_kms.c:2667)
==1804==    by 0x12338D: igt_display_commit2 (igt_kms.c:2777)
==1804==    by 0x112F83: run_tests_for_pipe (kms_color.c:1053)
==1804==    by 0x11360F: __real_main1189 (kms_color.c:1206)
==1804==    by 0x110BC6: main (kms_color.c:1189)
==1804==  Address 0x1ffeffeb20 is on thread 1's stack
==1804==  160 bytes below stack pointer

Add the missing calls to igt_plane_set_fb, and fix the crash.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
 tests/kms_color.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/tests/kms_color.c b/tests/kms_color.c
index 060a60152808..60911bac6678 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -342,7 +342,8 @@ static void test_pipe_degamma(data_t *data,
 		 */
 		igt_assert_crc_equal(&crc_fullgamma, &crc_fullcolors);
 
-		igt_output_set_pipe(output, PIPE_ANY);
+		igt_plane_set_fb(primary, NULL);
+		igt_output_set_pipe(output, PIPE_NONE);
 	}
 
 	free(degamma_linear);
@@ -420,7 +421,8 @@ static void test_pipe_gamma(data_t *data,
 		 */
 		igt_assert_crc_equal(&crc_fullgamma, &crc_fullcolors);
 
-		igt_output_set_pipe(output, PIPE_ANY);
+		igt_plane_set_fb(primary, NULL);
+		igt_output_set_pipe(output, PIPE_NONE);
 	}
 
 	free(gamma_full);
@@ -519,7 +521,8 @@ static void test_pipe_legacy_gamma(data_t *data,
 						  legacy_lut_size, red_lut, green_lut, blue_lut), 0);
 		igt_display_commit(&data->display);
 
-		igt_output_set_pipe(output, PIPE_ANY);
+		igt_plane_set_fb(primary, NULL);
+		igt_output_set_pipe(output, PIPE_NONE);
 	}
 
 	free(red_lut);
@@ -645,7 +648,8 @@ static void test_pipe_legacy_gamma_reset(data_t *data,
 				   lut[i].blue == 0xffff);
 		drmModeFreePropertyBlob(blob);
 
-		igt_output_set_pipe(output, PIPE_ANY);
+		igt_plane_set_fb(priamry, NULL);
+		igt_output_set_pipe(output, PIPE_NONE);
 	}
 
 	free(degamma_linear);
@@ -731,7 +735,8 @@ static bool test_pipe_ctm(data_t *data,
 		 */
 		ret &= crc_equal(&crc_software, &crc_hardware);
 
-		igt_output_set_pipe(output, PIPE_ANY);
+		igt_plane_set_fb(primary, NULL);
+		igt_output_set_pipe(output, PIPE_NONE);
 	}
 
 	free(degamma_linear);
@@ -827,7 +832,8 @@ static void test_pipe_limited_range_ctm(data_t *data,
 		 */
 		igt_assert_crc_equal(&crc_full, &crc_limited);
 
-		igt_output_set_pipe(output, PIPE_ANY);
+		igt_plane_set_fb(primary, NULL);
+		igt_output_set_pipe(output, PIPE_NONE);
 	}
 
 	free(gamma_linear);
-- 
2.14.1



More information about the Intel-gfx mailing list