diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-21 05:07:18 -0500 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-23 07:52:11 -0500 |
commit | 076e2c0eb83f1a0e2e7d0ae1e4d4c0f7b13f1f64 (patch) | |
tree | 8400486c1b98ef0cd0f960666c0e5b9beec81bab | |
parent | c7dca47bd6fbb7c215cb1ce6bc40398b4b017752 (diff) |
drm/i915: Fix use of invalid array size for ring->sync_seqno
There are I915_NUM_RINGS-1 inter-ring synchronisation counters, but we
were clearing I915_NUM_RINGS of them. Oops.
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Tested-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 3dfc848ff755..812b97b47469 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -1857,7 +1857,7 @@ i915_gem_retire_requests_ring(struct drm_device *dev, | |||
1857 | 1857 | ||
1858 | seqno = ring->get_seqno(ring); | 1858 | seqno = ring->get_seqno(ring); |
1859 | 1859 | ||
1860 | for (i = 0; i < I915_NUM_RINGS; i++) | 1860 | for (i = 0; i < ARRAY_SIZE(ring->sync_seqno); i++) |
1861 | if (seqno >= ring->sync_seqno[i]) | 1861 | if (seqno >= ring->sync_seqno[i]) |
1862 | ring->sync_seqno[i] = 0; | 1862 | ring->sync_seqno[i] = 0; |
1863 | 1863 | ||
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index dcfdf4151b6d..d2f445e825f2 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c | |||
@@ -1175,7 +1175,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
1175 | goto err; | 1175 | goto err; |
1176 | 1176 | ||
1177 | seqno = i915_gem_next_request_seqno(dev, ring); | 1177 | seqno = i915_gem_next_request_seqno(dev, ring); |
1178 | for (i = 0; i < I915_NUM_RINGS-1; i++) { | 1178 | for (i = 0; i < ARRAY_SIZE(ring->sync_seqno); i++) { |
1179 | if (seqno < ring->sync_seqno[i]) { | 1179 | if (seqno < ring->sync_seqno[i]) { |
1180 | /* The GPU can not handle its semaphore value wrapping, | 1180 | /* The GPU can not handle its semaphore value wrapping, |
1181 | * so every billion or so execbuffers, we need to stall | 1181 | * so every billion or so execbuffers, we need to stall |