struct intel_engine_cs *ring,
struct drm_i915_error_ring *ering)
{
- struct intel_engine_cs *useless;
+ struct intel_engine_cs *to;
int i;
if (!i915_semaphore_is_enabled(dev_priv->dev))
dev_priv->semaphore_obj,
&dev_priv->gtt.base);
- for_each_ring(useless, dev_priv, i) {
- u16 signal_offset =
- (GEN8_SIGNAL_OFFSET(ring, i) & PAGE_MASK) / 4;
- u32 *tmp = error->semaphore_obj->pages[0];
+ for_each_ring(to, dev_priv, i) {
+ int idx;
+ u16 signal_offset;
+ u32 *tmp;
- ering->semaphore_mboxes[i] = tmp[signal_offset];
- ering->semaphore_seqno[i] = ring->semaphore.sync_seqno[i];
+ if (ring == to)
+ continue;
+
+ signal_offset = (GEN8_SIGNAL_OFFSET(ring, i) & PAGE_MASK) / 4;
+ tmp = error->semaphore_obj->pages[0];
+ idx = intel_ring_sync_index(ring, to);
+
+ ering->semaphore_mboxes[idx] = tmp[signal_offset];
+ ering->semaphore_seqno[idx] = ring->semaphore.sync_seqno[idx];
}
}