Commit 076e2c0e authored by Chris Wilson's avatar Chris Wilson

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: default avatarJiri Slaby <jirislaby@gmail.com>
Tested-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent c7dca47b
...@@ -1857,7 +1857,7 @@ i915_gem_retire_requests_ring(struct drm_device *dev, ...@@ -1857,7 +1857,7 @@ i915_gem_retire_requests_ring(struct drm_device *dev,
seqno = ring->get_seqno(ring); seqno = ring->get_seqno(ring);
for (i = 0; i < I915_NUM_RINGS; i++) for (i = 0; i < ARRAY_SIZE(ring->sync_seqno); i++)
if (seqno >= ring->sync_seqno[i]) if (seqno >= ring->sync_seqno[i])
ring->sync_seqno[i] = 0; ring->sync_seqno[i] = 0;
......
...@@ -1175,7 +1175,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, ...@@ -1175,7 +1175,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
goto err; goto err;
seqno = i915_gem_next_request_seqno(dev, ring); seqno = i915_gem_next_request_seqno(dev, ring);
for (i = 0; i < I915_NUM_RINGS-1; i++) { for (i = 0; i < ARRAY_SIZE(ring->sync_seqno); i++) {
if (seqno < ring->sync_seqno[i]) { if (seqno < ring->sync_seqno[i]) {
/* The GPU can not handle its semaphore value wrapping, /* The GPU can not handle its semaphore value wrapping,
* so every billion or so execbuffers, we need to stall * so every billion or so execbuffers, we need to stall
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment