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_dma.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_dma.c')
-rw-r--r-- | sys/dev/drm/i915_dma.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/drm/i915_dma.c b/sys/dev/drm/i915_dma.c index db43a88..a701a5e 100644 --- a/sys/dev/drm/i915_dma.c +++ b/sys/dev/drm/i915_dma.c @@ -439,8 +439,7 @@ static void i915_emit_breadcrumb(struct drm_device *dev) drm_i915_private_t *dev_priv = dev->dev_private; RING_LOCALS; - dev_priv->counter++; - if (dev_priv->counter > 0x7FFFFFFFUL) + if (++dev_priv->counter > 0x7FFFFFFFUL) dev_priv->counter = 0; if (dev_priv->sarea_priv) dev_priv->sarea_priv->last_enqueue = dev_priv->counter; @@ -574,7 +573,10 @@ static int i915_dispatch_flip(struct drm_device * dev) OUT_RING(0); ADVANCE_LP_RING(); - dev_priv->sarea_priv->last_enqueue = dev_priv->counter++; + if (++dev_priv->counter > 0x7FFFFFFFUL) + dev_priv->counter = 0; + if (dev_priv->sarea_priv) + dev_priv->sarea_priv->last_enqueue = dev_priv->counter; BEGIN_LP_RING(4); OUT_RING(MI_STORE_DWORD_INDEX); |