diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2018-10-29 19:37:29 +0000 |
---|---|---|
committer | Michał Winiarski <michal.winiarski@intel.com> | 2018-10-31 10:14:42 +0100 |
commit | 6c68c30ef88187a08ec6dff2d77eb07f26eb48c8 (patch) | |
tree | 4e87e1e5eeb37d8c041a01ee2126276f19fcdfe5 /tests/i915 | |
parent | 3aedf1b000e27abfa1bf179205a81efe2b76a508 (diff) |
igt/gem_ppgtt: Unroll 32b memset
Manually unroll the 32b memset in create_bo() to set a cacheline at a
time, for a 2x speed improve of the whole test.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
Diffstat (limited to 'tests/i915')
-rw-r--r-- | tests/i915/gem_ppgtt.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/i915/gem_ppgtt.c b/tests/i915/gem_ppgtt.c index af5e3e07..86fe59f2 100644 --- a/tests/i915/gem_ppgtt.c +++ b/tests/i915/gem_ppgtt.c @@ -47,16 +47,20 @@ static drm_intel_bo *create_bo(drm_intel_bufmgr *bufmgr, uint32_t pixel) { + uint64_t value = (uint64_t)pixel << 32 | pixel, *v; drm_intel_bo *bo; - uint32_t *v; bo = drm_intel_bo_alloc(bufmgr, "surface", SIZE, 4096); igt_assert(bo); do_or_die(drm_intel_bo_map(bo, 1)); v = bo->virtual; - for (int i = 0; i < SIZE/4; i++) - v[i] = pixel; + for (int i = 0; i < SIZE / sizeof(value); i += 8) { + v[i + 0] = value; v[i + 1] = value; + v[i + 2] = value; v[i + 3] = value; + v[i + 4] = value; v[i + 5] = value; + v[i + 6] = value; v[i + 7] = value; + } drm_intel_bo_unmap(bo); return bo; |