From 1311eddd5265b46d7c13adf14ea97072e80f54a5 Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Fri, 22 Oct 2021 17:17:02 -0700 Subject: [PATCH] iris: fix off-by-one error when clearing stale syncobjs This shouldn't fix any real world bugs, except it will now clear more stale syncobjs than it was previously doing, and actually do what the comment says it does. I could not find a real workload where this change would be relevant, although I didn't try too much. I wrote my own little egl program to test this. I spotted this while reading the code when investigating a Piglit failure [0]. It turns out this part the code was not relvant for the failure. [0]: ext_external_objects-vk-image-display-overwrite Reviewed-by: Lionel Landwerlin Reviewed-by: Kenneth Graunke Signed-off-by: Paulo Zanoni Part-of: --- src/gallium/drivers/iris/iris_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/iris/iris_fence.c b/src/gallium/drivers/iris/iris_fence.c index 54cd5d86240..04513f62bb1 100644 --- a/src/gallium/drivers/iris/iris_fence.c +++ b/src/gallium/drivers/iris/iris_fence.c @@ -147,7 +147,7 @@ clear_stale_syncobjs(struct iris_batch *batch) struct drm_i915_gem_exec_fence)); /* Skip the first syncobj, as it's the signalling one. */ - for (int i = n - 1; i > 1; i--) { + for (int i = n - 1; i > 0; i--) { struct iris_syncobj **syncobj = util_dynarray_element(&batch->syncobjs, struct iris_syncobj *, i); struct drm_i915_gem_exec_fence *fence =