From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 2/2] drm/i915: Return -ENOENT for unknown contexts Date: Fri, 14 Mar 2014 16:38:47 +0100 Message-ID: <20140314153847.GW30571@phenom.ffwll.local> References: <1394806931-7399-1-git-send-email-mika.kuoppala@intel.com> <1394806931-7399-2-git-send-email-mika.kuoppala@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F757FB46B for ; Fri, 14 Mar 2014 08:38:52 -0700 (PDT) Received: by mail-ee0-f49.google.com with SMTP id c41so1513827eek.8 for ; Fri, 14 Mar 2014 08:38:51 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1394806931-7399-2-git-send-email-mika.kuoppala@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Mika Kuoppala Cc: intel-gfx@lists.freedesktop.org, miku@iki.fi List-Id: intel-gfx@lists.freedesktop.org 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 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