panvk: Bump the max image size on v11+
We have more bits to encode the resource size there, so let's increase
the max limits.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Tested-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35731>
diff --git a/src/panfrost/vulkan/panvk_physical_device.c b/src/panfrost/vulkan/panvk_physical_device.c
index f5af7a2..4752a13 100644
--- a/src/panfrost/vulkan/panvk_physical_device.c
+++ b/src/panfrost/vulkan/panvk_physical_device.c
@@ -764,7 +764,9 @@
static VkExtent3D
get_max_2d_image_size(struct panvk_physical_device *phys_dev, VkFormat format)
{
- const uint32_t max_img_size_B = UINT32_MAX;
+ const unsigned arch = pan_arch(phys_dev->kmod.props.gpu_prod_id);
+ const uint64_t max_img_size_B =
+ arch <= 10 ? u_uintN_max(32) : u_uintN_max(48);
const enum pipe_format pfmt = vk_format_to_pipe_format(format);
const uint32_t fmt_blksize = util_format_get_blocksize(pfmt);
/* Evenly split blocks across all axis. */
@@ -785,7 +787,9 @@
static VkExtent3D
get_max_3d_image_size(struct panvk_physical_device *phys_dev, VkFormat format)
{
- const uint32_t max_img_size_B = UINT32_MAX;
+ const unsigned arch = pan_arch(phys_dev->kmod.props.gpu_prod_id);
+ const uint64_t max_img_size_B =
+ arch <= 10 ? u_uintN_max(32) : u_uintN_max(48);
enum pipe_format pfmt = vk_format_to_pipe_format(format);
uint32_t fmt_blksize = util_format_get_blocksize(pfmt);
/* Evenly split blocks across each axis. */
diff --git a/src/panfrost/vulkan/panvk_vX_physical_device.c b/src/panfrost/vulkan/panvk_vX_physical_device.c
index 86cf0fa..817cc91 100644
--- a/src/panfrost/vulkan/panvk_vX_physical_device.c
+++ b/src/panfrost/vulkan/panvk_vX_physical_device.c
@@ -552,9 +552,9 @@
* patched to handle the size/stride field extension.
*/
.maxImageDimension1D = (1 << 16),
- .maxImageDimension2D = (1 << 14) - 1,
- .maxImageDimension3D = (1 << 9),
- .maxImageDimensionCube = (1 << 14) - 1,
+ .maxImageDimension2D = PAN_ARCH <= 10 ? (1 << 14) - 1 : (1 << 16),
+ .maxImageDimension3D = PAN_ARCH <= 10 ? (1 << 9) : (1 << 14),
+ .maxImageDimensionCube = PAN_ARCH <= 10 ? (1 << 14) - 1 : (1 << 16),
.maxImageArrayLayers = (1 << 16),
/* Currently limited by the 1D texture size, which is 2^16.
* TODO: If we expose buffer views as 2D textures, we can increase the