iris/bufmgr: Handle flat_ccs for BO_ALLOC_ZEROED

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 <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22487>
This commit is contained in:
Nanley Chery
2023-04-10 14:26:37 -07:00
committed by Marge Bot
parent 215fbbb604
commit b2d7386631
+8
View File
@@ -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;