Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/dist/drm/i915 Convert pending_flip_loc...
details: https://anonhg.NetBSD.org/src/rev/4edf56d74c08
branches: trunk
changeset: 328980:4edf56d74c08
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sat Apr 26 20:26:26 2014 +0000
description:
Convert pending_flip_lock to spin lock -- interrupt handlers take it.
diffstat:
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c | 4 +-
sys/external/bsd/drm2/dist/drm/i915/i915_drv.h | 2 +-
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c | 2 +-
sys/external/bsd/drm2/dist/drm/i915/intel_display.c | 24 +++++++++++++-------
4 files changed, 19 insertions(+), 13 deletions(-)
diffs (99 lines):
diff -r 4f5789ec987d -r 4edf56d74c08 sys/external/bsd/drm2/dist/drm/i915/i915_dma.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c Sat Apr 26 20:25:07 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c Sat Apr 26 20:26:26 2014 +0000
@@ -1756,7 +1756,7 @@
spin_lock_destroy(&dev_priv->dpio_lock);
linux_mutex_destroy(&dev_priv->rps.hw_lock);
DRM_DESTROY_WAITQUEUE(&dev_priv->pending_flip_queue);
- linux_mutex_destroy(&dev_priv->pending_flip_lock);
+ spin_lock_destroy(&dev_priv->pending_flip_lock);
destroy_completion(&dev_priv->error_completion);
#endif
@@ -1878,7 +1878,7 @@
#ifdef __NetBSD__
/* XXX Not sure this is the right place, but it looks safe. */
DRM_DESTROY_WAITQUEUE(&dev_priv->pending_flip_queue);
- linux_mutex_destroy(&dev_priv->pending_flip_lock);
+ spin_lock_destroy(&dev_priv->pending_flip_lock);
destroy_completion(&dev_priv->error_completion);
#endif
diff -r 4f5789ec987d -r 4edf56d74c08 sys/external/bsd/drm2/dist/drm/i915/i915_drv.h
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h Sat Apr 26 20:25:07 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h Sat Apr 26 20:26:26 2014 +0000
@@ -891,7 +891,7 @@
struct drm_crtc *pipe_to_crtc_mapping[3];
#ifdef __NetBSD__
/* XXX The locking scheme looks broken. This mutex is a stop-gap. */
- struct mutex pending_flip_lock;
+ struct spinlock pending_flip_lock;
drm_waitqueue_t pending_flip_queue;
#else
wait_queue_head_t pending_flip_queue;
diff -r 4f5789ec987d -r 4edf56d74c08 sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c Sat Apr 26 20:25:07 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c Sat Apr 26 20:26:26 2014 +0000
@@ -4643,7 +4643,7 @@
i915_gem_detect_bit_6_swizzle(dev);
#ifdef __NetBSD__
DRM_INIT_WAITQUEUE(&dev_priv->pending_flip_queue, "i915flip");
- linux_mutex_init(&dev_priv->pending_flip_lock);
+ spin_lock_init(&dev_priv->pending_flip_lock);
#else
init_waitqueue_head(&dev_priv->pending_flip_queue);
#endif
diff -r 4f5789ec987d -r 4edf56d74c08 sys/external/bsd/drm2/dist/drm/i915/intel_display.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_display.c Sat Apr 26 20:25:07 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_display.c Sat Apr 26 20:26:26 2014 +0000
@@ -2248,12 +2248,15 @@
int ret;
#ifdef __NetBSD__
- mutex_lock(&dev_priv->pending_flip_lock);
- DRM_WAIT_NOINTR_UNTIL(ret, &dev_priv->pending_flip_queue,
+ {
+ unsigned long flags;
+ spin_lock_irqsave(&dev_priv->pending_flip_lock, flags);
+ DRM_SPIN_WAIT_NOINTR_UNTIL(ret, &dev_priv->pending_flip_queue,
&dev_priv->pending_flip_lock,
(atomic_read(&dev_priv->mm.wedged) ||
atomic_read(&obj->pending_flip) == 0));
- mutex_unlock(&dev_priv->pending_flip_lock);
+ spin_unlock_irqrestore(&dev_priv->pending_flip_lock, flags);
+ }
#else
wait_event(dev_priv->pending_flip_queue,
atomic_read(&dev_priv->mm.wedged) ||
@@ -2968,11 +2971,14 @@
return;
#ifdef __NetBSD__
- mutex_lock(&dev_priv->pending_flip_lock);
- DRM_WAIT_NOINTR_UNTIL(error, &dev_priv->pending_flip_queue,
+ {
+ unsigned long flags;
+ spin_lock_irqsave(&dev_priv->pending_flip_lock, flags);
+ DRM_SPIN_WAIT_NOINTR_UNTIL(error, &dev_priv->pending_flip_queue,
&dev_priv->pending_flip_lock,
!intel_crtc_has_pending_flip(crtc));
- mutex_unlock(&dev_priv->pending_flip_lock);
+ spin_unlock_irqrestore(&dev_priv->pending_flip_lock, flags);
+ }
#else
wait_event(dev_priv->pending_flip_queue,
!intel_crtc_has_pending_flip(crtc));
@@ -7148,10 +7154,10 @@
#ifdef __NetBSD__ /* XXX */
atomic_clear_mask(1 << intel_crtc->plane, &obj->pending_flip);
- mutex_lock(&dev_priv->pending_flip_lock);
- DRM_WAKEUP_ONE(&dev_priv->pending_flip_queue,
+ spin_lock_irqsave(&dev_priv->pending_flip_lock, flags);
+ DRM_SPIN_WAKEUP_ONE(&dev_priv->pending_flip_queue,
&dev_priv->pending_flip_lock);
- mutex_unlock(&dev_priv->pending_flip_lock);
+ spin_unlock_irqrestore(&dev_priv->pending_flip_lock, flags);
#else
atomic_clear_mask(1 << intel_crtc->plane,
&obj->pending_flip.counter);
Home |
Main Index |
Thread Index |
Old Index