[Intel-gfx] [RFC v2 1/4] drm: Add support to find drm_panel by name

Thierry Reding thierry.reding at gmail.com
Fri Jan 16 04:19:04 PST 2015


On Tue, Jan 13, 2015 at 12:08:11AM +0100, Daniel Vetter wrote:
> On Fri, Jan 9, 2015 at 1:50 PM, Jani Nikula <jani.nikula at intel.com> wrote:
> > I have a slightly uneasy feeling about handing out drm_panel pointers
> > (both from here and of_drm_find_panel) without refcounting. If the panel
> > driver gets removed, whoever called the find functions will have a
> > dangling pointer. I supposed this will be discussed on drm-devel.
> 
> There's been some discussion already about exactly this problem (but
> with drm bridges) with Thierry and some other people. Cc'ed them all
> hopefully. Especially when the panel/bridge is a separate driver
> there's imo indeed an issue.

I posted patches some time ago to create a generic registry to do the
actual ref-counting[0]. It didn't seem to be very well received by Greg
for the core, so perhaps we could test-drive it in DRM first for panels
and bridges and once it's matured a bit it could still be promoted to
the driver core, or maybe lib/.

The difficult part about it is that while reference counting gives you
the benefit of keeping a valid pointer around, you may still want to
have a method of getting notified of the panel going away. I've thought
a bit about that and I think we could probably integrate that into the
registry, since that will notice anyway.

Thierry

[0]: http://www.spinics.net/linux/lists/kernel/msg1859333.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20150116/dc7a3eb8/attachment.sig>


More information about the Intel-gfx mailing list