[Intel-gfx] [PATCH] drm/i915: release cursor when crtc is destroyed

Daniel Vetter daniel at ffwll.ch
Tue Apr 23 18:10:10 CEST 2013


On Tue, Apr 23, 2013 at 4:58 PM, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> On Tue, Apr 23, 2013 at 04:56:09PM +0200, Daniel Vetter wrote:
>> On Tue, Apr 23, 2013 at 05:27:08PM +0300, Mika Kuoppala wrote:
>> > crtc is holding a reference to a cursor bo and it needs
>> > to be released when crtc is destroyed so that we don't leak
>> > the cursor bo.
>> >
>> > v2: Enhance set and move cursor so that disabled
>> > cursor is handled correctly (Ville Syrjälä)
>> >
>> > Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>
>>
>> Oh, nice catch!
>>
>> Could we somehow test this in an igt? I'm thinking of the following
>> sequence:
>> - Check how many objects there are in debugfs (maybe that needs a slightly
>>   saner interface than what we currently have in i915_gem_objects).
>> - Setup a mode and provoke the leak (we could augment the tests with
>>   sprites and similar stuff).
>> - Check whether the object count dropped back to the old value or not. If
>>   not, fail the test.
>
> It's a leak upon module unload, so presumably you want to use kmemleak
> instead.

Hm, right, I think the cursor ref will survive a crtc off with the
current patch from Mika. Should we bother to rectify this?

Also I've just wondered where exactly we clean up the display state
and drop the fb reference ... Is that just by accident due module
unload only happening with fbcon at the helm and us clearing up the
fbcon fb manually?
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list