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