anv: Use different PAT entries for compressed resources

Displayable compressed resournces have a different PAT
entry from the non-displayable compressed.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29928>
This commit is contained in:
Jianxun Zhang
2024-06-26 17:26:03 -07:00
parent 6eeb079653
commit 2212865ce0
+7 -2
View File
@@ -2176,8 +2176,13 @@ anv_device_get_pat_entry(struct anv_device *device,
if (alloc_flags & ANV_BO_ALLOC_IMPORTED)
return &device->info->pat.cached_coherent;
if (alloc_flags & ANV_BO_ALLOC_COMPRESSED)
return &device->info->pat.compressed;
if (alloc_flags & ANV_BO_ALLOC_COMPRESSED) {
/* Compressed PAT entries are available on Xe2+. */
assert(device->info->ver >= 20);
return alloc_flags & ANV_BO_ALLOC_SCANOUT ?
&device->info->pat.compressed_scanout :
&device->info->pat.compressed;
}
if (alloc_flags & (ANV_BO_ALLOC_EXTERNAL | ANV_BO_ALLOC_SCANOUT))
return &device->info->pat.scanout;