From 765a9f4fd90b37e48df6dc45e5453313b8561ca8 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Fri, 6 Mar 2026 01:59:54 +0800 Subject: [PATCH] pvr: Align width for PBE write when creating linear image Even if a linear image isn't created with usages declaring PBE writes, the image might be exported and then re-imported with a usage that allows rendering to. Always align linear images' width for being written by PBE. This fixes WSI creating surfaces with odd width, exporting them and re-importing for rendering. Backport-to: 26.0 Signed-off-by: Icenowy Zheng Reviewed-by: Frank Binns Part-of: --- src/imagination/vulkan/pvr_image.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/imagination/vulkan/pvr_image.c b/src/imagination/vulkan/pvr_image.c index aa8097a169b..3ba53aecdf5 100644 --- a/src/imagination/vulkan/pvr_image.c +++ b/src/imagination/vulkan/pvr_image.c @@ -94,14 +94,9 @@ static void pvr_image_plane_init_physical_extent( assert(image->memlayout == PVR_MEMLAYOUT_LINEAR); plane->physical_extent = image->vk.extent; - /* If the image is being rendered to (written by the PBE) make sure the - * width is aligned correctly. - */ - if (image->vk.usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | - VK_IMAGE_USAGE_TRANSFER_DST_BIT)) { - plane->physical_extent.width = - align(plane->physical_extent.width, pbe_stride_align); - } + /* Align the image for being rendered to (written by the PBE). */ + plane->physical_extent.width = + align(plane->physical_extent.width, pbe_stride_align); if (image->vk.tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT) { const VkImageDrmFormatModifierExplicitCreateInfoEXT *explicit_mod =