diff --git a/.pick_status.json b/.pick_status.json index dbf47828a23..974a111ea2e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -211,7 +211,7 @@ "description": "crocus: find correct relocation target for the bo.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "f3630548f1da904ec6c63b43ece7e68afdb8867e" }, diff --git a/src/gallium/drivers/crocus/ci/crocus-hsw-flakes.txt b/src/gallium/drivers/crocus/ci/crocus-hsw-flakes.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/gallium/drivers/crocus/crocus_batch.c b/src/gallium/drivers/crocus/crocus_batch.c index 318edd00edf..8073f7813d0 100644 --- a/src/gallium/drivers/crocus/crocus_batch.c +++ b/src/gallium/drivers/crocus/crocus_batch.c @@ -263,21 +263,30 @@ crocus_init_batch(struct crocus_context *ice, crocus_batch_reset(batch); } -static struct drm_i915_gem_exec_object2 * -find_validation_entry(struct crocus_batch *batch, struct crocus_bo *bo) +static int +find_exec_index(struct crocus_batch *batch, struct crocus_bo *bo) { unsigned index = READ_ONCE(bo->index); if (index < batch->exec_count && batch->exec_bos[index] == bo) - return &batch->validation_list[index]; + return index; /* May have been shared between multiple active batches */ for (index = 0; index < batch->exec_count; index++) { if (batch->exec_bos[index] == bo) - return &batch->validation_list[index]; + return index; } + return -1; +} - return NULL; +static struct drm_i915_gem_exec_object2 * +find_validation_entry(struct crocus_batch *batch, struct crocus_bo *bo) +{ + int index = find_exec_index(batch, bo); + + if (index == -1) + return NULL; + return &batch->validation_list[index]; } static void @@ -409,7 +418,7 @@ emit_reloc(struct crocus_batch *batch, (struct drm_i915_gem_relocation_entry) { .offset = offset, .delta = target_offset, - .target_handle = target->index, + .target_handle = find_exec_index(batch, target), .presumed_offset = entry->offset, };