summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2008-11-04 00:22:13 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2008-11-04 00:22:13 +0000
commitd959cbfc96fc73f0010f4cedd6994ea96841ceb1 (patch)
tree1d8d5de48cc771eb25bdb303d664a76cba8464ad /sys/dev/pci
parent763289fca04b799b0d71b39173f0d208ec7e0573 (diff)
Hold the drm lock around all things that touch the ringbuffer.
Not strictly needed in the non-gem case, but it will be needed then, and doesn't hurt now. From Eric Anholt at intel.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/drm/i915_dma.c15
-rw-r--r--sys/dev/pci/drm/i915_irq.c2
2 files changed, 14 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/i915_dma.c b/sys/dev/pci/drm/i915_dma.c
index 9a3d6707c86..70656ea3bfd 100644
--- a/sys/dev/pci/drm/i915_dma.c
+++ b/sys/dev/pci/drm/i915_dma.c
@@ -594,10 +594,15 @@ int i915_quiescent(struct drm_device *dev)
int i915_flush_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
+ int ret;
LOCK_TEST_WITH_RETURN(dev, file_priv);
- return i915_quiescent(dev);
+ DRM_LOCK();
+ ret = i915_quiescent(dev);
+ DRM_UNLOCK();
+
+ return (ret);
}
int i915_batchbuffer(struct drm_device *dev, void *data,
@@ -627,7 +632,9 @@ int i915_batchbuffer(struct drm_device *dev, void *data,
sizeof(struct drm_clip_rect)))
return EFAULT;
+ DRM_LOCK();
ret = i915_dispatch_batchbuffer(dev, batch);
+ DRM_UNLOCK();
sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv);
return ret;
@@ -657,7 +664,9 @@ int i915_cmdbuffer(struct drm_device *dev, void *data,
return EFAULT;
}
+ DRM_LOCK();
ret = i915_dispatch_cmdbuffer(dev, cmdbuf);
+ DRM_UNLOCK();
if (ret) {
DRM_ERROR("i915_dispatch_cmdbuffer failed\n");
return ret;
@@ -673,9 +682,9 @@ int i915_flip_bufs(struct drm_device *dev, void *data, struct drm_file *file_pri
LOCK_TEST_WITH_RETURN(dev, file_priv);
-
-
+ DRM_LOCK();
i915_dispatch_flip(dev);
+ DRM_UNLOCK();
return 0;
}
diff --git a/sys/dev/pci/drm/i915_irq.c b/sys/dev/pci/drm/i915_irq.c
index 4ad4824228a..d8e4c3a3921 100644
--- a/sys/dev/pci/drm/i915_irq.c
+++ b/sys/dev/pci/drm/i915_irq.c
@@ -504,7 +504,9 @@ int i915_irq_emit(struct drm_device *dev, void *data,
return EINVAL;
}
+ DRM_LOCK();
result = i915_emit_irq(dev);
+ DRM_UNLOCK();
if (DRM_COPY_TO_USER(emit->irq_seq, &result, sizeof(int))) {
DRM_ERROR("copy_to_user\n");