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: Check context status before looking up our obj/vma
Date: Thu, 22 Jun 2017 12:54:08 +0100 [thread overview]
Message-ID: <aaa48d21-4537-461e-50c2-7d5e3d38e81e@linux.intel.com> (raw)
In-Reply-To: <20170621103929.20135-1-chris@chris-wilson.co.uk>
On 21/06/2017 11:39, Chris Wilson wrote:
> Since we keep the context around across the slow lookup where we may
> drop the struct_mutex, we should double check that the context is still
> valid upon reacquisition.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem_execbuffer.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index b2457556591c..0ecd2abaef3c 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -672,13 +672,6 @@ static int eb_select_context(struct i915_execbuffer *eb)
> if (unlikely(!ctx))
> return -ENOENT;
>
> - if (unlikely(i915_gem_context_is_banned(ctx))) {
> - DRM_DEBUG("Context %u tried to submit while banned\n",
> - ctx->user_handle);
> - i915_gem_context_put(ctx);
> - return -EIO;
> - }
> -
> eb->ctx = ctx;
> eb->vm = ctx->ppgtt ? &ctx->ppgtt->base : &eb->i915->ggtt.base;
>
> @@ -700,6 +693,12 @@ static int eb_lookup_vmas(struct i915_execbuffer *eb)
> int slow_pass = -1;
> int err;
>
> + if (unlikely(i915_gem_context_is_closed(eb->ctx)))
> + return -ENOENT;
> +
> + if (unlikely(i915_gem_context_is_banned(eb->ctx)))
> + return -EIO;
> +
> INIT_LIST_HEAD(&eb->relocs);
> INIT_LIST_HEAD(&eb->unbound);
>
>
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
prev parent reply other threads:[~2017-06-22 11:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-21 10:39 [PATCH] drm/i915: Check context status before looking up our obj/vma Chris Wilson
2017-06-21 11:49 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-06-22 11:54 ` Tvrtko Ursulin [this message]
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=aaa48d21-4537-461e-50c2-7d5e3d38e81e@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