[igt-dev] [PATCH i-g-t 6/7] Revert "i915/gem_exec_reloc: Check that relocations do not block"

Jason Ekstrand jason at jlekstrand.net
Wed Jun 9 18:03:09 UTC 2021


Very much

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

On Tue, Jun 8, 2021 at 4:40 AM Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
>
> This reverts commit 5343ca6ad8fac39fe4d468f771af72c968404bea.
>
> This validates gpu relocations, which we're about to delete.
>
> Cc: Jason Ekstrand <jason at jlekstrand.net>
> Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> Cc: Dave Airlie <airlied at redhat.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
>  tests/i915/gem_exec_reloc.c | 52 -------------------------------------
>  1 file changed, 52 deletions(-)
>
> diff --git a/tests/i915/gem_exec_reloc.c b/tests/i915/gem_exec_reloc.c
> index cbd40962c610..5b15bcdc3a1f 100644
> --- a/tests/i915/gem_exec_reloc.c
> +++ b/tests/i915/gem_exec_reloc.c
> @@ -344,51 +344,6 @@ static void active(int fd, unsigned engine)
>         gem_close(fd, obj[0].handle);
>  }
>
> -static unsigned int offset_in_page(void *addr)
> -{
> -       return (uintptr_t)addr & 4095;
> -}
> -
> -static void active_spin(int fd, unsigned engine)
> -{
> -       const uint32_t bbe = MI_BATCH_BUFFER_END;
> -       struct drm_i915_gem_relocation_entry reloc;
> -       struct drm_i915_gem_exec_object2 obj[2];
> -       struct drm_i915_gem_execbuffer2 execbuf;
> -       igt_spin_t *spin;
> -
> -       spin = igt_spin_new(fd,
> -                           .engine = engine,
> -                           .flags = IGT_SPIN_NO_PREEMPTION);
> -
> -       memset(obj, 0, sizeof(obj));
> -       obj[0] = spin->obj[IGT_SPIN_BATCH];
> -       obj[0].relocs_ptr = to_user_pointer(&reloc);
> -       obj[0].relocation_count = 1;
> -       obj[1].handle = gem_create(fd, 4096);
> -       gem_write(fd, obj[1].handle, 0, &bbe, sizeof(bbe));
> -
> -       memset(&reloc, 0, sizeof(reloc));
> -       reloc.presumed_offset = -1;
> -       reloc.offset = offset_in_page(spin->condition);
> -       reloc.target_handle = obj[0].handle;
> -
> -       memset(&execbuf, 0, sizeof(execbuf));
> -       execbuf.buffers_ptr = to_user_pointer(obj);
> -       execbuf.buffer_count = 2;
> -       execbuf.flags = engine;
> -
> -       gem_execbuf(fd, &execbuf);
> -       gem_close(fd, obj[1].handle);
> -       igt_assert_eq(*spin->condition, spin->cmd_precondition);
> -
> -       igt_spin_end(spin);
> -       gem_sync(fd, spin->handle);
> -
> -       igt_assert_eq(*spin->condition, obj[0].offset);
> -       igt_spin_free(fd, spin);
> -}
> -
>  static bool has_64b_reloc(int fd)
>  {
>         return intel_gen(intel_get_drm_devid(fd)) >= 8;
> @@ -964,13 +919,6 @@ igt_main
>                 }
>         }
>
> -       igt_subtest_with_dynamic("basic-spin") {
> -               __for_each_physical_engine(fd, e) {
> -                       igt_dynamic_f("%s", e->name)
> -                               active_spin(fd, e->flags);
> -               }
> -       }
> -
>         igt_subtest("invalid-domains")
>                 invalid_domains(fd);
>
> --
> 2.24.1
>


More information about the igt-dev mailing list