summaryrefslogtreecommitdiff
path: root/sys/arch/sgi/pci
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2010-04-25 21:53:22 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2010-04-25 21:53:22 +0000
commit3716aab5478c0f8fe1bf13ffa77fa77022da8649 (patch)
treefa8720ca818dcc0fc8bdbbc350569e0d30635e8d /sys/arch/sgi/pci
parent96d21338d8fed1ef5b9aae65dd4646ce125dadcd (diff)
The locking rework/fix that I promised when I commited GEM.
Before, as well as being kinda nasty there was a very definite race, if the last reference to an object was removed by uvm (a map going away), then the free path happened unlocked, this could cause all kinds of havoc. In order to deal with this, move to fine-grained locking. Since uvm object locks are spinlocks, and we need to sleep in operations that will wait on the gpu, provide a DRM_BUSY flag that is set on a locked object that then allows us to unlock and sleep (this is similar to several things done in uvm on pages and some object types). The rwlock stays around to ensure that execbuffer can have acces to the whole gtt, so ioctls that bind to the gtt need a read lock, and execuffer gets a write lock. otherwise most ioctls just need to busy the object that they operate on. Lists also have their own locks. Some cleanup could be done to make this a little prettier, but it is much more correct than previously. Tested very very vigorously on 855 (x40) and 965 (x61s), this found numerous bugs. Also, the I can no longer crash the kernel at will. A bunch of asserts hidden under DRMLOCKDEBUG have been left in the code for debugging purposes.
Diffstat (limited to 'sys/arch/sgi/pci')
0 files changed, 0 insertions, 0 deletions