intel/isl: Add and use isl_drm_modifier_needs_display_layout
Intel modifiers supporting compression are specified to be compatible with the display engine, even if they won't actually be used for scanout. Attempting to capture a wider scope of modifiers resulted in test errors. I chose to narrow the scope instead of digging into them. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29659>
This commit is contained in:
@@ -760,6 +760,9 @@ iris_resource_configure_main(const struct iris_screen *screen,
|
||||
if (templ->bind & PIPE_BIND_SCANOUT)
|
||||
usage |= ISL_SURF_USAGE_DISPLAY_BIT;
|
||||
|
||||
else if (isl_drm_modifier_needs_display_layout(modifier))
|
||||
usage |= ISL_SURF_USAGE_DISPLAY_BIT;
|
||||
|
||||
if (templ->target == PIPE_TEXTURE_CUBE ||
|
||||
templ->target == PIPE_TEXTURE_CUBE_ARRAY) {
|
||||
usage |= ISL_SURF_USAGE_CUBE_BIT;
|
||||
|
||||
@@ -2420,6 +2420,15 @@ isl_drm_modifier_has_aux(uint64_t modifier)
|
||||
isl_drm_modifier_get_info(modifier)->supports_media_compression;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
isl_drm_modifier_needs_display_layout(uint64_t modifier)
|
||||
{
|
||||
/* Modifiers supporting compression are specified to be compatible with the
|
||||
* display engine, even if they won't actually be used for scanout.
|
||||
*/
|
||||
return isl_drm_modifier_has_aux(modifier);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
isl_drm_modifier_plane_is_clear_color(uint64_t modifier, uint32_t plane)
|
||||
{
|
||||
|
||||
@@ -1554,6 +1554,8 @@ anv_image_init(struct anv_device *device, struct anv_image *image,
|
||||
image->vk.stencil_usage =
|
||||
anv_image_create_usage(pCreateInfo, image->vk.stencil_usage);
|
||||
|
||||
isl_surf_usage_flags_t isl_extra_usage_flags =
|
||||
create_info->isl_extra_usage_flags;
|
||||
if (pCreateInfo->tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT) {
|
||||
assert(!image->vk.wsi_legacy_scanout);
|
||||
mod_explicit_info =
|
||||
@@ -1573,6 +1575,9 @@ anv_image_init(struct anv_device *device, struct anv_image *image,
|
||||
assert(isl_mod_info);
|
||||
assert(image->vk.drm_format_mod == DRM_FORMAT_MOD_INVALID);
|
||||
image->vk.drm_format_mod = isl_mod_info->modifier;
|
||||
|
||||
if (isl_drm_modifier_needs_display_layout(image->vk.drm_format_mod))
|
||||
isl_extra_usage_flags |= ISL_SURF_USAGE_DISPLAY_BIT;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ANV_IMAGE_MEMORY_BINDING_END; ++i) {
|
||||
@@ -1604,7 +1609,6 @@ anv_image_init(struct anv_device *device, struct anv_image *image,
|
||||
image->disjoint = image->n_planes > 1 &&
|
||||
(pCreateInfo->flags & VK_IMAGE_CREATE_DISJOINT_BIT);
|
||||
|
||||
isl_surf_usage_flags_t isl_extra_usage_flags = create_info->isl_extra_usage_flags;
|
||||
if (anv_is_format_emulated(device->physical, pCreateInfo->format)) {
|
||||
assert(image->n_planes == 1 &&
|
||||
vk_format_is_compressed(image->vk.format));
|
||||
|
||||
Reference in New Issue
Block a user