[igt-dev] [PATCH i-g-t 2/2] tests/i915/gem_render_tiled_blits: Make sure igt_buf is initially zero'd

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Mon Nov 19 11:05:28 UTC 2018


gen8_bind_buf looks at buf->aux.stride/offset, which is not set by the
test. When I added the bpp field, it was enough to make the test fail,
fix this by making sure that the buf is initially zero'd explicitly,
which fixes the test to run reliably 100% of the time.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
 tests/i915/gem_render_tiled_blits.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/i915/gem_render_tiled_blits.c b/tests/i915/gem_render_tiled_blits.c
index 3007f2abd655..129500616315 100644
--- a/tests/i915/gem_render_tiled_blits.c
+++ b/tests/i915/gem_render_tiled_blits.c
@@ -121,7 +121,7 @@ static void run_test (int fd, int count)
 		igt_info("Using a snoop linear buffer for comparisons\n");
 	}
 
-	buf = malloc(sizeof(*buf)*count);
+	buf = calloc(sizeof(*buf), count);
 	start_val = malloc(sizeof(*start_val)*count);
 
 	for (i = 0; i < count; i++) {
-- 
2.19.1



More information about the igt-dev mailing list