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 Make timed and untimed c...
details: https://anonhg.NetBSD.org/src/rev/5c96943c708a
branches: trunk
changeset: 336399:5c96943c708a
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sat Feb 28 04:47:44 2015 +0000
description:
Make timed and untimed cases of __wait_seqno agree on return value.
diffstat:
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diffs (37 lines):
diff -r 35259b95ef1d -r 5c96943c708a sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c Sat Feb 28 04:18:12 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c Sat Feb 28 04:47:44 2015 +0000
@@ -1427,6 +1427,12 @@
else
DRM_SPIN_TIMED_WAIT_NOINTR_UNTIL(ret, &ring->irq_queue,
&dev_priv->irq_lock, ticks, EXIT_COND);
+ if (ret < 0) /* Failure: return negative error as is. */
+ ;
+ else if (ret == 0) /* Timed out: return -ETIME. */
+ ret = -ETIME;
+ else /* Succeeded (ret > 0): return 0. */
+ ret = 0;
} else {
if (interruptible)
DRM_SPIN_WAIT_UNTIL(ret, &ring->irq_queue,
@@ -1434,6 +1440,7 @@
else
DRM_SPIN_WAIT_NOINTR_UNTIL(ret, &ring->irq_queue,
&dev_priv->irq_lock, EXIT_COND);
+ /* ret is negative on failure or zero on success. */
}
#undef EXIT_COND
spin_unlock(&dev_priv->irq_lock);
@@ -1463,11 +1470,7 @@
if (ret == 0)
ret = -EAGAIN;
}
- if (ret < 0) /* Error. */
- return ret;
- if (ret == 0) /* Seqno didn't pass. */
- return -ETIME;
- return 0; /* Seqno passed, maybe time to spare. */
+ return ret;
}
#else
static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
Home |
Main Index |
Thread Index |
Old Index