Re: [PATCH] drm/i915/selftests: Use igt_random_offset()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 12 Mar 2020 at 15:47, Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> wrote:
>
> Switch igt_vm_isolation() to using igt_random_offset().
>
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: Matthew Auld <matthew.auld@xxxxxxxxx>
> Cc: Akeem G Abodunrin <akeem.g.abodunrin@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
> index 77c7e65de7c3..62157e7567da 100644
> --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
> @@ -1809,7 +1809,6 @@ static int igt_vm_isolation(void *arg)
>
>         vm_total = ctx_vm(ctx_a)->total;
>         GEM_BUG_ON(ctx_vm(ctx_b)->total != vm_total);
> -       vm_total -= I915_GTT_PAGE_SIZE;
>
>         count = 0;
>         num_engines = 0;
> @@ -1828,10 +1827,9 @@ static int igt_vm_isolation(void *arg)
>                         u32 value = 0xc5c5c5c5;
>                         u64 offset;
>
> -                       div64_u64_rem(i915_prandom_u64_state(&prng),
> -                                     vm_total, &offset);
> -                       offset = round_down(offset, alignof_dword);
> -                       offset += I915_GTT_PAGE_SIZE;
> +                       offset = igt_random_offset(&prng, 0, vm_total,
> +                                                  I915_GTT_PAGE_SIZE,
> +                                                  I915_GTT_PAGE_SIZE);

Further down is: GEM_BUG_ON(offset < I915_GTT_PAGE_SIZE);

Reviewed-by: Matthew Auld <matthew.auld@xxxxxxxxx>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux