]> git.baikalelectronics.ru Git - kernel.git/commit
drm/nouveau: try to protect nbo->pin_refcount
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 11 Dec 2012 20:52:30 +0000 (21:52 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 20 Jan 2013 14:57:56 +0000 (15:57 +0100)
commit30e755fcb45864fa63d0d1d68aafcbbe2351a93c
tree34f34e14b0cf7cd9eb68cdb72cb63a3157889ab1
parent0dc3c0115653f0c477c2ec8fa523a682a9259192
drm/nouveau: try to protect nbo->pin_refcount

... by moving the bo_pin/bo_unpin manipulation of the pin_refcount
under the protection of the ttm reservation lock. pin/unpin seems
to get called from all over the place, so atm this is completely racy.

After this patch there are only a few places in cleanup functions
left which access ->pin_refcount without locking. But I'm hoping that
those are safe and some other code invariant guarantees that this
won't blow up.

In any case, I only need to fix up pin/unpin to make ->pageflip work
safely, so let's keep it at that.

Add a comment to the header to explain the new locking rule.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/nouveau/nouveau_bo.c
drivers/gpu/drm/nouveau/nouveau_bo.h