From 795b14aaa3b3b61ab2eab0eb5d57b398b2d2eb33 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 4 Aug 2021 10:47:31 -0700 Subject: [PATCH] iris: Rewrite bo->index comment to refer to exec_bos[] batch->validation_list[] will be going away shortly, but exec_bos[] will live on. bo->index is the index into both lists, so we can just refer to the one we're not about to delete. Reviewed-by: Paulo Zanoni Part-of: --- src/gallium/drivers/iris/iris_bufmgr.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/iris/iris_bufmgr.h b/src/gallium/drivers/iris/iris_bufmgr.h index d95f5f8..98fae46 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.h +++ b/src/gallium/drivers/iris/iris_bufmgr.h @@ -176,12 +176,13 @@ struct iris_bo { uint64_t aux_map_address; /** - * The validation list index for this buffer, or -1 when not in a batch. - * Note that a single buffer may be in multiple batches (contexts), and - * this is a global field, which refers to the last batch using the BO. - * It should not be considered authoritative, but can be used to avoid a - * linear walk of the validation list in the common case by guessing that - * exec_bos[bo->index] == bo and confirming whether that's the case. + * If this BO is referenced by a batch, this _may_ be the index into the + * batch->exec_bos[] list. + * + * Note that a single buffer may be used by multiple batches/contexts, + * and thus appear in multiple lists, but we only track one index here. + * In the common case one can guess that batch->exec_bos[bo->index] == bo + * and double check if that's true to avoid a linear list walk. * * XXX: this is not ideal now that we have more than one batch per context, * XXX: as the index will flop back and forth between the render index and -- 2.7.4