1bf215546Sopenharmony_ci#ifndef __NV50_QUERY_H__
2bf215546Sopenharmony_ci#define __NV50_QUERY_H__
3bf215546Sopenharmony_ci
4bf215546Sopenharmony_ci#include "pipe/p_context.h"
5bf215546Sopenharmony_ci
6bf215546Sopenharmony_ci#include "nouveau_context.h"
7bf215546Sopenharmony_ci
8bf215546Sopenharmony_cistruct nv50_context;
9bf215546Sopenharmony_cistruct nv50_query;
10bf215546Sopenharmony_ci
11bf215546Sopenharmony_cistruct nv50_query_funcs {
12bf215546Sopenharmony_ci   void (*destroy_query)(struct nv50_context *, struct nv50_query *);
13bf215546Sopenharmony_ci   bool (*begin_query)(struct nv50_context *, struct nv50_query *);
14bf215546Sopenharmony_ci   void (*end_query)(struct nv50_context *, struct nv50_query *);
15bf215546Sopenharmony_ci   bool (*get_query_result)(struct nv50_context *, struct nv50_query *,
16bf215546Sopenharmony_ci                            bool, union pipe_query_result *);
17bf215546Sopenharmony_ci};
18bf215546Sopenharmony_ci
19bf215546Sopenharmony_cistruct nv50_query {
20bf215546Sopenharmony_ci   const struct nv50_query_funcs *funcs;
21bf215546Sopenharmony_ci   uint16_t type;
22bf215546Sopenharmony_ci   uint16_t index;
23bf215546Sopenharmony_ci};
24bf215546Sopenharmony_ci
25bf215546Sopenharmony_cistatic inline struct nv50_query *
26bf215546Sopenharmony_cinv50_query(struct pipe_query *pipe)
27bf215546Sopenharmony_ci{
28bf215546Sopenharmony_ci   return (struct nv50_query *)pipe;
29bf215546Sopenharmony_ci}
30bf215546Sopenharmony_ci
31bf215546Sopenharmony_ci/*
32bf215546Sopenharmony_ci * Driver queries groups:
33bf215546Sopenharmony_ci */
34bf215546Sopenharmony_ci#define NV50_HW_SM_QUERY_GROUP       0
35bf215546Sopenharmony_ci#define NV50_HW_METRIC_QUERY_GROUP   1
36bf215546Sopenharmony_ci
37bf215546Sopenharmony_civoid nv50_init_query_functions(struct nv50_context *);
38bf215546Sopenharmony_ci
39bf215546Sopenharmony_ci#endif
40