From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8060A6E342 for ; Thu, 17 Jun 2021 19:41:40 +0000 (UTC) Date: Thu, 17 Jun 2021 12:40:07 -0700 Message-ID: <87r1h0e0vc.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: References: <20210614163704.365989-1-jason@jlekstrand.net> <20210614163704.365989-20-jason@jlekstrand.net> <87bl852q0t.wl-ashutosh.dixit@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Subject: Re: [igt-dev] [PATCH i-g-t 19/77] tests/gem_exec_whisper: Convert to intel_ctx_t 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: Jason Ekstrand Cc: IGT GPU Tools List-ID: On Thu, 17 Jun 2021 11:31:08 -0700, Jason Ekstrand wrote: > > On Wed, Jun 16, 2021 at 9:17 PM Dixit, Ashutosh > wrote: > > > > On Mon, 14 Jun 2021 09:36:34 -0700, Jason Ekstrand wrote: > > > @@ -294,18 +308,20 @@ static void whisper(int fd, unsigned engine, unsigned flags) > > > igt_assert(loc == sizeof(uint32_t) * i); > > > batch[++i] = MI_BATCH_BUFFER_END; > > > > > > - if (flags & CONTEXTS) { > > > - for (n = 0; n < 64; n++) > > > - contexts[n] = gem_context_clone_with_engines(fd, 0); > > > - } > > > - if (flags & QUEUES) { > > > - for (n = 0; n < 64; n++) > > > - contexts[n] = gem_queue_create(fd); > > > - } > > > if (flags & FDS) { > > > for (n = 0; n < 64; n++) { > > > fds[n] = gem_reopen_driver(fd); > > > - gem_context_copy_engines(fd, 0, fds[n], 0); > > > + } > > > + } > > > + if (flags & (CONTEXTS | QUEUES | FDS)) { > > > + local_cfg = ctx->cfg; > > > + if (flags & QUEUES) { > > > + igt_assert(!(flags & FDS)); > > > > Is this assert needed, what is the reason for it? > > Because I use fd and not fds[n] below. Yeah, it's not needed but I like > dropping asserts for assumptions. OK, I think the assert is needed because the vm created with gem_vm_create(fd) cannot be used with intel_ctx_create(fds[n], ...) below. > > > + local_cfg.vm = gem_vm_create(fd); > > > + } > > > + for (n = 0; n < 64; n++) { > > > + int this_fd = (flags & FDS) ? fds[n] : fd; > > > + contexts[n] = intel_ctx_create(this_fd, &local_cfg); > > > } > > > } _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev