From: Daniel Vetter Subject: Re: [PATCH 4/8] drm/i915: Rename ctx->id to ctx->handle Date: Mon, 7 Jul 2014 17:48:17 +0200 Message-ID: <20140707154817.GJ5821@phenom.ffwll.local> References: <1403789059-5692-1-git-send-email-oscar.mateo@intel.com> <1403789059-5692-5-git-send-email-oscar.mateo@intel.com> <20140703093052.GD32535@nuc-i3427.alporthouse.com> <20140703095240.GG32535@nuc-i3427.alporthouse.com> <92648605EABDA246B775AAB04C95A7A3137EC328@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 mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by gabe.freedesktop.org (Postfix) with ESMTP id B771D6E3E0 for ; Mon, 7 Jul 2014 08:48:12 -0700 (PDT) Received: by mail-wi0-f169.google.com with SMTP id hi2so15244154wib.4 for ; Mon, 07 Jul 2014 08:48:11 -0700 (PDT) Content-Disposition: inline In-Reply-To: <92648605EABDA246B775AAB04C95A7A3137EC328@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 On Thu, Jul 03, 2014 at 12:01:35PM +0000, Mateo Lozano, Oscar wrote: > > -----Original Message----- > > From: Chris Wilson [mailto:chris@chris-wilson.co.uk] > > Sent: Thursday, July 03, 2014 10:53 AM > > To: Mateo Lozano, Oscar; intel-gfx@lists.freedesktop.org > > Subject: Re: [Intel-gfx] [PATCH 4/8] drm/i915: Rename ctx->id to ctx->h= andle > > = > > On Thu, Jul 03, 2014 at 10:30:52AM +0100, Chris Wilson wrote: > > > On Thu, Jun 26, 2014 at 02:24:15PM +0100, oscar.mateo@intel.com > > wrote: > > > > From: Oscar Mateo > > > > > > > > This is an Execlists preparatory patch, since they make context ID > > > > become an overloaded term: > > > > > > > > - In the software, it was used to distinguish which context userspa= ce was > > > > trying to use. > > > > - In the BSpec, the term is used to describe the 20-bits long field= the > > > > hardware uses to it to discriminate the contexts that are submitt= ed to > > > > the ELSP and inform the driver about their current status (via Co= ntext > > > > Switch Interrupts and Context Status Buffers). > > > > > > > > Initially, I tried to make the different meanings converge, but it > > > > proved > > > > impossible: > > > > > > > > - The software ctx->id is per-filp, while the hardware one needs to= be > > > > globally unique. > > > > - Also, we multiplex several backing states objects per intel_conte= xt, > > > > and all of them need unique HW IDs. > > > > - I tried adding a per-filp ID and then composing the HW context ID= as: > > > > ctx->id + file_priv->id + ring->id, but the fact that the hardwar= e only > > > > uses 20-bits means we have to artificially limit the number of fi= lps or > > > > contexts the userspace can create. > > > > > > > > The ctx->handle bits are done with this Cocci patch (plus manual > > > > frobbing of the struct declaration): > > > > > > > > @@ > > > > struct intel_context c; > > > > @@ > > > > - (c).id > > > > + c.handle > > > > > > > > @@ > > > > struct intel_context *c; > > > > @@ > > > > - (c)->id > > > > + c->handle > > > > > > > > Also, while we are at it, > > s/DEFAULT_CONTEXT_ID/DEFAULT_CONTEXT_HANDLE. > > > > > > > > Signed-off-by: Oscar Mateo > > > > > > Let's go whole hog here and call it ctx->user_handle. > = > ACK > = > > And it's unsigned and only 32bits... > = > ACK, I=B4ll change the type to unit32_t Aside when resending please pull in all the r-b tags from Jesse so that lazy me has less hassle when merging this ;-) -Daniel -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch