From b2d7386631f44bcdb8ba0c42fef78ae7b3380f14 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Mon, 10 Apr 2023 14:26:37 -0700 Subject: [PATCH] iris/bufmgr: Handle flat_ccs for BO_ALLOC_ZEROED MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We can't map the CCS memory region. So, rely on the kernel's zeroing of new allocations. This is helpful when creating dmabufs that use compression. Cc: mesa-stable Reviewed-by: José Roberto de Souza Part-of: --- src/gallium/drivers/iris/iris_bufmgr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c index f5ff198..6227bad 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.c +++ b/src/gallium/drivers/iris/iris_bufmgr.c @@ -794,6 +794,14 @@ zero_bo(struct iris_bufmgr *bufmgr, { assert(flags & BO_ALLOC_ZEROED); + if (bufmgr->devinfo.has_flat_ccs && (flags & BO_ALLOC_LMEM)) { + /* With flat CCS, all allocations in LMEM have memory ranges with + * corresponding CCS elements. These elements are only accessible + * through GPU commands, but we don't issue GPU commands here. + */ + return false; + } + void *map = iris_bo_map(NULL, bo, MAP_WRITE | MAP_RAW); if (!map) return false; -- 2.7.4