Mesa (main): iris: fix off-by-one error when clearing stale syncobjs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 2 08:48:28 UTC 2021


Module: Mesa
Branch: main
Commit: 1311eddd5265b46d7c13adf14ea97072e80f54a5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1311eddd5265b46d7c13adf14ea97072e80f54a5

Author: Paulo Zanoni <paulo.r.zanoni at intel.com>
Date:   Fri Oct 22 17:17:02 2021 -0700

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 <lionel.g.landwerlin at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13536>

---

 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 =



More information about the mesa-commit mailing list