From 745d576516775e4d3618e77a976b34f74298a15a Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Fri, 14 Nov 2025 12:02:05 +0100 Subject: [PATCH] pvr: make queries arch-agnostic The only HW-definition we depend on here is the occlusion query minimum alignment. But this value doesn't differ per arch, so let's just make it a global define for now. This should probably have a better name and location. But AFAICT, this applies to a lot in this header. So let's untangle this down the road instead. Acked-by: Ashish Chauhan Acked-by: Frank Binns Part-of: --- src/imagination/include/hwdef/rogue_hw_defs.h | 2 ++ src/imagination/vulkan/pvr_query.c | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/imagination/include/hwdef/rogue_hw_defs.h b/src/imagination/include/hwdef/rogue_hw_defs.h index 56cae0f86c0..8b40f9b4656 100644 --- a/src/imagination/include/hwdef/rogue_hw_defs.h +++ b/src/imagination/include/hwdef/rogue_hw_defs.h @@ -48,6 +48,8 @@ #define ROGUE_ICACHE_ALIGN 8U +#define ROGUE_OQUERY_ALIGN 16U + #define ROGUE_MAX_ALU_INPUTS 6U #define ROGUE_ALU_INPUT_GROUP_SIZE (ROGUE_MAX_ALU_INPUTS / 2) #define ROGUE_MAX_ALU_OUTPUTS 2U diff --git a/src/imagination/vulkan/pvr_query.c b/src/imagination/vulkan/pvr_query.c index d375e31de3b..6bdf86757a7 100644 --- a/src/imagination/vulkan/pvr_query.c +++ b/src/imagination/vulkan/pvr_query.c @@ -76,8 +76,7 @@ VkResult pvr_CreateQueryPool(VkDevice _device, if (!pool) return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY); - pool->result_stride = - ALIGN_POT(query_size, ROGUE_CR_ISP_OCLQRY_BASE_ADDR_ALIGNMENT); + pool->result_stride = ALIGN_POT(query_size, ROGUE_OQUERY_ALIGN); pool->query_count = pCreateInfo->queryCount; @@ -88,7 +87,7 @@ VkResult pvr_CreateQueryPool(VkDevice _device, result = pvr_bo_suballoc(&device->suballoc_vis_test, alloc_size, - ROGUE_CR_ISP_OCLQRY_BASE_ADDR_ALIGNMENT, + ROGUE_OQUERY_ALIGN, false, &pool->result_buffer); if (result != VK_SUCCESS)