diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-12-12 00:52:30 +0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-01-20 18:57:56 +0400 |
commit | 0ae6d7bc0e70dafc1739d50b2b8d9d7c61968395 (patch) | |
tree | 34f34e14b0cf7cd9eb68cdb72cb63a3157889ab1 /drivers/gpu/drm/nouveau/nouveau_bo.h | |
parent | 59ad1465423d968f06f243bc52cc3b1a320a27cf (diff) | |
download | linux-0ae6d7bc0e70dafc1739d50b2b8d9d7c61968395.tar.xz |
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>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bo.h')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bo.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.h b/drivers/gpu/drm/nouveau/nouveau_bo.h index 25ca37989d2c..81d00fe03b56 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.h +++ b/drivers/gpu/drm/nouveau/nouveau_bo.h @@ -28,6 +28,8 @@ struct nouveau_bo { struct nouveau_drm_tile *tile; struct drm_gem_object *gem; + + /* protect by the ttm reservation lock */ int pin_refcnt; struct ttm_bo_kmap_obj dma_buf_vmap; |