From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7C2A76EA55 for ; Wed, 9 Jun 2021 18:06:00 +0000 (UTC) Received: by mail-yb1-xb2f.google.com with SMTP id g142so17426673ybf.9 for ; Wed, 09 Jun 2021 11:06:00 -0700 (PDT) MIME-Version: 1.0 References: <20210608094020.21598-1-daniel.vetter@ffwll.ch> <20210608094020.21598-5-daniel.vetter@ffwll.ch> In-Reply-To: <20210608094020.21598-5-daniel.vetter@ffwll.ch> From: Jason Ekstrand Date: Wed, 9 Jun 2021 13:05:48 -0500 Message-ID: Subject: Re: [igt-dev] [PATCH i-g-t 5/7] Revert "i915/gem_exec_reloc: Flood the ring with GPU relocs" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Daniel Vetter Cc: IGT development , Dave Airlie , Daniel Vetter List-ID: Reviewed-by: Jason Ekstrand On Tue, Jun 8, 2021 at 4:40 AM Daniel Vetter wrote: > > This reverts commit 57ee41f12b7a53283fd812c5f72fcb39e6ad2197. > > This validates gpu relocations, which we're about to delete. > > Cc: Jason Ekstrand > Cc: Maarten Lankhorst > Cc: Dave Airlie > Signed-off-by: Daniel Vetter > --- > tests/i915/gem_exec_reloc.c | 89 ------------------------------------- > 1 file changed, 89 deletions(-) > > diff --git a/tests/i915/gem_exec_reloc.c b/tests/i915/gem_exec_reloc.c > index c3f42aff9c9a..cbd40962c610 100644 > --- a/tests/i915/gem_exec_reloc.c > +++ b/tests/i915/gem_exec_reloc.c > @@ -344,88 +344,6 @@ static void active(int fd, unsigned engine) > gem_close(fd, obj[0].handle); > } > > -static uint64_t many_relocs(unsigned long count, unsigned long *out) > -{ > - struct drm_i915_gem_relocation_entry *reloc; > - unsigned long sz; > - int i; > - > - sz = count * sizeof(*reloc); > - sz = ALIGN(sz, 4096); > - > - reloc = mmap(0, sz, PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); > - igt_assert(reloc != MAP_FAILED); > - for (i = 0; i < count; i++) { > - reloc[i].target_handle = 0; > - reloc[i].presumed_offset = ~0ull; > - reloc[i].offset = 8 * i; > - reloc[i].delta = 8 * i; > - } > - mprotect(reloc, sz, PROT_READ); > - > - *out = sz; > - return to_user_pointer(reloc); > -} > - > -static void __many_active(int i915, unsigned engine, unsigned long count) > -{ > - unsigned long reloc_sz; > - struct drm_i915_gem_exec_object2 obj[2] = {{ > - .handle = gem_create(i915, count * sizeof(uint64_t)), > - .relocs_ptr = many_relocs(count, &reloc_sz), > - .relocation_count = count, > - }}; > - struct drm_i915_gem_execbuffer2 execbuf = { > - .buffers_ptr = to_user_pointer(obj), > - .buffer_count = ARRAY_SIZE(obj), > - .flags = engine | I915_EXEC_HANDLE_LUT, > - }; > - igt_spin_t *spin; > - > - spin = __igt_spin_new(i915, > - .engine = engine, > - .dependency = obj[0].handle, > - .flags = (IGT_SPIN_FENCE_OUT | > - IGT_SPIN_NO_PREEMPTION)); > - obj[1] = spin->obj[1]; > - gem_execbuf(i915, &execbuf); > - igt_assert_eq(sync_fence_status(spin->out_fence), 0); > - igt_spin_free(i915, spin); > - > - for (unsigned long i = 0; i < count; i++) { > - uint64_t addr; > - > - gem_read(i915, obj[0].handle, i * sizeof(addr), > - &addr, sizeof(addr)); > - > - igt_assert_eq_u64(addr, obj[0].offset + i * sizeof(addr)); > - } > - > - munmap(from_user_pointer(obj[0].relocs_ptr), reloc_sz); > - gem_close(i915, obj[0].handle); > -} > - > -static void many_active(int i915, unsigned engine) > -{ > - const uint64_t max = 2048; > - unsigned long count = 256; > - > - igt_until_timeout(2) { > - uint64_t required, total; > - > - if (!__intel_check_memory(1, 8 * count, CHECK_RAM, > - &required, &total)) > - break; > - > - igt_debug("Testing count:%lu\n", count); > - __many_active(i915, engine, count); > - > - count <<= 1; > - if (count >= max) > - break; > - } > -} > - > static unsigned int offset_in_page(void *addr) > { > return (uintptr_t)addr & 4095; > @@ -1053,13 +971,6 @@ igt_main > } > } > > - igt_subtest_with_dynamic("basic-many-active") { > - __for_each_physical_engine(fd, e) { > - igt_dynamic_f("%s", e->name) > - many_active(fd, e->flags); > - } > - } > - > igt_subtest("invalid-domains") > invalid_domains(fd); > > -- > 2.24.1 > _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev