1/* 2 * Copyright © 2016 Red Hat. 3 * Copyright © 2016 Bas Nieuwenhuizen 4 * SPDX-License-Identifier: MIT 5 * 6 * based in part on anv driver which is: 7 * Copyright © 2015 Intel Corporation 8 */ 9 10#ifndef TU_QUERY_H 11#define TU_QUERY_H 12 13#include "tu_common.h" 14 15#define PERF_CNTRS_REG 4 16 17struct tu_perf_query_data 18{ 19 uint32_t gid; /* group-id */ 20 uint32_t cid; /* countable-id within the group */ 21 uint32_t cntr_reg; /* counter register within the group */ 22 uint32_t pass; /* pass index that countables can be requested */ 23 uint32_t app_idx; /* index provided by apps */ 24}; 25 26struct tu_query_pool 27{ 28 struct vk_object_base base; 29 30 VkQueryType type; 31 uint32_t stride; 32 uint64_t size; 33 uint32_t pipeline_statistics; 34 struct tu_bo *bo; 35 36 /* For performance query */ 37 const struct fd_perfcntr_group *perf_group; 38 uint32_t perf_group_count; 39 uint32_t counter_index_count; 40 struct tu_perf_query_data perf_query_data[0]; 41}; 42VK_DEFINE_NONDISP_HANDLE_CASTS(tu_query_pool, base, VkQueryPool, 43 VK_OBJECT_TYPE_QUERY_POOL) 44 45#endif /* TU_QUERY_H */ 46