drm: Use lockmgr locks with Linux wait queues
* On Linux, it is possible to grab a second spinlock in an already
spinlock-protected code section.
* The wait_event() macro is used in such a situation in the i915 driver.
One of the event checks itself tries to grab a second lock. What's more,
this second lock is a lockmgr lock in the DragonFly kernel. This results
in the following situation:
spinlock
lockmgr LK_EXCLUSIVE
spinunlock
* Unfortunately if the lockmgr lock can't be acquired, the thread is put
to sleep and a thread sleeping with a spinlock held leads to a general
system freeze or a kernel panic.
* For that reason, we can't use a spinlock in Linux wait queues. Change
the internal wait_queue_head_t lock to a lockmgr lock.
Thanks go to Imre Vadász for spotting this horrible issue.