[Intel-gfx] [PATCH 06/50] drm/i915: s/intel_ring_buffer/intel_engine
Mateo Lozano, Oscar
oscar.mateo at intel.com
Mon May 19 18:49:31 CEST 2014
> -----Original Message-----
> From: Volkin, Bradley D
> Sent: Monday, May 19, 2014 5:41 PM
> To: Mateo Lozano, Oscar
> Cc: Daniel Vetter; intel-gfx at 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 at 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´t 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 =
> 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 != NULL) {
> ret = idr_alloc(&file_priv->context_idr, ctx,
> DEFAULT_CONTEXT_ID, 0, GFP_KERNEL);
> if (ret < 0)
> goto err_out;
> } else
> ret = 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_idr, DEFAULT_CONTEXT_ID);
More information about the Intel-gfx
mailing list