[Intel-gfx] [PATCH] drm/i915: extract fence stealing code

Daniel Vetter daniel at ffwll.ch
Fri Jan 15 22:55:21 CET 2010


On Fri, Jan 15, 2010 at 09:48:30PM +0000, Chris Wilson wrote:
> > +	/* None available, try to steal one or wait for a user to finish */
> > +	obj = NULL;
> > +	list_for_each_entry(obj_priv, &dev_priv->mm.fence_list,
> > +			    fence_list) {
> > +		obj = obj_priv->obj;
>                 ^^^^^^^^^^^^^^^^^^^
> The test is even more paranoid than I am, as obj will be set if we iterate the list.
> 
> > +		if (obj_priv->pin_count)
> > +			continue;
> > +
> > +		/* found one! */
> > +		i = obj_priv->fence_reg;
> > +		break;
> > +	}
> > +
> > +	BUG_ON(!obj);
> 
> Hence the fiddle with using obj_priv->obj->pin_count.

Argh, my brain is definitely already on vacation. I'll tray again ...
-Daniel
-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48



More information about the Intel-gfx mailing list