mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-13 17:30:32 +01:00
anv: skip compressed flag for bo if not supported by modifier
This has not been problem before the compression hint given to kernel
but now that we set it we hit problems when allocating bo if modifier
does not support compression.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14625
Fixes: f91de58818 ("anv: Add support to DRM_XE_GEM_CREATE_FLAG_NO_COMPRESSION")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39710>
This commit is contained in:
parent
ece5f671b3
commit
fc814fa828
1 changed files with 11 additions and 12 deletions
|
|
@ -1579,19 +1579,18 @@ VkResult anv_AllocateMemory(
|
|||
NULL;
|
||||
mem->dedicated_image = image;
|
||||
|
||||
/* If there is a dedicated image with a modifier, use that to determine
|
||||
* compression, otherwise use the memory type.
|
||||
*/
|
||||
if (device->info->ver >= 20 && image &&
|
||||
image->vk.tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT &&
|
||||
isl_drm_modifier_has_aux(image->vk.drm_format_mod)) {
|
||||
/* ISL should skip compression modifiers when no_ccs is set. */
|
||||
assert(!INTEL_DEBUG(DEBUG_NO_CCS));
|
||||
/* Images created with the Xe2 modifiers should be allocated into
|
||||
* compressed memory, but we won't get such info from the memory type,
|
||||
* refer to anv_image_is_pat_compressible(). We have to check the
|
||||
* modifiers and enable compression if we can here.
|
||||
*/
|
||||
alloc_flags |= ANV_BO_ALLOC_COMPRESSED;
|
||||
} else if (mem_type->compressed && !INTEL_DEBUG(DEBUG_NO_CCS)) {
|
||||
alloc_flags |= ANV_BO_ALLOC_COMPRESSED;
|
||||
image->vk.tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT) {
|
||||
const bool needs_compression =
|
||||
isl_drm_modifier_has_aux(image->vk.drm_format_mod);
|
||||
assert(!needs_compression || !INTEL_DEBUG(DEBUG_NO_CCS));
|
||||
alloc_flags |= needs_compression ? ANV_BO_ALLOC_COMPRESSED : 0;
|
||||
} else {
|
||||
alloc_flags |= (mem_type->compressed && !INTEL_DEBUG(DEBUG_NO_CCS)) ?
|
||||
ANV_BO_ALLOC_COMPRESSED : 0;
|
||||
}
|
||||
|
||||
/* Anything imported or exported is EXTERNAL */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue