All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Jason Ekstrand <jason@jlekstrand.net>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 5/6] tests/i915/gem_exec_schedule: Avoid cmdparser dependencies in deep()
Date: Mon, 12 Jul 2021 16:58:21 +0200	[thread overview]
Message-ID: <YOxYjc557Ri9q+Hb@phenom.ffwll.local> (raw)
In-Reply-To: <20210711035204.802908-6-jason@jlekstrand.net>

On Sat, Jul 10, 2021 at 10:52:03PM -0500, Jason Ekstrand wrote:
> When we have a command parser which runs synchronously, it blocks until
> the batch is idle.  For most userspace, this doesn't matter as they
> never re-use a batch.  With IGT, this can be a problem because it means
> we can't queue up multiple instances of the same batch.  The easy
> solution is to create a new batch BO for each execbuf.
> 
> Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>

I'm way behind on all the reloc work I've done, but should we instead do
my patch (which you reviewed):

https://patchwork.freedesktop.org/patch/437683/

Or does that not work? Asking since you're papering over the same issue I
spotted already ...
-Daniel

> ---
>  tests/i915/gem_exec_schedule.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/i915/gem_exec_schedule.c b/tests/i915/gem_exec_schedule.c
> index a75faeb68..ee7b10f7f 100644
> --- a/tests/i915/gem_exec_schedule.c
> +++ b/tests/i915/gem_exec_schedule.c
> @@ -1891,7 +1891,6 @@ static void deep(int fd, const intel_ctx_cfg_t *cfg,
>  		reloc.delta = sizeof(uint32_t) * n;
>  		reloc.read_domains = I915_GEM_DOMAIN_RENDER;
>  		reloc.write_domain = I915_GEM_DOMAIN_RENDER;
> -		obj[2].handle = gem_create(fd, 4096);
>  		obj[2].relocs_ptr = to_user_pointer(&reloc);
>  		obj[2].relocation_count = 1;
>  
> @@ -1910,15 +1909,20 @@ static void deep(int fd, const intel_ctx_cfg_t *cfg,
>  		}
>  		batch[++i] = eb.rsvd1;
>  		batch[++i] = MI_BATCH_BUFFER_END;
> -		gem_write(fd, obj[2].handle, 0, batch, sizeof(batch));
>  
>  		gem_context_set_priority(fd, eb.rsvd1, MAX_PRIO - nreq + n);
>  		for (int m = 0; m < XS; m++) {
>  			obj[1].handle = dep[m];
>  			reloc.target_handle = obj[1].handle;
> +
> +			/* Create a new batch BO every time so we don't end
> +			 * up with extra dependencies
> +			 */
> +			obj[2].handle = gem_create(fd, 4096);
> +			gem_write(fd, obj[2].handle, 0, batch, sizeof(batch));
>  			gem_execbuf(fd, &eb);
> +			gem_close(fd, obj[2].handle);
>  		}
> -		gem_close(fd, obj[2].handle);
>  	}
>  	igt_info("First deptree: %d requests [%.3fs]\n",
>  		 n * XS, 1e-9*igt_nsec_elapsed(&tv));
> -- 
> 2.31.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2021-07-12 14:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-11  3:51 [igt-dev] [PATCH i-g-t 0/6] Rework some command parser version checks Jason Ekstrand
2021-07-11  3:51 ` [igt-dev] [PATCH i-g-t 1/6] lib/intel_ctx: Add a intel_ctx_cfg_engine_class helper Jason Ekstrand
2021-07-11  3:52 ` [igt-dev] [PATCH i-g-t 2/6] tests/i915/gem_eio: Convert to intel_ctx_t Jason Ekstrand
2021-07-11  3:52 ` [igt-dev] [PATCH i-g-t 3/6] tests/i915/gem_ctx_persistence: Use intel_ctx_t for hang subtests Jason Ekstrand
2021-07-11  3:52 ` [igt-dev] [PATCH i-g-t 4/6] i915: Improve the precision of command parser checks Jason Ekstrand
2021-07-12 15:12   ` Daniel Vetter
2021-07-11  3:52 ` [igt-dev] [PATCH i-g-t 5/6] tests/i915/gem_exec_schedule: Avoid cmdparser dependencies in deep() Jason Ekstrand
2021-07-12 14:58   ` Daniel Vetter [this message]
2021-07-12 16:00     ` Jason Ekstrand
2021-07-11  3:52 ` [igt-dev] [PATCH i-g-t 6/6] tests/i915/gem_exec_reloc: Don't attempt active relocations with the command parser Jason Ekstrand
2021-07-12 15:00   ` Daniel Vetter
2021-07-12 16:01     ` Jason Ekstrand
2021-07-13  9:24       ` Daniel Vetter
2021-07-11 13:08 ` [igt-dev] ✓ Fi.CI.BAT: success for Rework some command parser version checks Patchwork
2021-07-11 14:18 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-07-12 14:51 ` [igt-dev] [PATCH i-g-t 0/6] " Daniel Vetter
2021-07-12 15:50   ` Jason Ekstrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YOxYjc557Ri9q+Hb@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jason@jlekstrand.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.