summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/i915_dma.c21
-rw-r--r--shared-core/i915_irq.c5
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__);