diff options
author | rnoland <rnoland@FreeBSD.org> | 2009-03-25 01:44:16 +0000 |
---|---|---|
committer | rnoland <rnoland@FreeBSD.org> | 2009-03-25 01:44:16 +0000 |
commit | 6a5678040a495b6236de7ac15c5f38e2e596b313 (patch) | |
tree | b1dfae8c15570a4eea385f1312532c1d6e016673 /sys/dev/drm/i915_irq.c | |
parent | 164b031cdab9c3c6fde3eaf86f2c8497d090d300 (diff) | |
download | FreeBSD-src-6a5678040a495b6236de7ac15c5f38e2e596b313.zip FreeBSD-src-6a5678040a495b6236de7ac15c5f38e2e596b313.tar.gz |
Intel handled the management of the breadcrumb counter inconsistently.
Make sure that we always handle it the same way.
MFC after: 3 days
Diffstat (limited to 'sys/dev/drm/i915_irq.c')
-rw-r--r-- | sys/dev/drm/i915_irq.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/dev/drm/i915_irq.c b/sys/dev/drm/i915_irq.c index 18400b2..7583031 100644 --- a/sys/dev/drm/i915_irq.c +++ b/sys/dev/drm/i915_irq.c @@ -284,14 +284,13 @@ static int i915_emit_irq(struct drm_device * dev) i915_kernel_lost_context(dev); - DRM_DEBUG("\n"); - - dev_priv->counter++; - if (dev_priv->counter > 0x7FFFFFFFUL) - dev_priv->counter = 1; + if (++dev_priv->counter > 0x7FFFFFFFUL) + dev_priv->counter = 0; if (dev_priv->sarea_priv) dev_priv->sarea_priv->last_enqueue = dev_priv->counter; + DRM_DEBUG("emitting: %d\n", dev_priv->counter); + BEGIN_LP_RING(4); OUT_RING(MI_STORE_DWORD_INDEX); OUT_RING(I915_BREADCRUMB_INDEX << MI_STORE_DWORD_INDEX_SHIFT); @@ -331,9 +330,6 @@ static int i915_wait_irq(struct drm_device * dev, int irq_nr) drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; int ret = 0; - DRM_DEBUG("irq_nr=%d breadcrumb=%d\n", irq_nr, - READ_BREADCRUMB(dev_priv)); - if (READ_BREADCRUMB(dev_priv) >= irq_nr) { if (dev_priv->sarea_priv) { dev_priv->sarea_priv->last_dispatch = @@ -345,6 +341,9 @@ static int i915_wait_irq(struct drm_device * dev, int irq_nr) if (dev_priv->sarea_priv) dev_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT; + DRM_DEBUG("irq_nr=%d breadcrumb=%d\n", irq_nr, + READ_BREADCRUMB(dev_priv)); + i915_user_irq_get(dev); DRM_WAIT_ON(ret, dev_priv->irq_queue, 3 * DRM_HZ, READ_BREADCRUMB(dev_priv) >= irq_nr); |