aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nv50/nv50_query.h
blob: 7dfc727cf29d7799cff5cd291528050ceea90066 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef __NV50_QUERY_H__
#define __NV50_QUERY_H__

#include "pipe/p_context.h"

#include "nouveau_context.h"

struct nv50_context;
struct nv50_query;

struct nv50_query_funcs {
   void (*destroy_query)(struct nv50_context *, struct nv50_query *);
   bool (*begin_query)(struct nv50_context *, struct nv50_query *);
   void (*end_query)(struct nv50_context *, struct nv50_query *);
   bool (*get_query_result)(struct nv50_context *, struct nv50_query *,
                            bool, union pipe_query_result *);
};

struct nv50_query {
   const struct nv50_query_funcs *funcs;
   uint16_t type;
   uint16_t index;
};

static inline struct nv50_query *
nv50_query(struct pipe_query *pipe)
{
   return (struct nv50_query *)pipe;
}

/*
 * Driver queries groups:
 */
#define NV50_HW_SM_QUERY_GROUP       0
#define NV50_HW_METRIC_QUERY_GROUP   1

void nv50_init_query_functions(struct nv50_context *);

#endif