[Intel-gfx] [PATCH] drm/i915: Unpin vma iomapping when fbdev is destroyed

Chris Wilson chris at chris-wilson.co.uk
Tue Jul 4 12:36:37 UTC 2017


Quoting Tvrtko Ursulin (2017-07-04 13:33:28)
> 
> On 04/07/2017 12:29, Chris Wilson wrote:
> > Quoting Tvrtko Ursulin (2017-07-04 12:26:31)
> >>
> >> On 04/07/2017 11:17, Chris Wilson wrote:
> >>> Quoting Tvrtko Ursulin (2017-07-04 10:46:40)
> >>>> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> >>>>
> >>>> If we don't release the iomapping we are not able to unpin the
> >>>> vma which then gets leaked.
> >>>
> >>> Oh, we still do unpin the vma on closing the object and we don't hold
> >>> any extra object reference for the iomap. It is still a good patch for
> >>> the symmetry, except it doesn't do what you say :-)
> >>
> >> What do you mean that we don't hold any extra reference for the iomap? I
> >> see i915_vma_pin_iomap -> __i915_vma_pin -> vma->flags++. I can't spot
> >> the place which would override this and still unbind it at some point.
> > 
> > free_objects:
> >       vma->flags &= ~I915_VMA_PIN_MASK;
> >       i915_vma_close(vma);
> 
> Blast.. :) Do we need the unpin in the API at all then?

Yes, free_objects is a little late in general :)

If we fix up fbdev, we should be close enough to make that a
if (WARN_ON(i915_vma_is_pinned(vma)))
	vma->flags &= ~I915_VMA_PIN_MASK;
-Chris


More information about the Intel-gfx mailing list