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/via Fix these drm waits too, ...
details: https://anonhg.NetBSD.org/src/rev/406b4cff5c41
branches: trunk
changeset: 336394:406b4cff5c41
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sat Feb 28 03:23:32 2015 +0000
description:
Fix these drm waits too, in case anyone tries to use this via code.
diffstat:
sys/external/bsd/drm2/dist/drm/via/via_dmablit.c | 19 +++++++++++++++++--
sys/external/bsd/drm2/dist/drm/via/via_irq.c | 6 ++++++
sys/external/bsd/drm2/dist/drm/via/via_video.c | 6 ++++++
3 files changed, 29 insertions(+), 2 deletions(-)
diffs (69 lines):
diff -r 46a7c20e1c81 -r 406b4cff5c41 sys/external/bsd/drm2/dist/drm/via/via_dmablit.c
--- a/sys/external/bsd/drm2/dist/drm/via/via_dmablit.c Sat Feb 28 03:22:50 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/via/via_dmablit.c Sat Feb 28 03:23:32 2015 +0000
@@ -600,6 +600,12 @@
DRM_SPIN_TIMED_WAIT_UNTIL(ret, queue, &blitq->blit_lock,
3*DRM_HZ,
!via_dmablit_active(blitq, engine, handle, NULL));
+ if (ret < 0) /* Failure: return negative error as is. */
+ ;
+ else if (ret == 0) /* Timed out: return -EBUSY like Linux. */
+ ret = -EBUSY;
+ else /* Succeeded (ret > 0): return 0. */
+ ret = 0;
}
spin_unlock(&blitq->blit_lock);
#else
@@ -878,9 +884,18 @@
DRM_SPIN_TIMED_WAIT_UNTIL(ret, &blitq->busy_queue,
&blitq->blit_lock, DRM_HZ,
blitq->num_free > 0);
+ if (ret < 0) /* Failure: return negative error as is. */
+ ;
+ else if (ret == 0) /* Timed out: return -EBUSY like Linux. */
+ ret = -EBUSY;
+ else /* Success (ret > 0): return 0. */
+ ret = 0;
+ /* Map -EINTR to -EAGAIN. */
+ if (ret == -EINTR)
+ ret = -EAGAIN;
+ /* Bail on failure. */
if (ret) {
- if (ret == -EINTR)
- ret = -EAGAIN;
+ spin_unlock_irqrestore(&blitq->blit_lock, irqsave);
return ret;
}
#else
diff -r 46a7c20e1c81 -r 406b4cff5c41 sys/external/bsd/drm2/dist/drm/via/via_irq.c
--- a/sys/external/bsd/drm2/dist/drm/via/via_irq.c Sat Feb 28 03:22:50 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/via/via_irq.c Sat Feb 28 03:23:32 2015 +0000
@@ -260,6 +260,12 @@
(((cur_irq_sequence = cur_irq->irq_received) -
*sequence) <= (1 << 23)));
}
+ if (ret < 0) /* Failure: return negative error as is. */
+ ;
+ else if (ret == 0) /* Timed out: return -EBUSY like Linux. */
+ ret = -EBUSY;
+ else /* Success (ret > 0): return 0. */
+ ret = 0;
spin_unlock(&cur_irq->irq_lock);
#else
if (masks[real_irq][2] && !force_sequence) {
diff -r 46a7c20e1c81 -r 406b4cff5c41 sys/external/bsd/drm2/dist/drm/via/via_video.c
--- a/sys/external/bsd/drm2/dist/drm/via/via_video.c Sat Feb 28 03:22:50 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/via/via_video.c Sat Feb 28 03:23:32 2015 +0000
@@ -108,6 +108,12 @@
&dev_priv->decoder_lock[fx->lock],
(fx->ms / 10) * (DRM_HZ / 100),
*lock != fx->val);
+ if (ret < 0) /* Failure: return negative error as is. */
+ ;
+ else if (ret == 0) /* Timed out: return -EBUSY like Linux. */
+ ret = -EBUSY;
+ else /* Success (ret > 0): return 0. */
+ ret = 0;
mutex_unlock(&dev_priv->decoder_lock[fx->lock]);
#else
DRM_WAIT_ON(ret, dev_priv->decoder_queue[fx->lock],
Home |
Main Index |
Thread Index |
Old Index