Commit c46c320c authored by Chris Wilson's avatar Chris Wilson

drm/i915/selftests: Use igt_random_offset()

Switch igt_vm_isolation() to using igt_random_offset().
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200312154708.1720-1-chris@chris-wilson.co.uk
parent 7dc8f114
...@@ -1809,7 +1809,6 @@ static int igt_vm_isolation(void *arg) ...@@ -1809,7 +1809,6 @@ static int igt_vm_isolation(void *arg)
vm_total = ctx_vm(ctx_a)->total; vm_total = ctx_vm(ctx_a)->total;
GEM_BUG_ON(ctx_vm(ctx_b)->total != vm_total); GEM_BUG_ON(ctx_vm(ctx_b)->total != vm_total);
vm_total -= I915_GTT_PAGE_SIZE;
count = 0; count = 0;
num_engines = 0; num_engines = 0;
...@@ -1828,10 +1827,10 @@ static int igt_vm_isolation(void *arg) ...@@ -1828,10 +1827,10 @@ static int igt_vm_isolation(void *arg)
u32 value = 0xc5c5c5c5; u32 value = 0xc5c5c5c5;
u64 offset; u64 offset;
div64_u64_rem(i915_prandom_u64_state(&prng), /* Leave enough space at offset 0 for the batch */
vm_total, &offset); offset = igt_random_offset(&prng,
offset = round_down(offset, alignof_dword); I915_GTT_PAGE_SIZE, vm_total,
offset += I915_GTT_PAGE_SIZE; sizeof(u32), alignof_dword);
err = write_to_scratch(ctx_a, engine, err = write_to_scratch(ctx_a, engine,
offset, 0xdeadbeef); offset, 0xdeadbeef);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment