From d178334d5cafa9b215d38c7c443c4dbc168e66c5 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 22 Dec 2023 04:00:37 -0800 Subject: [PATCH] iris: Initialize bo->index to -1 when importing buffers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Lionel Landwerlin Part-of: --- src/gallium/drivers/iris/iris_bufmgr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c index f0e483289fc..4bdb969b17d 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.c +++ b/src/gallium/drivers/iris/iris_bufmgr.c @@ -1407,6 +1407,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; @@ -1931,6 +1932,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; /* Xe KMD expects at least 1-way coherency for imports */