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>
(cherry picked from commit b2d7386631)
This commit is contained in:
Nanley Chery 2023-04-10 14:26:37 -07:00 committed by Eric Engestrom
parent 808a95d24a
commit db5c94d170
2 changed files with 9 additions and 1 deletions

View file

@ -490,7 +490,7 @@
"description": "iris/bufmgr: Handle flat_ccs for BO_ALLOC_ZEROED",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

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;