Lines Matching refs:pool

120                 struct v3dv_query_pool *pool,
123 for (uint32_t i = 0; i < pool->perfmon.nperfmons; i++) {
124 assert(i * DRM_V3D_MAX_PERF_COUNTERS < pool->perfmon.ncounters);
127 .ncounters = MIN2(pool->perfmon.ncounters -
132 &pool->perfmon.counters[i * DRM_V3D_MAX_PERF_COUNTERS],
141 pool->queries[query].perf.kperfmon_ids[i] = req.id;
147 struct v3dv_query_pool *pool,
151 if (!pool->queries[query].perf.kperfmon_ids[0])
154 for (uint32_t i = 0; i < pool->perfmon.nperfmons; i++) {
156 .id = pool->queries[query].perf.kperfmon_ids[i]
183 struct v3dv_query_pool *pool =
184 vk_object_zalloc(&device->vk, pAllocator, sizeof(*pool),
186 if (pool == NULL)
189 pool->query_type = pCreateInfo->queryType;
190 pool->query_count = pCreateInfo->queryCount;
195 const uint32_t pool_bytes = sizeof(struct v3dv_query) * pool->query_count;
196 pool->queries = vk_alloc2(&device->vk.alloc, pAllocator, pool_bytes, 8,
198 if (pool->queries == NULL) {
203 switch (pool->query_type) {
209 const uint32_t query_groups = DIV_ROUND_UP(pool->query_count, 16);
211 pool->bo = v3dv_bo_alloc(device, bo_size, "query", true);
212 if (!pool->bo) {
216 if (!v3dv_bo_map(device, pool->bo, bo_size)) {
230 pool->perfmon.ncounters = pq_info->counterIndexCount;
232 pool->perfmon.counters[i] = pq_info->pCounterIndices[i];
234 pool->perfmon.nperfmons = DIV_ROUND_UP(pool->perfmon.ncounters,
237 assert(pool->perfmon.nperfmons <= V3DV_MAX_PERFMONS);
246 for (; query_idx < pool->query_count; query_idx++) {
247 pool->queries[query_idx].maybe_available = false;
248 switch (pool->query_type) {
252 pool->queries[query_idx].bo = pool->bo;
253 pool->queries[query_idx].offset = query_offset;
257 pool->queries[query_idx].value = 0;
262 &pool->queries[query_idx].perf.last_job_sync);
266 for (uint32_t j = 0; j < pool->perfmon.nperfmons; j++)
267 pool->queries[query_idx].perf.kperfmon_ids[j] = 0;
275 *pQueryPool = v3dv_query_pool_to_handle(pool);
280 if (pool->query_type == VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR) {
282 vk_sync_destroy(&device->vk, pool->queries[j].perf.last_job_sync);
285 if (pool->bo)
286 v3dv_bo_free(device, pool->bo);
287 if (pool->queries)
288 vk_free2(&device->vk.alloc, pAllocator, pool->queries);
289 vk_object_free(&device->vk, pAllocator, pool);
300 V3DV_FROM_HANDLE(v3dv_query_pool, pool, queryPool);
302 if (!pool)
305 if (pool->bo)
306 v3dv_bo_free(device, pool->bo);
308 if (pool->query_type == VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR) {
309 for (uint32_t i = 0; i < pool->query_count; i++) {
310 kperfmon_destroy(device, pool, i);
311 vk_sync_destroy(&device->vk, pool->queries[i].perf.last_job_sync);
315 if (pool->queries)
316 vk_free2(&device->vk.alloc, pAllocator, pool->queries);
318 vk_object_free(&device->vk, pAllocator, pool);
381 struct v3dv_query_pool *pool,
387 assert(pool && pool->query_type == VK_QUERY_TYPE_OCCLUSION);
392 struct v3dv_query *q = &pool->queries[query];
402 struct v3dv_query_pool *pool,
408 assert(pool && pool->query_type == VK_QUERY_TYPE_TIMESTAMP);
410 struct v3dv_query *q = &pool->queries[query];
418 struct v3dv_query_pool *pool,
424 assert(pool && pool->query_type == VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR);
426 struct v3dv_query *q = &pool->queries[query];
429 for (uint32_t i = 0; i < pool->perfmon.nperfmons; i++) {
446 for (uint32_t i = 0; i < pool->perfmon.ncounters; i++)
474 struct v3dv_query_pool *pool,
480 switch (pool->query_type) {
482 return write_occlusion_query_result(device, pool, query, do_64bit,
485 return write_timestamp_query_result(device, pool, query, do_64bit,
488 return write_performance_query_result(device, pool, query, do_64bit,
497 struct v3dv_query_pool *pool,
502 struct v3dv_query *q = &pool->queries[query];
504 assert(pool->query_type != VK_QUERY_TYPE_OCCLUSION ||
508 VkResult result = query_wait_available(device, q, pool->query_type);
516 VkResult result = query_check_available(device, q, pool->query_type);
525 get_query_result_count(struct v3dv_query_pool *pool)
527 switch (pool->query_type) {
532 return pool->perfmon.ncounters;
540 struct v3dv_query_pool *pool,
547 assert(first < pool->query_count);
548 assert(first + count <= pool->query_count);
552 pool->query_type == VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR;
556 uint32_t result_count = get_query_result_count(pool);
562 query_is_available(device, pool, i, do_wait, &available);
580 write_query_result(device, pool, i, do_64bit, data, slot);
606 V3DV_FROM_HANDLE(v3dv_query_pool, pool, queryPool);
608 return v3dv_get_query_pool_results(device, pool, firstQuery, queryCount,
619 V3DV_FROM_HANDLE(v3dv_query_pool, pool, queryPool);
621 v3dv_cmd_buffer_reset_queries(cmd_buffer, pool, firstQuery, queryCount);
635 V3DV_FROM_HANDLE(v3dv_query_pool, pool, queryPool);
638 v3dv_cmd_buffer_copy_query_results(cmd_buffer, pool,
650 V3DV_FROM_HANDLE(v3dv_query_pool, pool, queryPool);
652 v3dv_cmd_buffer_begin_query(cmd_buffer, pool, query, flags);
661 V3DV_FROM_HANDLE(v3dv_query_pool, pool, queryPool);
663 v3dv_cmd_buffer_end_query(cmd_buffer, pool, query);
668 struct v3dv_query_pool *pool,
675 assert(i < pool->query_count);
676 struct v3dv_query *q = &pool->queries[i];
678 switch (pool->query_type) {
689 kperfmon_destroy(device, pool, i);
690 kperfmon_create(device, pool, i);
709 V3DV_FROM_HANDLE(v3dv_query_pool, pool, queryPool);
711 v3dv_reset_query_pools(device, pool, firstQuery, queryCount);