]> git.baikalelectronics.ru Git - kernel.git/commit
drm/ttm/radeon/nouveau: Kill the bo lock in favour of a bo device fence_lock
authorThomas Hellstrom <thellstrom@vmware.com>
Wed, 17 Nov 2010 12:28:29 +0000 (12:28 +0000)
committerDave Airlie <airlied@redhat.com>
Mon, 22 Nov 2010 03:25:18 +0000 (13:25 +1000)
commit02ff8ab552ee5d7959c5e35e8cfee6ac70b18172
treea9c6a1ad8ebaf9970a87b7047357b6d7232b70e6
parent3eb7013364104522498ecf17f5960931c6cc9f54
drm/ttm/radeon/nouveau: Kill the bo lock in favour of a bo device fence_lock

The bo lock used only to protect the bo sync object members, and since it
is a per bo lock, fencing a buffer list will see a lot of locks and unlocks.
Replace it with a per-device lock that protects the sync object members on
*all* bos. Reading and setting these members will always be very quick, so
the risc of heavy lock contention is microscopic. Note that waiting for
sync objects will always take place outside of this lock.

The bo device fence lock will eventually be replaced with a seqlock /
rcu mechanism so we can determine that a bo is idle under a
rcu / read seqlock.

However this change will allow us to batch fencing and unreserving of
buffers with a minimal amount of locking.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jerome Glisse <j.glisse@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/nouveau/nouveau_gem.c
drivers/gpu/drm/radeon/radeon_object.c
drivers/gpu/drm/radeon/radeon_object.h
drivers/gpu/drm/ttm/ttm_bo.c
drivers/gpu/drm/ttm/ttm_bo_util.c
drivers/gpu/drm/ttm/ttm_bo_vm.c
drivers/gpu/drm/ttm/ttm_execbuf_util.c
include/drm/ttm/ttm_bo_api.h
include/drm/ttm/ttm_bo_driver.h