[Intel-gfx] [PATCH v3] drm/i915: Add null state batch to active list

Chris Wilson chris at chris-wilson.co.uk
Wed May 21 17:00:40 CEST 2014


On Wed, May 21, 2014 at 04:54:55PM +0200, Daniel Vetter wrote:
> On Wed, May 21, 2014 at 05:02:56PM +0300, Mika Kuoppala wrote:
> > for proper refcounting to take place as we use
> > i915_add_request() for it.
> > 
> > i915_add_request() also takes the context for the request
> > from ring->last_context so move the null state batch
> > submission after the ring context has been set.
> > 
> > v2: we need to check for correct ring now (Ville Syrjälä)
> > v3: no need to expose i915_gem_move_object_to_active (Chris Wilson)
> > 
> > Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > Cc: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Damien Lespiau <damien.lespiau at intel.com>
> > Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>
> 
> Merged with Ville's irc r-b, thanks for the quick fix.

Pity, it still contains some code that I'd rather not start
cargo-culting.
> > -	ret = i915_add_request(ring, &seqno);
> > +	vma = i915_gem_obj_to_ggtt(so->obj);
> > +	if (vma == NULL) {
> > +		ret = -ENOSPC;
> > +		goto out;
> > +	}

We use the GGTT vma much earlier, so this is suspect.

> > +
> > +	i915_vma_move_to_active(vma, ring);
> > +
> > +	ret = __i915_add_request(ring, NULL, so->obj, NULL);
> > +	if (ret)
> > +		i915_gem_object_move_to_inactive(so->obj);

As is move-to-inactive here. The only way add-request can fail is via an
EIO, and that will have triggered the move-to-inactive already - which
should nicely catch a BUG or two.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list