diff options
Diffstat (limited to 'src/intel/vulkan/anv_image.c')
-rw-r--r-- | src/intel/vulkan/anv_image.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index a297cc47320..c3d1810cee8 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -93,7 +93,8 @@ choose_isl_surf_usage(VkImageCreateFlags vk_create_flags, static isl_tiling_flags_t choose_isl_tiling_flags(const struct anv_image_create_info *anv_info, - const struct isl_drm_modifier_info *isl_mod_info) + const struct isl_drm_modifier_info *isl_mod_info, + bool legacy_scanout) { const VkImageCreateInfo *base_info = anv_info->vk_info; isl_tiling_flags_t flags = 0; @@ -112,6 +113,9 @@ choose_isl_tiling_flags(const struct anv_image_create_info *anv_info, if (anv_info->isl_tiling_flags) flags &= anv_info->isl_tiling_flags; + if (legacy_scanout) + flags &= ISL_TILING_LINEAR_BIT | ISL_TILING_X_BIT; + if (isl_mod_info) flags &= 1 << isl_mod_info->tiling; @@ -504,19 +508,6 @@ make_surface(const struct anv_device *dev, return VK_SUCCESS; } -static const struct isl_drm_modifier_info * -get_legacy_scanout_drm_format_mod(VkImageTiling tiling) -{ - switch (tiling) { - case VK_IMAGE_TILING_OPTIMAL: - return isl_drm_modifier_get_info(I915_FORMAT_MOD_X_TILED); - case VK_IMAGE_TILING_LINEAR: - return isl_drm_modifier_get_info(DRM_FORMAT_MOD_LINEAR); - default: - unreachable("bad VkImageTiling"); - } -} - VkResult anv_image_create(VkDevice _device, const struct anv_image_create_info *create_info, @@ -533,8 +524,6 @@ anv_image_create(VkDevice _device, const struct wsi_image_create_info *wsi_info = vk_find_struct_const(pCreateInfo->pNext, WSI_IMAGE_CREATE_INFO_MESA); - if (wsi_info && wsi_info->scanout) - isl_mod_info = get_legacy_scanout_drm_format_mod(pCreateInfo->tiling); anv_assert(pCreateInfo->mipLevels > 0); anv_assert(pCreateInfo->arrayLayers > 0); @@ -559,14 +548,14 @@ anv_image_create(VkDevice _device, image->usage = pCreateInfo->usage; image->tiling = pCreateInfo->tiling; image->disjoint = pCreateInfo->flags & VK_IMAGE_CREATE_DISJOINT_BIT_KHR; - image->drm_format_mod = isl_mod_info ? isl_mod_info->modifier : - DRM_FORMAT_MOD_INVALID; + image->needs_set_tiling = wsi_info && wsi_info->scanout; const struct anv_format *format = anv_get_format(image->vk_format); assert(format != NULL); const isl_tiling_flags_t isl_tiling_flags = - choose_isl_tiling_flags(create_info, isl_mod_info); + choose_isl_tiling_flags(create_info, isl_mod_info, + image->needs_set_tiling); image->n_planes = format->n_planes; |