[Intel-gfx] [PATCH 05/11] drm/i915: extract fence stealing code
Daniel Vetter
daniel at ffwll.ch
Thu Feb 18 19:35:43 CET 2010
On Tue, Feb 16, 2010 at 04:09:57PM -0800, Eric Anholt wrote:
> On Mon, 1 Feb 2010 13:59:20 +0100, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> > + /* Take a reference, as otherwise the wait_rendering
> > + * below may cause the object to get freed out from
> > + * under us.
> > + */
> > + drm_gem_object_reference(obj);
> > + ret = i915_gem_object_put_fence_reg(obj);
> > + drm_gem_object_unreference(obj);
> > + if (ret != 0)
> > + return ret;
> > +
> > + return i;
>
> This comment appears to be bogus now. Does it mean a wait_rendering
> inside of put_fence_reg?
Yep, the comment is slightly misleading, but the reference is still
needed: The only ref we have on obj is the one from the active list, which
put_fence_reg might drop. Moving the reference taking inside put_fence_reg
doesn't make sense because the other caller (set_tiling ioctl) _does_ hold
its own reference.
I'll update the comment to make more sense.
-Daniel
--
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48
More information about the Intel-gfx
mailing list