public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Skip unused contexts for context_barrier_task()
Date: Mon, 29 Apr 2019 10:28:44 +0100	[thread overview]
Message-ID: <5f2b3a4b-91c4-6c41-2874-2a43ac755689@linux.intel.com> (raw)
In-Reply-To: <20190429090735.326-1-chris@chris-wilson.co.uk>


On 29/04/2019 10:07, Chris Wilson wrote:
> If the context has not been used yet, it needs no barrier, and in the
> process fix up the selftest in mock_contexts.
> 
> Testcase: igt/gem_ctx_clone/vm
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_gem_context.c           | 6 +++---
>   drivers/gpu/drm/i915/selftests/i915_gem_context.c | 2 +-
>   2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> index 939c17070780..65cefc520e79 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> @@ -924,15 +924,15 @@ static int context_barrier_task(struct i915_gem_context *ctx,
>   	for_each_gem_engine(ce, i915_gem_context_lock_engines(ctx), it) {
>   		struct i915_request *rq;
>   
> -		if (!(ce->engine->mask & engines))
> -			continue;
> -
>   		if (I915_SELFTEST_ONLY(context_barrier_inject_fault &
>   				       ce->engine->mask)) {
>   			err = -ENXIO;
>   			break;
>   		}
>   
> +		if (!(ce->engine->mask & engines) || !ce->state)
> +			continue;
> +
>   		rq = intel_context_create_request(ce);
>   		if (IS_ERR(rq)) {
>   			err = PTR_ERR(rq);
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
> index b62f005e4d50..34ac5cc6d59f 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
> @@ -1665,7 +1665,7 @@ static int mock_context_barrier(void *arg)
>   		goto out;
>   	}
>   	if (counter == 0) {
> -		pr_err("Did not retire immediately for all inactive engines\n");
> +		pr_err("Did not retire immediately for all unused engines\n");
>   		err = -EINVAL;
>   		goto out;
>   	}
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-04-29  9:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29  9:07 [PATCH] drm/i915: Skip unused contexts for context_barrier_task() Chris Wilson
2019-04-29  9:28 ` Tvrtko Ursulin [this message]
2019-04-29 10:53 ` ✓ Fi.CI.BAT: success for " Patchwork
2019-04-29 13:12 ` ✗ Fi.CI.IGT: failure " Patchwork

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=5f2b3a4b-91c4-6c41-2874-2a43ac755689@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox