From: Daniel Vetter <daniel@ffwll.ch>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, miku@iki.fi
Subject: Re: [PATCH 2/2] drm/i915: Return -ENOENT for unknown contexts
Date: Fri, 14 Mar 2014 16:38:47 +0100 [thread overview]
Message-ID: <20140314153847.GW30571@phenom.ffwll.local> (raw)
In-Reply-To: <1394806931-7399-2-git-send-email-mika.kuoppala@intel.com>
On Fri, Mar 14, 2014 at 04:22:11PM +0200, Mika Kuoppala wrote:
> If hw_contexts are disabled, we always return the per file
> descriptor default context stats. Make sure that the context
> is correctly given and fail accordingly if not.
>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Hm, does this fix a testcase somewhere? If sou can you specify which one?
Of there's no such thing I guess we should try to add a new testcase for
this for pre-gen6 ...
-Daniel
> ---
> drivers/gpu/drm/i915/i915_gem_context.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> index b5a5837..a8e625d 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> @@ -573,8 +573,12 @@ i915_gem_context_get(struct drm_i915_file_private *file_priv, u32 id)
> {
> struct i915_hw_context *ctx;
>
> - if (!HAS_HW_CONTEXTS(file_priv->dev_priv->dev))
> + if (!HAS_HW_CONTEXTS(file_priv->dev_priv->dev)) {
> + if (id != DEFAULT_CONTEXT_ID)
> + return ERR_PTR(-ENOENT);
> +
> return file_priv->private_default_ctx;
> + }
>
> ctx = (struct i915_hw_context *)idr_find(&file_priv->context_idr, id);
> if (!ctx)
> --
> 1.7.9.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2014-03-14 15:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 14:22 [PATCH 1/2] drm/i915: Switch to fake context on older gens Mika Kuoppala
2014-03-14 14:22 ` [PATCH 2/2] drm/i915: Return -ENOENT for unknown contexts Mika Kuoppala
2014-03-14 15:38 ` Daniel Vetter [this message]
2014-03-17 17:09 ` [PATCH] tests/gem_reset_stats: run non hw context tests also on older gens Mika Kuoppala
2014-03-24 17:13 ` Daniel Vetter
2014-03-14 14:43 ` [PATCH 1/2] drm/i915: Switch to fake context " Jani Nikula
2014-03-14 15:42 ` Daniel Vetter
2014-03-14 15:46 ` Daniel Vetter
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=20140314153847.GW30571@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=mika.kuoppala@linux.intel.com \
--cc=miku@iki.fi \
/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