It is observed that in display resolutions where width is not equal to
stride, vulkan rendering is being distorted. This is happening due to
stride calculation mismatch between minigbm and mesa.
This fix makes sure that the stride calculated in minigbm is passed to
anv and isl.
The issue was found while debugging the following android cts tests and
thus fixes them as well.
android.graphics.cts.VulkanPreTransformTest#testVulkanPreTransformNotSetToMatchCurrentTransform
android.graphics.cts.VulkanPreTransformTest#testVulkanPreTransformSetToMatchCurrentTransform
Signed-off-by: Sai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22163>
base_info->tiling);
assert(format != ISL_FORMAT_UNSUPPORTED);
+ anv_info.stride = gralloc_info->stride * (isl_format_get_layout(format)->bpb / 8);
+
result = anv_image_init(device, image, &anv_info);
if (result != VK_SUCCESS)
goto fail_init;
mod_explicit_info, isl_tiling_flags,
create_info->isl_extra_usage_flags);
} else {
- r = add_all_surfaces_implicit_layout(device, image, fmt_list, 0,
+ r = add_all_surfaces_implicit_layout(device, image, fmt_list, create_info->stride,
isl_tiling_flags,
create_info->isl_extra_usage_flags);
}
/** These flags will be added to any derived from VkImageCreateInfo. */
isl_surf_usage_flags_t isl_extra_usage_flags;
+
+ /** An opt-in stride, should be 0 for implicit layouts */
+ uint32_t stride;
};
VkResult anv_image_init(struct anv_device *device, struct anv_image *image,