From ca4f356d3747b6969597de0fe7d222c59d4abcdf 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 (cherry picked from commit 765a9f4fd90b37e48df6dc45e5453313b8561ca8) Part-of: --- .pick_status.json | 2 +- src/imagination/vulkan/pvr_image.c | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index aaa21c0544a..9a1650f9777 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2174,7 +2174,7 @@ "description": "pvr: Align width for PBE write when creating linear image", "nominated": true, "nomination_type": 4, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/imagination/vulkan/pvr_image.c b/src/imagination/vulkan/pvr_image.c index 09458aad3f6..079985e5b1b 100644 --- a/src/imagination/vulkan/pvr_image.c +++ b/src/imagination/vulkan/pvr_image.c @@ -84,14 +84,9 @@ static void pvr_image_init_physical_extent(struct pvr_image *image, assert(image->memlayout == PVR_MEMLAYOUT_LINEAR); image->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)) { - image->physical_extent.width = - align(image->physical_extent.width, pbe_stride_align); - } + /* Align the image for being rendered to (written by the PBE). */ + image->physical_extent.width = + align(image->physical_extent.width, pbe_stride_align); } }