Module: Mesa Branch: staging/23.3 Commit: 72dac9936f6801655b2efbce696beacb65e744dc URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=72dac9936f6801655b2efbce696beacb65e744dc
Author: Kenneth Graunke <[email protected]> Date: Fri Dec 22 04:00:37 2023 -0800 iris: Initialize bo->index to -1 when importing buffers A value of -1 means that the buffer has never been used in an execbuf buffer list in any of our contexts. While setting this isn't critical, doing so will allow us to short-circuit some looping in the next patch. Cc: mesa-stable Reviewed-by: José Roberto de Souza <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26806> (cherry picked from commit d178334d5cafa9b215d38c7c443c4dbc168e66c5) --- .pick_status.json | 2 +- src/gallium/drivers/iris/iris_bufmgr.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 9c2d1232b69..c5fedf38444 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -24,7 +24,7 @@ "description": "iris: Initialize bo->index to -1 when importing buffers", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c index e7e55049f36..f76ef870e1e 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.c +++ b/src/gallium/drivers/iris/iris_bufmgr.c @@ -1413,6 +1413,7 @@ iris_bo_gem_create_from_name(struct iris_bufmgr *bufmgr, bo->bufmgr = bufmgr; bo->gem_handle = open_arg.handle; bo->name = name; + bo->index = -1; bo->real.global_name = handle; bo->real.prime_fd = -1; bo->real.reusable = false; @@ -1974,6 +1975,7 @@ iris_bo_import_dmabuf(struct iris_bufmgr *bufmgr, int prime_fd, bo->bufmgr = bufmgr; bo->name = "prime"; + bo->index = -1; bo->real.reusable = false; bo->real.imported = true; bo->real.mmap_mode = IRIS_MMAP_NONE;
