From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 483706E7DD for ; Thu, 17 Jun 2021 02:17:51 +0000 (UTC) Date: Wed, 16 Jun 2021 19:17:38 -0700 Message-ID: <87bl852q0t.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20210614163704.365989-20-jason@jlekstrand.net> References: <20210614163704.365989-1-jason@jlekstrand.net> <20210614163704.365989-20-jason@jlekstrand.net> 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-dev@lists.freedesktop.org List-ID: On Mon, 14 Jun 2021 09:36:34 -0700, Jason Ekstrand wrote: > > @@ -98,6 +101,13 @@ static void init_hang(struct hang *h, int fd) > > gen = intel_gen(intel_get_drm_devid(h->fd)); > > + if (gem_has_contexts(fd)) { > + h->ctx = intel_ctx_create(h->fd, cfg); Probably could submit against the ctx passed into whisper(), but probably doesn't matter so should be ok. > @@ -221,10 +234,10 @@ static void whisper(int fd, unsigned engine, unsigned flags) > gem_require_contexts(fd); > > if (flags & QUEUES) > - igt_require(gem_has_queues(fd)); > + igt_require(gem_has_vm(fd)); Don't need to check for I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE support here? > @@ -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? > + local_cfg.vm = gem_vm_create(fd); Don't need to handle I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE here (so that contexts share a timeline)? > + } > + 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