diff options
author | Dave Airlie <airlied@linux.ie> | 2004-11-11 11:09:11 +0000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2004-11-11 11:09:11 +0000 |
commit | f0a86288fa4d7b951f33f7b1a6ef36106c7df788 (patch) | |
tree | 8707efa038d18e563a4e2e415e5ba9c5249f5925 /shared-core | |
parent | 4b4df875b26bd08ae62f26b8ced6a050425752ac (diff) |
patch from bug 1803 - will try and push to kernel soon
Diffstat (limited to 'shared-core')
-rw-r--r-- | shared-core/i915_dma.c | 21 | ||||
-rw-r--r-- | shared-core/i915_irq.c | 5 |
2 files changed, 6 insertions, 20 deletions
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c index c46ef9d6..8d986129 100644 --- a/shared-core/i915_dma.c +++ b/shared-core/i915_dma.c @@ -559,10 +559,7 @@ int i915_flush_ioctl(DRM_IOCTL_ARGS) { DRM_DEVICE; - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i915_flush_ioctl called without lock held\n"); - return DRM_ERR(EINVAL); - } + LOCK_TEST_WITH_RETURN(dev, filp); return i915_quiescent(dev); } @@ -588,10 +585,7 @@ int i915_batchbuffer(DRM_IOCTL_ARGS) DRM_DEBUG("i915 batchbuffer, start %x used %d cliprects %d\n", batch.start, batch.used, batch.num_cliprects); - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i915_batchbuffer called without lock held\n"); - return DRM_ERR(EINVAL); - } + LOCK_TEST_WITH_RETURN(dev, filp); if (batch.num_cliprects && DRM_VERIFYAREA_READ(batch.cliprects, batch.num_cliprects * @@ -620,10 +614,7 @@ int i915_cmdbuffer(DRM_IOCTL_ARGS) DRM_DEBUG("i915 cmdbuffer, buf %p sz %d cliprects %d\n", cmdbuf.buf, cmdbuf.sz, cmdbuf.num_cliprects); - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i915_cmdbuffer called without lock held\n"); - return DRM_ERR(EINVAL); - } + LOCK_TEST_WITH_RETURN(dev, filp); if (cmdbuf.num_cliprects && DRM_VERIFYAREA_READ(cmdbuf.cliprects, @@ -659,10 +650,8 @@ int i915_flip_bufs(DRM_IOCTL_ARGS) DRM_DEVICE; DRM_DEBUG("%s\n", __FUNCTION__); - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i915_flip_buf called without lock held\n"); - return DRM_ERR(EINVAL); - } + + LOCK_TEST_WITH_RETURN(dev, filp); return i915_dispatch_flip(dev); } diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c index 04c627b9..bd649383 100644 --- a/shared-core/i915_irq.c +++ b/shared-core/i915_irq.c @@ -91,10 +91,7 @@ int i915_irq_emit(DRM_IOCTL_ARGS) drm_i915_irq_emit_t emit; int result; - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { - DRM_ERROR("i915_irq_emit called without lock held\n"); - return DRM_ERR(EINVAL); - } + LOCK_TEST_WITH_RETURN(dev, filp); if (!dev_priv) { DRM_ERROR("%s called with no initialization\n", __FUNCTION__); |