From 3e766b8255efb6c994e6501be2af44b4bdc4d191 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 26 Sep 2014 07:55:49 +0100 Subject: [PATCH] igt/gem_concurrent_blit: Only read back a few GTT values Due to the nature of the test, we can be reasonably sure that it is either all copied or not. So we can sacrificing testing the entire buffer for the expected value in order to speed up the test by only testing along the diagonal. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84354 Signed-off-by: Chris Wilson --- tests/gem_concurrent_blit.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/gem_concurrent_blit.c b/tests/gem_concurrent_blit.c index 9f769e5d..7d8d628d 100644 --- a/tests/gem_concurrent_blit.c +++ b/tests/gem_concurrent_blit.c @@ -104,11 +104,10 @@ unmapped_create_bo(drm_intel_bufmgr *bufmgr, int width, int height) static void gtt_set_bo(drm_intel_bo *bo, uint32_t val, int width, int height) { + uint32_t *vaddr = bo->virtual; int size = width * height; - uint32_t *vaddr; drm_intel_gem_bo_start_gtt_access(bo, true); - vaddr = bo->virtual; while (size--) *vaddr++ = val; } @@ -116,13 +115,13 @@ gtt_set_bo(drm_intel_bo *bo, uint32_t val, int width, int height) static void gtt_cmp_bo(drm_intel_bo *bo, uint32_t val, int width, int height, drm_intel_bo *tmp) { - int size = width * height; - uint32_t *vaddr; + uint32_t *vaddr = bo->virtual; + int y; + /* GTT access is slow. So we just compare a few points */ drm_intel_gem_bo_start_gtt_access(bo, false); - vaddr = bo->virtual; - while (size--) - igt_assert_eq_u32(*vaddr++, val); + for (y = 0; y < height; y++) + igt_assert_eq_u32(vaddr[y*width+y], val); } static drm_intel_bo *