From: "Volkin, Bradley D" Subject: Re: [PATCH 06/50] drm/i915: s/intel_ring_buffer/intel_engine Date: Mon, 19 May 2014 10:00:47 -0700 Message-ID: <20140519170047.GA21186@bdvolkin-ubuntu-desktop> References: <92648605EABDA246B775AAB04C95A7A3012EF990@IRSMSX103.ger.corp.intel.com> <20140519151155.GQ8790@phenom.ffwll.local> <92648605EABDA246B775AAB04C95A7A3012EFA46@IRSMSX103.ger.corp.intel.com> <20140519154938.GT8790@phenom.ffwll.local> <92648605EABDA246B775AAB04C95A7A3012EFB6A@IRSMSX103.ger.corp.intel.com> <20140519162418.GA20948@bdvolkin-ubuntu-desktop> <92648605EABDA246B775AAB04C95A7A3012EFC01@IRSMSX103.ger.corp.intel.com> <20140519164059.GA21010@bdvolkin-ubuntu-desktop> <92648605EABDA246B775AAB04C95A7A3012EFC6D@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 mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 1732689AB6 for ; Mon, 19 May 2014 10:02:15 -0700 (PDT) Content-Disposition: inline In-Reply-To: <92648605EABDA246B775AAB04C95A7A3012EFC6D@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 Mon, May 19, 2014 at 09:49:31AM -0700, Mateo Lozano, Oscar wrote: > > -----Original Message----- > > From: Volkin, Bradley D > > Sent: Monday, May 19, 2014 5:41 PM > > To: Mateo Lozano, Oscar > > Cc: Daniel Vetter; intel-gfx@lists.freedesktop.org > > Subject: Re: [Intel-gfx] [PATCH 06/50] drm/i915: > > s/intel_ring_buffer/intel_engine > > = > > On Mon, May 19, 2014 at 09:33:37AM -0700, Mateo Lozano, Oscar wrote: > > > > -----Original Message----- > > > > From: Volkin, Bradley D > > > > Sent: Monday, May 19, 2014 5:24 PM > > > > To: Mateo Lozano, Oscar > > > > Cc: Daniel Vetter; intel-gfx@lists.freedesktop.org > > > > Subject: Re: [Intel-gfx] [PATCH 06/50] drm/i915: > > > > s/intel_ring_buffer/intel_engine > > > > > > > > On Mon, May 19, 2014 at 09:12:26AM -0700, Mateo Lozano, Oscar wrote: > > > > > BTW: do you want me to kill private_default_ctx as well? It > > > > > doesn=B4t look very > > > > useful... > > > > > > > > Isn't private_default_ctx the one that's actually used when > > > > userspace specifies DEFAULT_CONTEXT_ID? > > > > > > What I see is a normal idr_find: > > = > > Right, but i915_gem_context_open() does: > > idr_init(&file_priv->context_idr); > > file_priv->private_default_ctx =3D > > i915_gem_create_context(dev, file_priv, > > USES_FULL_PPGTT(dev)); > > = > > And i915_gem_create_context() calls __create_hw_context(), which does: > > if (file_priv !=3D NULL) { > > ret =3D idr_alloc(&file_priv->context_idr, ctx, > > DEFAULT_CONTEXT_ID, 0, GFP_KERNEL); > > if (ret < 0) > > goto err_out; > > } else > > ret =3D DEFAULT_CONTEXT_ID; > > = > > So I think the idr_find() should indirectly give us private_default_ctx. > = > Exactly!: why are we keeping file_priv->private_default_ctx then? If you = need to get it somewehere, you can simply do idr_find(&file_priv->context_i= dr, DEFAULT_CONTEXT_ID); Oh, sorry, I completely misunderstood what you were suggesting. Kill away :)