]> git.baikalelectronics.ru Git - kernel.git/commit
drm/modes: move reference taking into object lookup.
authorDave Airlie <airlied@redhat.com>
Fri, 15 Apr 2016 05:10:40 +0000 (15:10 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 22 Apr 2016 00:42:54 +0000 (10:42 +1000)
commit39ac662bedfdbacf15f5e9cbc6c7bbcd3b2866d9
treeb642708fbe03ce2eabb4f021b3d82a1d2c595082
parent8ffbd5f01dd0c0b71fab7dd7fc0fd095a929ddc8
drm/modes: move reference taking into object lookup.

When we lookup an ref counted object we now take a proper reference
using kref_get_unless_zero.

Framebuffer lookup no longer needs do this itself.

Convert rmfb to using framebuffer lookup and deal with the fact
it now gets an extra reference that we have to cleanup. This should
mean we can avoid holding fb_lock across rmfb. (if I'm wrong let me
know).

We also now only hold the fbs_lock around the list manipulation.

"Previously fb refcounting, and especially the weak reference
(kref_get_unless_zero) used in fb lookups have been protected by fb_lock.
But with the refactoring to share refcounting in the drm_mode_object base
class that switched to being protected by idr_mutex, which means fb_lock
critical sections can be reduced."

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_crtc.c