From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Volkin, Bradley D" Subject: Re: [PATCH 05/53] drm/i915: Move i915_gem_validate_context() to i915_gem_context.c Date: Wed, 18 Jun 2014 13:00:19 -0700 Message-ID: <20140618200019.GA24164@bdvolkin-ubuntu-desktop> References: <1402673891-14618-1-git-send-email-oscar.mateo@intel.com> <1402673891-14618-6-git-send-email-oscar.mateo@intel.com> <20140613171122.GQ6451@nuc-i3427.alporthouse.com> <92648605EABDA246B775AAB04C95A7A30131B5F0@IRSMSX103.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 358256E781 for ; Wed, 18 Jun 2014 13:00:23 -0700 (PDT) Content-Disposition: inline In-Reply-To: <92648605EABDA246B775AAB04C95A7A30131B5F0@IRSMSX103.ger.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: "Mateo Lozano, Oscar" Cc: "intel-gfx@lists.freedesktop.org" List-Id: intel-gfx@lists.freedesktop.org [snip] On Mon, Jun 16, 2014 at 08:18:00AM -0700, Mateo Lozano, Oscar wrote: > > > +struct intel_context * > > > +i915_gem_context_validate(struct drm_device *dev, struct drm_file *f= ile, > > > + struct intel_engine_cs *ring, const u32 ctx_id) { > > > + struct intel_context *ctx =3D NULL; > > > + struct i915_ctx_hang_stats *hs; > > > + > > > + if (ring->id !=3D RCS && ctx_id !=3D DEFAULT_CONTEXT_ID) > > > + return ERR_PTR(-EINVAL); > > > + > > > + ctx =3D i915_gem_context_get(file->driver_priv, ctx_id); > > > + if (IS_ERR(ctx)) > > > + return ctx; > > > + > > > + hs =3D &ctx->hang_stats; > > > + if (hs->banned) { > > > + DRM_DEBUG("Context %u tried to submit while banned\n", > > ctx_id); > > > + return ERR_PTR(-EIO); > > = > > Ugh. No. > > -Chris > = > D=B4oh! Why? > - Oscar Not sure if you got an answer on this. I'd guess the objection is that the function effectively implements part of the execbuf2 API contract rather than generic context behavior. So we'd want to just keep it as part of i915_gem_execbuffer.c. Brad