Possible fb ref count issue with drm_plane_force_disable()

Tomi Valkeinen tomi.valkeinen at ti.com
Mon Apr 14 01:43:44 PDT 2014


On 11/04/14 14:50, Ville Syrjälä wrote:

>> So the explicit unref done by drm_plane_force_disable() seems a bit out
>> of place. I can't figure out which drm_framebuffer_reference() would be
>> the matching one for the unref done by drm_plane_force_disable().
>>
>> Any ideas what ref is that? Or is the __drm_framebuffer_unreference()
>> extra in drm_plane_force_disable()?
> 
> That's the reference that was taken by the drm_mode_setplane() when it
> succesfully called the .update_plane() hook.

But drm_mode_setplane() is called via DRM_IOCTL_MODE_SETPLANE, which is
only used for "proper" planes, not for crtc primary planes, right?

At least I don't see drm_mode_setplane() in my stack traces, and git
grep doesn't show it called via any other means than ioctl.

I am not using any planes from my app, just the crtc and (indirectly)
its primary plane.

I've attached a slightly cleaned up log when running my test app. I have
dump_stack()s in the drm_framebuffer_(un)reference functions, and a
printk just before the dump_stack which prints something like "REF FB
ID: 36: 2", where 36 is the fb id, and 2 is the ref count after the
ref/unref.

In the middle of the log there are multiple blank lines, that's where I
ctrl-c the app and it starts shutting down. FB ID 35 is probably the
fbconsole fb, and 36 is the app's fb. And at some point the FB ID 36
changes to 0, as the drm framework clears it.

> __drm_framebuffer_unregister() drops the "idr reference" taken in
> drm_framebuffer_init().

What's "idr"?

 Tomi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: m.log
Type: text/x-log
Size: 23295 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140414/e7daf2a2/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140414/e7daf2a2/attachment-0001.sig>


More information about the dri-devel mailing list