From a51c64ac5c2ec09611c5f0802b370b5fbc72046d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Wed, 17 Apr 2024 07:01:14 -0700 Subject: [PATCH] iris: Add comments to BO_ALLOC flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Paulo Zanoni Signed-off-by: José Roberto de Souza Part-of: --- src/gallium/drivers/iris/iris_bufmgr.h | 36 ++++++++++++++++++-------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/src/gallium/drivers/iris/iris_bufmgr.h b/src/gallium/drivers/iris/iris_bufmgr.h index c4d4bec3105..b3cff6c1bba 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.h +++ b/src/gallium/drivers/iris/iris_bufmgr.h @@ -348,17 +348,31 @@ struct iris_bo { }; }; -#define BO_ALLOC_PLAIN 0 -#define BO_ALLOC_ZEROED (1<<0) -#define BO_ALLOC_COHERENT (1<<1) -#define BO_ALLOC_SMEM (1<<2) -#define BO_ALLOC_SCANOUT (1<<3) -#define BO_ALLOC_NO_SUBALLOC (1<<4) -#define BO_ALLOC_LMEM (1<<5) -#define BO_ALLOC_PROTECTED (1<<6) -#define BO_ALLOC_SHARED (1<<7) -#define BO_ALLOC_CAPTURE (1<<8) -#define BO_ALLOC_CPU_VISIBLE (1<<9) +/* No special attributes. */ +#define BO_ALLOC_PLAIN 0 +/* Content is set to 0, only done in cache and slabs code paths. */ +#define BO_ALLOC_ZEROED (1<<0) +/* Allocate a cached and coherent BO, this has a performance cost in + * integrated platforms without LLC. + * Should only be used in BOs that will be written and read from CPU often. + */ +#define BO_ALLOC_COHERENT (1<<1) +/* Place BO only on smem. */ +#define BO_ALLOC_SMEM (1<<2) +/* BO can be sent to display. */ +#define BO_ALLOC_SCANOUT (1<<3) +/* No sub-allocation(slabs). */ +#define BO_ALLOC_NO_SUBALLOC (1<<4) +/* Place BO only on lmem. */ +#define BO_ALLOC_LMEM (1<<5) +/* Content is protected, can't be mapped and needs special handling. */ +#define BO_ALLOC_PROTECTED (1<<6) +/* BO can be exported to other applications. */ +#define BO_ALLOC_SHARED (1<<7) +/* BO will be captured in the KMD error dump. */ +#define BO_ALLOC_CAPTURE (1<<8) +/* Can be mapped. */ +#define BO_ALLOC_CPU_VISIBLE (1<<9) /** * Allocate a buffer object.