diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-07-07 16:29:58 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-07-07 16:29:58 +0000 |
commit | bebad0e0d947b28d0f3afa3ae62cd72d3a668c94 (patch) | |
tree | 390c5c5e3969b4864e34063ca9e6e8a106df5bf1 /sys/dev/pci/drm/drm_drv.c | |
parent | c876820f6edb4eb03f734d949aad2f9c88e2c318 (diff) |
The current drm_locked_task*() code sometimes tries to sleep in an
interrupt handler.
This is bad and wrong. So change it so that if we can't immediately grab
the hardware lock, to just leave the task flagged so that we can run it
when we release the lock. The linux implementation uses a similar
scheme.
Tested by guenther@, landry@ and bernd@. Also tested by many a while
ago as part of a larger diff.
Diffstat (limited to 'sys/dev/pci/drm/drm_drv.c')
-rw-r--r-- | sys/dev/pci/drm/drm_drv.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c index 3175dacaf9d..9f5a107d068 100644 --- a/sys/dev/pci/drm/drm_drv.c +++ b/sys/dev/pci/drm/drm_drv.c @@ -169,7 +169,8 @@ drm_attach(struct device *parent, struct device *kdev, dev->pci_slot = pa->pa_device; dev->pci_func = pa->pa_function; DRM_SPININIT(&dev->dev_lock, "drm device"); - DRM_SPININIT(&dev->drw_lock, "drm drawable lock"); + mtx_init(&dev->drw_lock, IPL_BIO); + mtx_init(&dev->tsk_lock, IPL_BIO); id_entry = drm_find_description(PCI_VENDOR(pa->pa_id), PCI_PRODUCT(pa->pa_id), idlist); |