anv: enable blorp query reset for performance queries
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22480>
This commit is contained in:
@@ -4153,6 +4153,14 @@ struct anv_query_pool {
|
|||||||
uint32_t slots;
|
uint32_t slots;
|
||||||
struct anv_bo * bo;
|
struct anv_bo * bo;
|
||||||
|
|
||||||
|
/** Location for the KHR_performance_query small batch updating
|
||||||
|
* ANV_PERF_QUERY_OFFSET_REG
|
||||||
|
*/
|
||||||
|
uint32_t khr_perf_preambles_offset;
|
||||||
|
|
||||||
|
/** Size of each small batch */
|
||||||
|
uint32_t khr_perf_preamble_stride;
|
||||||
|
|
||||||
/* KHR perf queries : */
|
/* KHR perf queries : */
|
||||||
uint32_t pass_size;
|
uint32_t pass_size;
|
||||||
uint32_t data_offset;
|
uint32_t data_offset;
|
||||||
@@ -4166,7 +4174,8 @@ struct anv_query_pool {
|
|||||||
static inline uint32_t khr_perf_query_preamble_offset(const struct anv_query_pool *pool,
|
static inline uint32_t khr_perf_query_preamble_offset(const struct anv_query_pool *pool,
|
||||||
uint32_t pass)
|
uint32_t pass)
|
||||||
{
|
{
|
||||||
return pool->pass_size * pass + 8;
|
return pool->khr_perf_preambles_offset +
|
||||||
|
pool->khr_perf_preamble_stride * pass;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct anv_vid_mem {
|
struct anv_vid_mem {
|
||||||
|
@@ -156,7 +156,7 @@ VkResult genX(CreateQueryPool)(
|
|||||||
perf_query_info->counterIndexCount);
|
perf_query_info->counterIndexCount);
|
||||||
vk_multialloc_add(&ma, &pass_query, struct intel_perf_query_info *,
|
vk_multialloc_add(&ma, &pass_query, struct intel_perf_query_info *,
|
||||||
n_passes);
|
n_passes);
|
||||||
uint64s_per_slot = 4 /* availability + small batch */;
|
uint64s_per_slot = 1 /* availability */;
|
||||||
/* Align to the requirement of the layout */
|
/* Align to the requirement of the layout */
|
||||||
uint64s_per_slot = align(uint64s_per_slot,
|
uint64s_per_slot = align(uint64s_per_slot,
|
||||||
DIV_ROUND_UP(layout->alignment, sizeof(uint64_t)));
|
DIV_ROUND_UP(layout->alignment, sizeof(uint64_t)));
|
||||||
@@ -222,6 +222,16 @@ VkResult genX(CreateQueryPool)(
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint64_t size = pool->slots * (uint64_t)pool->stride;
|
uint64_t size = pool->slots * (uint64_t)pool->stride;
|
||||||
|
|
||||||
|
/* For KHR_performance_query we need some space in the buffer for a small
|
||||||
|
* batch updating ANV_PERF_QUERY_OFFSET_REG.
|
||||||
|
*/
|
||||||
|
if (pool->type == VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR) {
|
||||||
|
pool->khr_perf_preamble_stride = 32;
|
||||||
|
pool->khr_perf_preambles_offset = size;
|
||||||
|
size += pool->n_passes * pool->khr_perf_preamble_stride;
|
||||||
|
}
|
||||||
|
|
||||||
result = anv_device_alloc_bo(device, "query-pool", size,
|
result = anv_device_alloc_bo(device, "query-pool", size,
|
||||||
ANV_BO_ALLOC_MAPPED |
|
ANV_BO_ALLOC_MAPPED |
|
||||||
ANV_BO_ALLOC_SNOOPED,
|
ANV_BO_ALLOC_SNOOPED,
|
||||||
@@ -277,36 +287,24 @@ void genX(DestroyQueryPool)(
|
|||||||
* --------------------------------------------
|
* --------------------------------------------
|
||||||
* | availability (8b) | | |
|
* | availability (8b) | | |
|
||||||
* |-------------------------------| | |
|
* |-------------------------------| | |
|
||||||
* | Small batch loading | | |
|
|
||||||
* | ANV_PERF_QUERY_OFFSET_REG | | |
|
|
||||||
* | (24b) | | Pass 0 |
|
|
||||||
* |-------------------------------| | |
|
|
||||||
* | some padding (see | | |
|
* | some padding (see | | |
|
||||||
* | query_field_layout:alignment) | | |
|
* | query_field_layout:alignment) | | Pass 0 |
|
||||||
* |-------------------------------| | |
|
* |-------------------------------| | |
|
||||||
* | query data | | |
|
* | query data | | |
|
||||||
* | (2 * query_field_layout:size) | | |
|
* | (2 * query_field_layout:size) | | |
|
||||||
* |-------------------------------|-- | Query 0
|
* |-------------------------------|-- | Query 0
|
||||||
* | availability (8b) | | |
|
* | availability (8b) | | |
|
||||||
* |-------------------------------| | |
|
* |-------------------------------| | |
|
||||||
* | Small batch loading | | |
|
|
||||||
* | ANV_PERF_QUERY_OFFSET_REG | | |
|
|
||||||
* | (24b) | | Pass 1 |
|
|
||||||
* |-------------------------------| | |
|
|
||||||
* | some padding (see | | |
|
* | some padding (see | | |
|
||||||
* | query_field_layout:alignment) | | |
|
* | query_field_layout:alignment) | | Pass 1 |
|
||||||
* |-------------------------------| | |
|
* |-------------------------------| | |
|
||||||
* | query data | | |
|
* | query data | | |
|
||||||
* | (2 * query_field_layout:size) | | |
|
* | (2 * query_field_layout:size) | | |
|
||||||
* |-------------------------------|-----------
|
* |-------------------------------|-----------
|
||||||
* | availability (8b) | | |
|
* | availability (8b) | | |
|
||||||
* |-------------------------------| | |
|
* |-------------------------------| | |
|
||||||
* | Small batch loading | | |
|
|
||||||
* | ANV_PERF_QUERY_OFFSET_REG | | |
|
|
||||||
* | (24b) | | Pass 0 |
|
|
||||||
* |-------------------------------| | |
|
|
||||||
* | some padding (see | | |
|
* | some padding (see | | |
|
||||||
* | query_field_layout:alignment) | | |
|
* | query_field_layout:alignment) | | Pass 0 |
|
||||||
* |-------------------------------| | |
|
* |-------------------------------| | |
|
||||||
* | query data | | |
|
* | query data | | |
|
||||||
* | (2 * query_field_layout:size) | | |
|
* | (2 * query_field_layout:size) | | |
|
||||||
@@ -787,8 +785,7 @@ void genX(CmdResetQueryPool)(
|
|||||||
/* Temporarily disable on MTL until we understand why some tests hang.
|
/* Temporarily disable on MTL until we understand why some tests hang.
|
||||||
*/
|
*/
|
||||||
if (queryCount >= pdevice->instance->query_clear_with_blorp_threshold &&
|
if (queryCount >= pdevice->instance->query_clear_with_blorp_threshold &&
|
||||||
!intel_device_info_is_mtl(cmd_buffer->device->info) &&
|
!intel_device_info_is_mtl(cmd_buffer->device->info)) {
|
||||||
pool->type != VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR) {
|
|
||||||
anv_cmd_buffer_fill_area(cmd_buffer,
|
anv_cmd_buffer_fill_area(cmd_buffer,
|
||||||
anv_query_address(pool, firstQuery),
|
anv_query_address(pool, firstQuery),
|
||||||
queryCount * pool->stride,
|
queryCount * pool->stride,
|
||||||
|
Reference in New Issue
Block a user